Skip to content

Latest commit

 

History

History
933 lines (751 loc) · 37.1 KB

DisruptionGuaranteeDGApi.md

File metadata and controls

933 lines (751 loc) · 37.1 KB

Com.Hopper.Hts.Airlines.Api.DisruptionGuaranteeDGApi

All URIs are relative to https://airlines-api.hopper.com/airline/v1.1

Method HTTP request Description
GetDgContractsId GET /dg_contracts/{id} Get a DG contract
PostCustomerDgContractExercises POST /customer/dg_contract_exercises Create DG Exercise
PostCustomerDgEvents POST /customer/dg/events Create an Event
PostDgContractExercises POST /dg_contract_exercises Create DG Exercise
PostDgContracts POST /dg_contracts Create a DG Contract
PostDgContractsIdPayment POST /dg_contracts/{id}/payment Process DG payment
PostDgOffers POST /dg_offers Create DG Offers
PutDgContractsIdItinerarySlices PUT /dg_contracts/{id}/itinerary_slices Update DG Contract Itinerary Slices
PutDgContractsIdUpdateStatus PUT /dg_contracts/{id}/update_status Update DG Contract Status

GetDgContractsId

DgContract GetDgContractsId (string id)

Get a DG contract

Get a DG contract

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Hopper.Hts.Airlines.Api;
using Com.Hopper.Hts.Airlines.Client;
using Com.Hopper.Hts.Airlines.Model;

