Skip to content

hopper/hts-airlines-dotnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Com.Hopper.Hts.Airlines - the C# library for the Airline API

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

This C# SDK is automatically generated by the OpenAPI Generator project:

  • API version: v1.1
  • SDK version: 1.0.0
  • Generator version: 7.10.0-SNAPSHOT
  • Build package: org.openapitools.codegen.languages.CSharpClientCodegen

Frameworks supported

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742. NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See RestSharp#1406.

Installation

Run the following command to generate the DLL

  • [Mac/Linux] /bin/sh build.sh
  • [Windows] build.bat

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using Com.Hopper.Hts.Airlines.Api;
using Com.Hopper.Hts.Airlines.Client;
using Com.Hopper.Hts.Airlines.Model;

Packaging

A .nuspec is included with the project. You can follow the Nuget quickstart to create and publish packages.

This .nuspec uses placeholders from the .csproj, so build the .csproj directly:

nuget pack -Build -OutputDirectory out Com.Hopper.Hts.Airlines.csproj

Then, publish to a local feed or other host and consume the new package via Nuget as usual.

Usage

To use the API client with a HTTP proxy, setup a System.Net.WebProxy

Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;

Getting Started

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 Example
    {
        public static void Main()
        {

            Configuration config = new Configuration();
            config.BasePath = "https://airlines-api.hopper.com/airline/v1.1";
            // Configure API key authorization: SessionAuth
            config.ApiKey.Add("HC-Session-ID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.ApiKeyPrefix.Add("HC-Session-ID", "Bearer");

            var apiInstance = new AnalyticsApi(config);
            var cfarEvent = new CfarEvent(); // CfarEvent | 

            try
            {
                // Send a Frontend Event
                apiInstance.PostCustomerEvents(cfarEvent);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling AnalyticsApi.PostCustomerEvents: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}

Documentation for API Endpoints

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

Class Method HTTP request Description
AnalyticsApi PostCustomerEvents POST /customer/events Send a Frontend Event
AnalyticsApi PostEvents POST /events Send a Backend Event
AuthenticationApi PostAuth POST /auth Create an authentication token
CancelForAnyReasonCFARApi GetCfarContractsId GET /cfar_contracts/{id} Get a CFAR Contract
CancelForAnyReasonCFARApi PostCfarContractExercises POST /cfar_contract_exercises Create CFAR Exercise
CancelForAnyReasonCFARApi PostCfarContracts POST /cfar_contracts Create a CFAR Contract
CancelForAnyReasonCFARApi PostCfarContractsIdPayment POST /cfar_contracts/{id}/payment Process CFAR Payment
CancelForAnyReasonCFARApi PostCfarOffers POST /cfar_offers Create CFAR Offers
CancelForAnyReasonCFARApi PutCfarContractExercisesIdMarkCompleted PUT /cfar_contract_exercises/{id}/mark_completed Complete CFAR Exercise
CancelForAnyReasonCFARApi PutCfarContractsIdFormsOfPayment PUT /cfar_contracts/{id}/forms_of_payment Update forms of payment of a CFAR Contract
CancelForAnyReasonCFARApi PutCfarContractsIdUpdateStatus PUT /cfar_contracts/{id}/update_status Update CFAR Contract Status
DisruptionGuaranteeDGApi GetDgContractsId GET /dg_contracts/{id} Get a DG contract
DisruptionGuaranteeDGApi PostCustomerDgEvents POST /customer/dg/events Create an Event
DisruptionGuaranteeDGApi PostDgContractExercises POST /dg_contract_exercises Create DG Exercise
DisruptionGuaranteeDGApi PostDgContracts POST /dg_contracts Create a DG Contract
DisruptionGuaranteeDGApi PostDgContractsIdPayment POST /dg_contracts/{id}/payment Process DG payment
DisruptionGuaranteeDGApi PostDgOffers POST /dg_offers Create DG Offers
DisruptionGuaranteeDGApi PutDgContractsIdItinerarySlices PUT /dg_contracts/{id}/itinerary_slices Update DG Contract Itinerary Slices
DisruptionGuaranteeDGApi PutDgContractsIdUpdateStatus PUT /dg_contracts/{id}/update_status Update DG Contract Status
SessionsApi PostSessions POST /sessions Create a Session

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

PartnerAuth

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes:
    • all:general: Access all Session and Analytics APIs
    • all:cfar: Access all CFAR APIs
    • all:dg: Access all DG APIs

SessionAuth

  • Type: API key
  • API key parameter name: HC-Session-ID
  • Location: HTTP header

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •