Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OddityCore"/> class.
        /// </summary>
        public OddityCore()
        {
            _httpClient             = new HttpClient();
            _httpClient.BaseAddress = new Uri(ApiConfiguration.ApiEndpoint);
            _httpClient.DefaultRequestHeaders.UserAgent.ParseAdd($"{ApiConfiguration.LibraryName}/{GetLibraryVersion()} ({ApiConfiguration.GitHubLink})");

            SetTimeout(ApiConfiguration.DefaultTimeoutSeconds);

            var builderDelegatesContainer = new BuilderDelegatesContainer
            {
                DeserializationError = DeserializationError,
                RequestSend          = RequestSend,
                ResponseReceived     = ResponseReceived
            };

            Api              = new Api(_httpClient, builderDelegatesContainer);
            Company          = new Company(_httpClient, builderDelegatesContainer);
            Rockets          = new Rockets(_httpClient, builderDelegatesContainer);
            Capsules         = new Capsules(_httpClient, builderDelegatesContainer);
            DetailedCapsules = new DetailedCapsules(_httpClient, builderDelegatesContainer);
            DetailedCores    = new DetailedCores(_httpClient, builderDelegatesContainer);
            Launchpads       = new Launchpads(_httpClient, builderDelegatesContainer);
            Launches         = new Launches(_httpClient, builderDelegatesContainer);
            Roadster         = new Roadster(_httpClient, builderDelegatesContainer);
        }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UpcomingLaunchesBuilder"/> class.
 /// </summary>
 /// <param name="httpClient">The HTTP client.</param>
 /// <param name="builderDelegatesContainer">The builder delegates container.</param>
 public UpcomingLaunchesBuilder(HttpClient httpClient, BuilderDelegatesContainer builderDelegatesContainer) : base(httpClient, builderDelegatesContainer)
 {
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RoadsterBuilder"/> class.
 /// </summary>
 /// <param name="httpClient">The HTTP client.</param>
 /// <param name="builderDelegatesContainer">The builder delegates container.</param>
 public RoadsterBuilder(HttpClient httpClient, BuilderDelegatesContainer builderDelegatesContainer) : base(httpClient, builderDelegatesContainer)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AllRocketsBuilder"/> class.
 /// </summary>
 /// <param name="httpClient">The HTTP client.</param>
 /// <param name="builderDelegatesContainer">The builder delegates container.</param>
 public AllRocketsBuilder(HttpClient httpClient, BuilderDelegatesContainer builderDelegatesContainer) : base(httpClient, builderDelegatesContainer)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DetailedCapsules"/> class.
 /// </summary>
 /// <param name="httpClient">The HTTP client.</param>
 /// <param name="builderDelegatesContainer">The builder delegates container.</param>
 public DetailedCapsules(HttpClient httpClient, BuilderDelegatesContainer builderDelegatesContainer)
 {
     _httpClient = httpClient;
     _builderDelegatesContainer = builderDelegatesContainer;
 }
Exemple #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Roadster"/> class.
 /// </summary>
 /// <param name="httpClient">The HTTP client.</param>
 /// <param name="builderDelegatesContainer">The builder delegates container.</param>
 public Roadster(HttpClient httpClient, BuilderDelegatesContainer builderDelegatesContainer)
 {
     _httpClient = httpClient;
     _builderDelegatesContainer = builderDelegatesContainer;
 }
Exemple #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Company"/> class.
 /// </summary>
 /// <param name="httpClient">The HTTP client.</param>
 /// <param name="builderDelegatesContainer">The builder delegates container.</param>
 public Company(HttpClient httpClient, BuilderDelegatesContainer builderDelegatesContainer)
 {
     _httpClient = httpClient;
     _builderDelegatesContainer = builderDelegatesContainer;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AllDetailedCoresBuilder"/> class.
 /// </summary>
 /// <param name="httpClient">The HTTP client.</param>
 /// <param name="builderDelegatesContainer">The builder delegates container.</param>
 public AllDetailedCoresBuilder(HttpClient httpClient, BuilderDelegatesContainer builderDelegatesContainer) : base(httpClient, builderDelegatesContainer)
 {
 }
Exemple #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DetailedCapsuleBuilder"/> class.
 /// </summary>
 /// <param name="httpClient">The HTTP client.</param>
 /// <param name="builderDelegatesContainer">The builder delegates container.</param>
 public DetailedCapsuleBuilder(HttpClient httpClient, BuilderDelegatesContainer builderDelegatesContainer) : base(httpClient, builderDelegatesContainer)
 {
 }
Exemple #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AllCapsulesBuilder"/> class.
 /// </summary>
 /// <param name="httpClient">The HTTP client.</param>
 /// <param name="builderDelegatesContainer">The builder delegates container.</param>
 public AllCapsulesBuilder(HttpClient httpClient, BuilderDelegatesContainer builderDelegatesContainer) : base(httpClient, builderDelegatesContainer)
 {
 }
Exemple #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InfoBuilder"/> class.
 /// </summary>
 /// <param name="httpClient">The HTTP client.</param>
 /// <param name="builderDelegatesContainer">The builder delegates container.</param>
 public InfoBuilder(HttpClient httpClient, BuilderDelegatesContainer builderDelegatesContainer) : base(httpClient, builderDelegatesContainer)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AllLaunchpadsBuilder"/> class.
 /// </summary>
 /// <param name="httpClient">The HTTP client.</param>
 /// <param name="builderDelegatesContainer">The builder delegates container.</param>
 public AllLaunchpadsBuilder(HttpClient httpClient, BuilderDelegatesContainer builderDelegatesContainer) : base(httpClient, builderDelegatesContainer)
 {
 }
Exemple #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Launches"/> class.
 /// </summary>
 /// <param name="httpClient">The HTTP client.</param>
 /// <param name="builderDelegatesContainer">The builder delegates container.</param>
 public Launches(HttpClient httpClient, BuilderDelegatesContainer builderDelegatesContainer)
 {
     _httpClient = httpClient;
     _builderDelegatesContainer = builderDelegatesContainer;
 }
Exemple #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LaunchBuilderBase{TBuilder,TReturn}"/> class.
 /// </summary>
 /// <param name="httpClient">The HTTP client.</param>
 /// <param name="builderDelegatesContainer">The builder delegates container.</param>
 protected LaunchBuilderBase(HttpClient httpClient, BuilderDelegatesContainer builderDelegatesContainer) : base(httpClient, builderDelegatesContainer)
 {
 }