namespace Example
{
    public class GetDgContractsIdExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://airlines-api.hopper.com/airline/v1.1";
            // Configure API key authorization: SessionAuth
            config.AddApiKey("HC-Session-ID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("HC-Session-ID", "Bearer");
            // Configure Bearer token for authorization: PartnerAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new DisruptionGuaranteeDGApi(config);
            var id = "id_example";  // string | A unique identifier for a contract

            try
            {
                // Get a DG contract
                DgContract result = apiInstance.GetDgContractsId(id);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DisruptionGuaranteeDGApi.GetDgContractsId: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetDgContractsIdWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Get a DG contract
    ApiResponse<DgContract> response = apiInstance.GetDgContractsIdWithHttpInfo(id);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling DisruptionGuaranteeDGApi.GetDgContractsIdWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
id string A unique identifier for a contract

Return type

DgContract

Authorization

SessionAuth, PartnerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The requested DG contract * Expires -
* Cache-Control -
400 Syntactic errors were encountered while handling the request -
401 The client could not be authenticated -
403 The authenticated client does not have permission to call this endpoint -
404 The requested resource could not be found -
422 Semantic errors were encountered while handling the request -
500 The server encountered an internal error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostCustomerDgContractExercises

DgCustomerCreateContractExerciseResponse PostCustomerDgContractExercises (DgCustomerCreateContractExerciseRequest dgCustomerCreateContractExerciseRequest)

Create DG Exercise

Record that a request to exercise a DG contract has occurred.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Hopper.Hts.Airlines.Api;
using Com.Hopper.Hts.Airlines.Client;
using Com.Hopper.Hts.Airlines.Model;

namespace Example
{
    public class PostCustomerDgContractExercisesExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://airlines-api.hopper.com/airline/v1.1";
            var apiInstance = new DisruptionGuaranteeDGApi(config);
            var dgCustomerCreateContractExerciseRequest = new DgCustomerCreateContractExerciseRequest(); // DgCustomerCreateContractExerciseRequest | 

            try
            {
                // Create DG Exercise
                DgCustomerCreateContractExerciseResponse result = apiInstance.PostCustomerDgContractExercises(dgCustomerCreateContractExerciseRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DisruptionGuaranteeDGApi.PostCustomerDgContractExercises: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the PostCustomerDgContractExercisesWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Create DG Exercise
    ApiResponse<DgCustomerCreateContractExerciseResponse> response = apiInstance.PostCustomerDgContractExercisesWithHttpInfo(dgCustomerCreateContractExerciseRequest);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling DisruptionGuaranteeDGApi.PostCustomerDgContractExercisesWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
dgCustomerCreateContractExerciseRequest DgCustomerCreateContractExerciseRequest

Return type

DgCustomerCreateContractExerciseResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 The created DG contract exercise * HTS-Session-ID - The ID of the current session, see Sessions
400 Syntactic errors were encountered while handling the request -
401 The client could not be authenticated -
403 The authenticated client does not have permission to call this endpoint -
404 The requested resource could not be found -
422 Semantic errors were encountered while handling the request -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostCustomerDgEvents

void PostCustomerDgEvents (DgEvent dgEvent)

Create an Event

Create a new event for analytics

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Hopper.Hts.Airlines.Api;
using Com.Hopper.Hts.Airlines.Client;
using Com.Hopper.Hts.Airlines.Model;

namespace Example
{
    public class PostCustomerDgEventsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://airlines-api.hopper.com/airline/v1.1";
            // Configure API key authorization: SessionAuth
            config.AddApiKey("HC-Session-ID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("HC-Session-ID", "Bearer");

            var apiInstance = new DisruptionGuaranteeDGApi(config);
            var dgEvent = new DgEvent(); // DgEvent | 

            try
            {
                // Create an Event
                apiInstance.PostCustomerDgEvents(dgEvent);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DisruptionGuaranteeDGApi.PostCustomerDgEvents: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the PostCustomerDgEventsWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Create an Event
    apiInstance.PostCustomerDgEventsWithHttpInfo(dgEvent);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling DisruptionGuaranteeDGApi.PostCustomerDgEventsWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
dgEvent DgEvent

Return type

void (empty response body)

Authorization

SessionAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 The event has been successfully created * Expires -
* Cache-Control -
400 Syntactic errors were encountered while handling the request -
401 The client could not be authenticated -
403 The authenticated client does not have permission to call this endpoint -
422 Semantic errors were encountered while handling the request -
500 The server encountered an internal error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostDgContractExercises

CreateDgContractExerciseResponse PostDgContractExercises (CreateDgContractExerciseRequest createDgContractExerciseRequest, string? hCSessionID = null)

Create DG Exercise

Record that a request to exercise a DG contract has occurred.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Hopper.Hts.Airlines.Api;
using Com.Hopper.Hts.Airlines.Client;
using Com.Hopper.Hts.Airlines.Model;

namespace Example
{
    public class PostDgContractExercisesExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://airlines-api.hopper.com/airline/v1.1";
            // Configure Bearer token for authorization: PartnerAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new DisruptionGuaranteeDGApi(config);
            var createDgContractExerciseRequest = new CreateDgContractExerciseRequest(); // CreateDgContractExerciseRequest | 
            var hCSessionID = 9fd3f2f9-e5aa-4128-ace9-3c4ee37b685f;  // string? | The ID of the current airline session, see [Sessions](#tag/Sessions) (optional) 

            try
            {
                // Create DG Exercise
                CreateDgContractExerciseResponse result = apiInstance.PostDgContractExercises(createDgContractExerciseRequest, hCSessionID);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DisruptionGuaranteeDGApi.PostDgContractExercises: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the PostDgContractExercisesWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Create DG Exercise
    ApiResponse<CreateDgContractExerciseResponse> response = apiInstance.PostDgContractExercisesWithHttpInfo(createDgContractExerciseRequest, hCSessionID);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling DisruptionGuaranteeDGApi.PostDgContractExercisesWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
createDgContractExerciseRequest CreateDgContractExerciseRequest
hCSessionID string? The ID of the current airline session, see Sessions [optional]

Return type

CreateDgContractExerciseResponse

Authorization

PartnerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 The created DG contract exercise * Expires -
* Cache-Control -
* HTS-Session-ID - The ID of the current session, see Sessions
400 Syntactic errors were encountered while handling the request -
401 The client could not be authenticated -
403 The authenticated client does not have permission to call this endpoint -
404 The requested resource could not be found -
422 Semantic errors were encountered while handling the request -
500 The server encountered an internal error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostDgContracts

DgContract PostDgContracts (CreateDgContractRequest createDgContractRequest)

Create a DG Contract

Create a DG contract from selected DG offer(s).

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Hopper.Hts.Airlines.Api;
using Com.Hopper.Hts.Airlines.Client;
using Com.Hopper.Hts.Airlines.Model;

namespace Example
{
    public class PostDgContractsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://airlines-api.hopper.com/airline/v1.1";
            // Configure Bearer token for authorization: PartnerAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new DisruptionGuaranteeDGApi(config);
            var createDgContractRequest = new CreateDgContractRequest(); // CreateDgContractRequest | 

            try
            {
                // Create a DG Contract
                DgContract result = apiInstance.PostDgContracts(createDgContractRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DisruptionGuaranteeDGApi.PostDgContracts: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the PostDgContractsWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Create a DG Contract
    ApiResponse<DgContract> response = apiInstance.PostDgContractsWithHttpInfo(createDgContractRequest);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling DisruptionGuaranteeDGApi.PostDgContractsWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
createDgContractRequest CreateDgContractRequest

Return type

DgContract

Authorization

PartnerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 The created DG contract * Expires -
* Cache-Control -
204 The DG contract creation request was successfully validated but not performed * Expires -
* Cache-Control -
400 Syntactic errors were encountered while handling the request -
401 The client could not be authenticated -
403 The authenticated client does not have permission to call this endpoint -
404 The requested resource could not be found -
422 Semantic errors were encountered while handling the request -
500 The server encountered an internal error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostDgContractsIdPayment

DgPayment PostDgContractsIdPayment (string id, ProcessDgPaymentRequest processDgPaymentRequest)

Process DG payment

When HTS is the Merchant of Record (MoR), the customer's credit card is charged by HTS for the DG fee. HTS is relying on an external payment gateway to process the payments, it allows the partner airline to tokenize the customer's credit card details and then pass the generated token in HTS Ancillaries for Airlines API payment endpoints in order to process the payment and confirm the contract related to the purchased product. Token URL: https://core.spreedly.com/v1/payment_methods.json Example Token Request: curl - -request POST - -url https://core.spreedly.com/v1/payment_methods.json - -header 'content-type: application/json' -u \"login:password\" - -data '{ \"payment_method\": { \"email\": \"[email protected]\", \"credit_card\": { \"number\": \"4111111111111111\", \"month\": \"09\", \"year\": \"2029\", \"first_name\": \"John\", \"last_name\": \"Smith\", \"address1\": \"123 12th St\", \"address2\": \"Building B\", \"city\": \"Quebec City\", \"state\": \"QC\", \"zip\": \"G1R 4S9\", \"country\": \"CA\", \"verification_value\": \"123\" } } }' Example Token Response: { \"transaction\": { \"token\": \"KtToV20m9qT1Yi8pbTeLNz0Ypns\", \"created_at\": \"2023-11-29T13:31:56Z\", \"updated_at\": \"2023-11-29T13:31:56Z\", \"succeeded\": true, \"transaction_type\": \"AddPaymentMethod\", \"retained\": false, \"state\": \"succeeded\", \"message_key\": \"messages.transaction_succeeded\", \"message\": \"Succeeded!\", \"payment_method\": { \"token\": \"MxyYEhDK12CUAA18bJDkAq0ab3y\", \"created_at\": \"2023-11-29T13:31:56Z\", \"updated_at\": \"2023-11-29T13:31:56Z\", \"email\": \"[email protected]\", \"data\": null, \"storage_state\": \"cached\", \"test\": true, \"metadata\": null, \"callback_url\": null, \"last_four_digits\": \"1111\", \"first_six_digits\": \"411111\", \"card_type\": \"visa\", \"first_name\": \"John\", \"last_name\": \"Smith\", \"month\": 9, \"year\": 2029, \"address1\": \"123 12th St\", \"address2\": \"Building B\", \"city\": \"Quebec City\", \"state\": \"QC\", \"zip\": \"G1R 4S9\", \"country\": \"CA\", \"phone_number\": null, \"company\": null, \"full_name\": \"John Smith\", \"eligible_for_card_updater\": true, \"shipping_address1\": null, \"shipping_address2\": null, \"shipping_city\": null, \"shipping_state\": null, \"shipping_zip\": null, \"shipping_country\": null, \"shipping_phone_number\": null, \"issuer_identification_number\": \"41111111\", \"click_to_pay\": false, \"managed\": true, \"payment_method_type\": \"credit_card\", \"errors\": [], \"bin_metadata\": { \"message\": \"BIN Metadata is available only to Advanced Vault enrolled customers and payment methods. Reach out to your account representative for more details.\" }, \"fingerprint\": \"7ccffcf38900f224fc946cf2a9c8e260072b\", \"verification_value\": \"XXX\", \"number\": \"XXXX-XXXX-XXXX-1111\" } } } Here the returned payment method token MxyYEhDK12CUAA18bJDkAq0ab3y has to be used in the Process DG Payment request below.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Hopper.Hts.Airlines.Api;
using Com.Hopper.Hts.Airlines.Client;
using Com.Hopper.Hts.Airlines.Model;

namespace Example
{
    public class PostDgContractsIdPaymentExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://airlines-api.hopper.com/airline/v1.1";
            // Configure API key authorization: SessionAuth
            config.AddApiKey("HC-Session-ID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("HC-Session-ID", "Bearer");
            // Configure Bearer token for authorization: PartnerAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new DisruptionGuaranteeDGApi(config);
            var id = "id_example";  // string | A unique identifier for a contract
            var processDgPaymentRequest = new ProcessDgPaymentRequest(); // ProcessDgPaymentRequest | 

            try
            {
                // Process DG payment
                DgPayment result = apiInstance.PostDgContractsIdPayment(id, processDgPaymentRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DisruptionGuaranteeDGApi.PostDgContractsIdPayment: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the PostDgContractsIdPaymentWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Process DG payment
    ApiResponse<DgPayment> response = apiInstance.PostDgContractsIdPaymentWithHttpInfo(id, processDgPaymentRequest);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling DisruptionGuaranteeDGApi.PostDgContractsIdPaymentWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
id string A unique identifier for a contract
processDgPaymentRequest ProcessDgPaymentRequest

Return type

DgPayment

Authorization

SessionAuth, PartnerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The contract has been paid * Expires -
* Cache-Control -
400 Syntactic errors were encountered while handling the request -
401 The client could not be authenticated -
403 The authenticated client does not have permission to call this endpoint -
404 The requested resource could not be found -
422 Semantic errors were encountered while handling the request -
500 The server encountered an internal error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostDgOffers

List<CreateDgOfferItemResponse> PostDgOffers (CreateDgOffersRequest createDgOffersRequest, string? hCSessionID = null)

Create DG Offers

Create DG offers for a user's trip

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Hopper.Hts.Airlines.Api;
using Com.Hopper.Hts.Airlines.Client;
using Com.Hopper.Hts.Airlines.Model;

namespace Example
{
    public class PostDgOffersExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://airlines-api.hopper.com/airline/v1.1";
            // Configure Bearer token for authorization: PartnerAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new DisruptionGuaranteeDGApi(config);
            var createDgOffersRequest = new CreateDgOffersRequest(); // CreateDgOffersRequest | 
            var hCSessionID = 9fd3f2f9-e5aa-4128-ace9-3c4ee37b685f;  // string? | The ID of the current airline session, see [Sessions](#tag/Sessions) (optional) 

            try
            {
                // Create DG Offers
                List<CreateDgOfferItemResponse> result = apiInstance.PostDgOffers(createDgOffersRequest, hCSessionID);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DisruptionGuaranteeDGApi.PostDgOffers: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the PostDgOffersWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Create DG Offers
    ApiResponse<List<CreateDgOfferItemResponse>> response = apiInstance.PostDgOffersWithHttpInfo(createDgOffersRequest, hCSessionID);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling DisruptionGuaranteeDGApi.PostDgOffersWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
createDgOffersRequest CreateDgOffersRequest
hCSessionID string? The ID of the current airline session, see Sessions [optional]

Return type

List<CreateDgOfferItemResponse>

Authorization

PartnerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 The created DG offers * Expires -
* Cache-Control -
* HTS-Session-ID - The ID of the current session, see Sessions
400 Syntactic errors were encountered while handling the request -
401 The client could not be authenticated -
403 The authenticated client does not have permission to call this endpoint -
404 The requested resource could not be found -
422 Semantic errors were encountered while handling the request -
500 The server encountered an internal error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PutDgContractsIdItinerarySlices

DgContract PutDgContractsIdItinerarySlices (string id, List dgItinerarySlice)

Update DG Contract Itinerary Slices

Update a DG Contract's itinerary slices.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Hopper.Hts.Airlines.Api;
using Com.Hopper.Hts.Airlines.Client;
using Com.Hopper.Hts.Airlines.Model;

namespace Example
{
    public class PutDgContractsIdItinerarySlicesExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://airlines-api.hopper.com/airline/v1.1";
            // Configure API key authorization: SessionAuth
            config.AddApiKey("HC-Session-ID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("HC-Session-ID", "Bearer");
            // Configure Bearer token for authorization: PartnerAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new DisruptionGuaranteeDGApi(config);
            var id = "id_example";  // string | A unique identifier for a contract
            var dgItinerarySlice = new List<DgItinerarySlice>(); // List<DgItinerarySlice> | 

            try
            {
                // Update DG Contract Itinerary Slices
                DgContract result = apiInstance.PutDgContractsIdItinerarySlices(id, dgItinerarySlice);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DisruptionGuaranteeDGApi.PutDgContractsIdItinerarySlices: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the PutDgContractsIdItinerarySlicesWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Update DG Contract Itinerary Slices
    ApiResponse<DgContract> response = apiInstance.PutDgContractsIdItinerarySlicesWithHttpInfo(id, dgItinerarySlice);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling DisruptionGuaranteeDGApi.PutDgContractsIdItinerarySlicesWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
id string A unique identifier for a contract
dgItinerarySlice List<DgItinerarySlice>

Return type

DgContract

Authorization

SessionAuth, PartnerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The updated DG contract * Expires -
* Cache-Control -
400 Syntactic errors were encountered while handling the request -
401 The client could not be authenticated -
403 The authenticated client does not have permission to call this endpoint -
404 The requested resource could not be found -
422 Semantic errors were encountered while handling the request -
500 The server encountered an internal error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PutDgContractsIdUpdateStatus

DgContract PutDgContractsIdUpdateStatus (string id, UpdateDgContractStatusRequest updateDgContractStatusRequest)

Update DG Contract Status

Update DG Contract Status

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Hopper.Hts.Airlines.Api;
using Com.Hopper.Hts.Airlines.Client;
using Com.Hopper.Hts.Airlines.Model;

namespace Example
{
    public class PutDgContractsIdUpdateStatusExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://airlines-api.hopper.com/airline/v1.1";
            // Configure Bearer token for authorization: PartnerAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new DisruptionGuaranteeDGApi(config);
            var id = "id_example";  // string | A unique identifier for a contract
            var updateDgContractStatusRequest = new UpdateDgContractStatusRequest(); // UpdateDgContractStatusRequest | 

            try
            {
                // Update DG Contract Status
                DgContract result = apiInstance.PutDgContractsIdUpdateStatus(id, updateDgContractStatusRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DisruptionGuaranteeDGApi.PutDgContractsIdUpdateStatus: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the PutDgContractsIdUpdateStatusWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Update DG Contract Status
    ApiResponse<DgContract> response = apiInstance.PutDgContractsIdUpdateStatusWithHttpInfo(id, updateDgContractStatusRequest);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling DisruptionGuaranteeDGApi.PutDgContractsIdUpdateStatusWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
id string A unique identifier for a contract
updateDgContractStatusRequest UpdateDgContractStatusRequest

Return type

DgContract

Authorization

PartnerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The Updated DG contract * Expires -
* Cache-Control -
204 The DG contract status update request was successfully validated but not performed * Expires -
* Cache-Control -
400 Syntactic errors were encountered while handling the request -
401 The client could not be authenticated -
403 The authenticated client does not have permission to call this endpoint -
404 The requested resource could not be found -
422 Semantic errors were encountered while handling the request -
500 The server encountered an internal error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]