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: 0.1.4
- Generator version: 7.10.0-SNAPSHOT
- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
- RestSharp - 112.0.0 or later
- Json.NET - 13.0.2 or later
- JsonSubTypes - 1.8.0 or later
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
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.
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;
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.
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;
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);
}
}
}
}
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 |
- Model.AirlineRefundMethod
- Model.AirlineSession
- Model.Ancillary
- Model.AncillaryType
- Model.Android
- Model.App
- Model.AuthRequest
- Model.AuthResponse
- Model.BadRequest
- Model.BookingConfirmed
- Model.BookingConfirmed1
- Model.BookingConfirmed2
- Model.Browser
- Model.Cabin
- Model.Cash
- Model.CfarContents
- Model.CfarContract
- Model.CfarContractExercise
- Model.CfarCreateExerciseItinerary
- Model.CfarCreateExerciseItinerarySlice
- Model.CfarCreateExercisePassengerPricing
- Model.CfarCreateExerciseSliceSegment
- Model.CfarDenyPurchase
- Model.CfarEvent
- Model.CfarEventWithContract
- Model.CfarExerciseCallbackLaunched
- Model.CfarExerciseCustomerDataComplete
- Model.CfarExercisePortalComplete
- Model.CfarExercisePortalDisplay
- Model.CfarExerciseVerificationComplete
- Model.CfarExerciseVerificationSent
- Model.CfarForcedChoiceWarning
- Model.CfarItinerary
- Model.CfarItinerarySlice
- Model.CfarItinerarySliceSegment
- Model.CfarOffer
- Model.CfarOfferItinerary
- Model.CfarOfferPassenger
- Model.CfarOffersBannerDisplay
- Model.CfarOffersTakeoverDisplay
- Model.CfarPassenger
- Model.CfarPassengerTax
- Model.CfarPayment
- Model.CfarStatus
- Model.CfarTax
- Model.CfarViewInfo
- Model.Chrome
- Model.ChromeOs
- Model.CreateAirlineCfarSessionRequest
- Model.CreateAirlineDgSessionRequest
- Model.CreateAirlineSessionRequest
- Model.CreateCfarContractExerciseRequest
- Model.CreateCfarContractRequest
- Model.CreateCfarOfferRequest
- Model.CreateDgContractExerciseRequest
- Model.CreateDgContractExerciseResponse
- Model.CreateDgContractRequest
- Model.CreateDgOfferItemResponse
- Model.CreateDgOffersRequest
- Model.Desktop
- Model.Device
- Model.DgAncillary
- Model.DgAncillaryType
- Model.DgContents
- Model.DgContract
- Model.DgEvent
- Model.DgExerciseCallbackLaunched
- Model.DgExerciseCustomerDataComplete
- Model.DgExerciseItinerary
- Model.DgExerciseItinerarySlice
- Model.DgExerciseItinerarySliceSegment
- Model.DgExercisePortalComplete
- Model.DgExerciseVerificationComplete
- Model.DgItinerary
- Model.DgItinerarySlice
- Model.DgItinerarySliceSegment
- Model.DgOffer
- Model.DgPassenger
- Model.DgPassengerCount
- Model.DgPassengerPricing
- Model.DgPassengerTax
- Model.DgPassengerType
- Model.DgPayment
- Model.DgRequestType
- Model.DgStatus
- Model.DgTax
- Model.Edge
- Model.Error
- Model.Event
- Model.ExerciseStepResult
- Model.Fare
- Model.FareClass
- Model.FareRule
- Model.Firefox
- Model.FlightStatus
- Model.FlowType
- Model.FormOfPayment
- Model.Gender
- Model.IOs
- Model.InternetExplorer
- Model.Linux
- Model.MacOs
- Model.MarkCfarContractExerciseCompleteRequest
- Model.Mobile
- Model.ModelOperatingSystem
- Model.ModificationTime
- Model.ModificationType
- Model.NonCash
- Model.OffersDisplayed
- Model.OffersDisplayed1
- Model.Opera
- Model.OtherBrowser
- Model.OtherOs
- Model.PassengerCount
- Model.PassengerPricing
- Model.PassengerType
- Model.PaymentCard
- Model.Platform
- Model.Points
- Model.ProcessCfarPaymentRequest
- Model.ProcessDgPaymentRequest
- Model.Product
- Model.RequestType
- Model.Safari
- Model.Tablet
- Model.TokenType
- Model.UiSource
- Model.UiVariant
- Model.UnprocessableEntity
- Model.UpdateCfarContractRequest
- Model.UpdateCfarFormOfPaymentRequest
- Model.UpdateDgContractStatusRequest
- Model.UserInfo
- Model.Web
- Model.Windows
Authentication schemes defined for the API:
- Type: Bearer Authentication
- Type: API key
- API key parameter name: HC-Session-ID
- Location: HTTP header
You can regenerate the client using this command:
VERSION=0.1.2 docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate \
-i https://airlines-api.hopper.com/airline/v1.1/docs/docs.yaml \
-g csharp \
-o /local \
--package-name Com.Hopper.Hts.Airlines \
--additional-properties=optionalEmitDefaultValues=true,nullableReferenceTypes=true,validatable=false,licenseId=MIT,packageVersion=$VERSION
Please be mindful of the README.md getting overwritten. Please manually restore these instructions before committing.
Create the package
dotnet pack src/Com.Hopper.Hts.Airlines
Example run:
➜ htsfa-airlines-dotnet git:(main) dotnet pack src/Com.Hopper.Hts.Airlines
Determining projects to restore...
Restored /Users/llaw/Documents/Github/htsfa-airlines-dotnet/src/Com.Hopper.Hts.Airlines/Com.Hopper.Hts.Airlines.csproj (in 506 ms).
/Users/llaw/Documents/Github/htsfa-airlines-dotnet/src/Com.Hopper.Hts.Airlines/Client/ApiClient.cs(457,17): warning CS0618: 'RestClientOptions.MaxTimeout' is obsolete: 'Use Timeout instead.' [/Users/llaw/Documents/Github/htsfa-airlines-dotnet/src/Com.Hopper.Hts.Airlines/Com.Hopper.Hts.Airlines.csproj]
Com.Hopper.Hts.Airlines -> /Users/llaw/Documents/Github/htsfa-airlines-dotnet/src/Com.Hopper.Hts.Airlines/bin/Release/net8.0/Com.Hopper.Hts.Airlines.dll
The package Com.Hopper.Hts.Airlines.0.1.2 is missing a readme. Go to https://aka.ms/nuget/authoring-best-practices/readme to learn why package readmes are important.
Successfully created package '/Users/llaw/Documents/Github/htsfa-airlines-dotnet/src/Com.Hopper.Hts.Airlines/bin/Release/Com.Hopper.Hts.Airlines.0.1.2.nupkg'.
Go to NuGet and upload the package artifact created.
In the example above, it is Com.Hopper.Hts.Airlines.0.1.2.nupkg
.
After submission, the package will be ready for consumption usually within 10-15 minutes.
You will need to obtain an Azure account to access NuGet. Contact IT to do so.