public async Task <JToken> Post() { using var response = await Requester.SendAsync(Endpoint, HttpVerb.POST, Model); var content = await Deserialize(response); Product = ProductEndpoint.CreateFromResponse(content, Requester); return(content); }
//in order to support V1 and V2 endpoints, needs both internal and external platform ids public IntegrationsWebAppClient(string url, string platformExternalId, string platformInternalId, bool useHttps = false) { Requester requester = new Requester($"{url}"); //v1 endpoint Addresses = new AddressesEndpoint(requester, $"/api/v1/{platformInternalId}/addresses", useHttps); PublishMerchandise = new PublishMerchandiseEndpoint(requester, $"/api/v1/{platformInternalId}/publishmerchandise", useHttps); PublishContent = new PublishContentEndpoint(requester, $"/api/v1/{platformInternalId}/publishcontent", useHttps); Brands = new BrandsEndpoint(requester, $"/api/v1/{platformInternalId}/brands", useHttps); Catalogs = new CatalogsEndpoint(requester, $"/api/v1/{platformInternalId}/catalogs", useHttps); //V2 endpoint Products = new ProductEndpoint(requester, $"/api/v2/platforms/{platformExternalId}/products", useHttps); Categories = new CategoriesEndpoint(requester, $"/api/v2/platforms/{platformExternalId}/categories", useHttps); AccountMasters = new AccountMastersEndpoint(requester, $"/api/v2/platforms/{platformExternalId}/accountmasters", useHttps); PriceLists = new PriceListsEndpoint(requester, $"/api/v2/platforms/{platformExternalId}/pricelists", useHttps); Offerings = new OfferingsEndpoint(requester, $"/api/v2/platforms/{platformExternalId}/offerings", useHttps); Logins = new LoginsEndpoint(requester, $"/api/v2/platforms/{platformExternalId}/logins", useHttps); Users = new UsersEndpoint(requester, $"/api/v2/platforms/{platformExternalId}/users", useHttps); Contacts = new ContactsEndpoint(requester, $"/api/v2/platforms/{platformExternalId}/contacts", useHttps); }
private static async Task <bool> ProgressLoop(Options options, ProductEndpoint endpoint) { var locale = options.Locale.ToString(); var cursorLeft = Console.CursorLeft; var cursorTop = Console.CursorTop;
public ProductIntegrationTest(APIClientFixture fixture) { endpoint = fixture.SendOwlAPIClient.Product; CreatedProductIds = fixture.CreatedProductIds; ExistingProductIds = fixture.ExistingProductIds; }