public DigitalOceanClient(string token) { var client = new RestClient(DigitalOceanApiUrl) { UserAgent = "digitalocean-api-dotnet" }; client.AddDefaultHeader("Authorization", $"Bearer {token}"); _connection = new Connection(client); Actions = new ActionsClient(_connection); DomainRecords = new DomainRecordsClient(_connection); Domains = new DomainsClient(_connection); DropletActions = new DropletActionsClient(_connection); Droplets = new DropletsClient(_connection); FloatingIps = new FloatingIpsClient(_connection); FloatingIpActions = new FloatingIpActionsClient(_connection); ImageActions = new ImageActionsClient(_connection); Images = new ImagesClient(_connection); Keys = new KeysClient(_connection); Regions = new RegionsClient(_connection); Sizes = new SizesClient(_connection); Snapshots = new SnapshotsClient(_connection); Tags = new TagsClient(_connection); Volumes = new VolumesClient(_connection); }
public void CorrectRequestForGetAll() { var factory = Substitute.For <IConnection>(); var client = new SizesClient(factory); client.GetAll(); factory.Received().GetPaginated <Size>("sizes", null, "sizes"); }
public ShopyDriver( ProductsClient productsClient, CategoriesClient categoriesClient, SizesClient sizesClient, BrandsClient brandsClient) { _productsClient = productsClient; _categoriesClient = categoriesClient; _sizesClient = sizesClient; _brandsClient = brandsClient; }
public static IShopyDriver GetDriver() { // TODO: DI this var httpClient = new ShopyHttpClient(SettingsHelper.ApiBaseAddress); var products = new ProductsClient(httpClient); var categories = new CategoriesClient(httpClient); var brands = new BrandsClient(httpClient); var sizes = new SizesClient(httpClient); return(new ShopyDriver(products, categories, sizes, brands)); }
public DigitalOceanClient(string token) { var client = new RestClient(DigitalOceanApiUrl) { UserAgent = "digitalocean-api-dotnet" }; client.AddDefaultHeader("Authorization", string.Format("Bearer {0}", token)); _connection = new Connection(client); Account = new AccountClient(_connection); Actions = new ActionsClient(_connection); CdnEndpoints = new CdnEndpointsClient(_connection); Certificates = new CertificatesClient(_connection); ContainerRegistry = new ContainerRegistryClient(_connection); Databases = new DatabasesClient(_connection); DomainRecords = new DomainRecordsClient(_connection); Domains = new DomainsClient(_connection); DropletActions = new DropletActionsClient(_connection); Droplets = new DropletsClient(_connection); Firewalls = new FirewallsClient(_connection); FloatingIpActions = new FloatingIpActionsClient(_connection); FloatingIps = new FloatingIpsClient(_connection); ImageActions = new ImageActionsClient(_connection); Images = new ImagesClient(_connection); LoadBalancers = new LoadBalancerClient(_connection); Projects = new ProjectsClient(_connection); ProjectResources = new ProjectResourcesClient(_connection); Keys = new KeysClient(_connection); Kubernetes = new KubernetesClient(_connection); Regions = new RegionsClient(_connection); Sizes = new SizesClient(_connection); Snapshots = new SnapshotsClient(_connection); Tags = new TagsClient(_connection); Volumes = new VolumesClient(_connection); VolumeActions = new VolumeActionsClient(_connection); BalanceClient = new BalanceClient(_connection); Vpc = new VpcClient(_connection); }
public DigitalOceanClient(string token) { var client = new RestClient(DigitalOceanApiUrl) { UserAgent = "digitalocean-api-dotnet" }; client.AddDefaultHeader("Authorization", string.Format("Bearer {0}", token)); _connection = new Connection(client); Actions = new ActionsClient(_connection); DomainRecords = new DomainRecordsClient(_connection); Domains = new DomainsClient(_connection); DropletActions = new DropletActionsClient(_connection); Droplets = new DropletsClient(_connection); ImageActions = new ImageActionsClient(_connection); Images = new ImagesClient(_connection); Keys = new KeysClient(_connection); Regions = new RegionsClient(_connection); Sizes = new SizesClient(_connection); }