예제 #1
0
        /// <summary>
        /// Retrieves and updates the shipping settings of multiple accounts in a single request.
        /// Documentation https://developers.google.com/shoppingcontent/v2/reference/shippingsettings/custombatch
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Shoppingcontent service.</param>
        /// <param name="body">A valid Shoppingcontent v2 body.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>ShippingsettingsCustomBatchResponseResponse</returns>
        public static ShippingsettingsCustomBatchResponse Custombatch(ShoppingcontentService service, ShippingsettingsCustomBatchRequest body, ShippingsettingsCustombatchOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }

                // Building the initial request.
                var request = service.Shippingsettings.Custombatch(body);

                // Applying optional parameters to the request.
                request = (ShippingsettingsResource.CustombatchRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Shippingsettings.Custombatch failed.", ex);
            }
        }
        /// <summary>
        /// Retrieves the status of a datafeed from your Merchant Center account. This method can only be called for non-multi-client accounts.
        /// Documentation https://developers.google.com/shoppingcontent/v2/reference/datafeedstatuses/get
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Shoppingcontent service.</param>
        /// <param name="merchantId">NA</param>
        /// <param name="datafeedId">NA</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>DatafeedStatusResponse</returns>
        public static DatafeedStatus Get(ShoppingcontentService service, string merchantId, string datafeedId, DatafeedstatusesGetOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (merchantId == null)
                {
                    throw new ArgumentNullException(merchantId);
                }
                if (datafeedId == null)
                {
                    throw new ArgumentNullException(datafeedId);
                }

                // Building the initial request.
                var request = service.Datafeedstatuses.Get(merchantId, datafeedId);

                // Applying optional parameters to the request.
                request = (DatafeedstatusesResource.GetRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Datafeedstatuses.Get failed.", ex);
            }
        }
예제 #3
0
        /// <summary>
        /// Lists the shipping settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts.
        /// Documentation https://developers.google.com/shoppingcontent/v2/reference/shippingsettings/list
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Shoppingcontent service.</param>
        /// <param name="merchantId">The ID of the managing account.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>ShippingsettingsListResponseResponse</returns>
        public static ShippingsettingsListResponse List(ShoppingcontentService service, string merchantId, ShippingsettingsListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (merchantId == null)
                {
                    throw new ArgumentNullException(merchantId);
                }

                // Building the initial request.
                var request = service.Shippingsettings.List(merchantId);

                // Applying optional parameters to the request.
                request = (ShippingsettingsResource.ListRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Shippingsettings.List failed.", ex);
            }
        }
예제 #4
0
        /// <summary>
        /// Retrieves the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account.
        /// Documentation https://developers.google.com/shoppingcontent/v2/reference/shippingsettings/get
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Shoppingcontent service.</param>
        /// <param name="merchantId">The ID of the managing account.</param>
        /// <param name="accountId">The ID of the account for which to get/update shipping settings.</param>
        /// <returns>ShippingSettingsResponse</returns>
        public static ShippingSettings Get(ShoppingcontentService service, string merchantId, string accountId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (merchantId == null)
                {
                    throw new ArgumentNullException(merchantId);
                }
                if (accountId == null)
                {
                    throw new ArgumentNullException(accountId);
                }

                // Make the request.
                return(service.Shippingsettings.Get(merchantId, accountId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Shippingsettings.Get failed.", ex);
            }
        }
예제 #5
0
        /// <summary>
        /// Claims the website of a Merchant Center sub-account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account.
        /// Documentation https://developers.google.com/shoppingcontent/v2/reference/accounts/claimwebsite
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Shoppingcontent service.</param>
        /// <param name="merchantId">The ID of the managing account.</param>
        /// <param name="accountId">The ID of the account whose website is claimed.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>AccountsClaimWebsiteResponseResponse</returns>
        public static AccountsClaimWebsiteResponse Claimwebsite(ShoppingcontentService service, string merchantId, string accountId, AccountsClaimwebsiteOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (merchantId == null)
                {
                    throw new ArgumentNullException(merchantId);
                }
                if (accountId == null)
                {
                    throw new ArgumentNullException(accountId);
                }

                // Building the initial request.
                var request = service.Accounts.Claimwebsite(merchantId, accountId);

                // Applying optional parameters to the request.
                request = (AccountsResource.ClaimwebsiteRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Accounts.Claimwebsite failed.", ex);
            }
        }
예제 #6
0
        /// <summary>
        /// Uploads a product to your Merchant Center account. If an item with the same channel, contentLanguage, offerId, and targetCountry already exists, this method updates that entry. This method can only be called for non-multi-client accounts.
        /// Documentation https://developers.google.com/shoppingcontent/v2/reference/products/insert
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Shoppingcontent service.</param>
        /// <param name="merchantId">The ID of the managing account.</param>
        /// <param name="body">A valid Shoppingcontent v2 body.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>ProductResponse</returns>
        public static Product Insert(ShoppingcontentService service, string merchantId, Product body, ProductsInsertOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (merchantId == null)
                {
                    throw new ArgumentNullException(merchantId);
                }

                // Building the initial request.
                var request = service.Products.Insert(body, merchantId);

                // Applying optional parameters to the request.
                request = (ProductsResource.InsertRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Products.Insert failed.", ex);
            }
        }
        /// <summary>
        /// Retrieves a datafeed configuration from your Merchant Center account. This method can only be called for non-multi-client accounts.
        /// Documentation https://developers.google.com/shoppingcontent/v2/reference/datafeeds/get
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Shoppingcontent service.</param>
        /// <param name="merchantId">NA</param>
        /// <param name="datafeedId">NA</param>
        /// <returns>DatafeedResponse</returns>
        public static Datafeed Get(ShoppingcontentService service, string merchantId, string datafeedId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (merchantId == null)
                {
                    throw new ArgumentNullException(merchantId);
                }
                if (datafeedId == null)
                {
                    throw new ArgumentNullException(datafeedId);
                }

                // Make the request.
                return(service.Datafeeds.Get(merchantId, datafeedId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Datafeeds.Get failed.", ex);
            }
        }
예제 #8
0
        /// <summary>
        /// Deletes a product from your Merchant Center account. This method can only be called for non-multi-client accounts.
        /// Documentation https://developers.google.com/shoppingcontent/v2/reference/products/delete
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Shoppingcontent service.</param>
        /// <param name="merchantId">The ID of the managing account.</param>
        /// <param name="productId">The ID of the product.</param>
        /// <param name="optional">Optional paramaters.</param>
        public static void Delete(ShoppingcontentService service, string merchantId, string productId, ProductsDeleteOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (merchantId == null)
                {
                    throw new ArgumentNullException(merchantId);
                }
                if (productId == null)
                {
                    throw new ArgumentNullException(productId);
                }

                // Building the initial request.
                var request = service.Products.Delete(merchantId, productId);

                // Applying optional parameters to the request.
                request = (ProductsResource.DeleteRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                request.Execute();
            }
            catch (Exception ex)
            {
                throw new Exception("Request Products.Delete failed.", ex);
            }
        }
예제 #9
0
        /// <summary>
        /// Updates a shipment's status, carrier, and/or tracking ID. This method can only be called for non-multi-client accounts.
        /// Documentation https://developers.google.com/shoppingcontent/v2sandbox/reference/orders/updateshipment
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Shoppingcontent service.</param>
        /// <param name="merchantId">The ID of the managing account.</param>
        /// <param name="orderId">The ID of the order.</param>
        /// <param name="body">A valid Shoppingcontent v2sandbox body.</param>
        /// <returns>OrdersUpdateShipmentResponseResponse</returns>
        public static OrdersUpdateShipmentResponse Updateshipment(ShoppingcontentService service, string merchantId, string orderId, OrdersUpdateShipmentRequest body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (merchantId == null)
                {
                    throw new ArgumentNullException(merchantId);
                }
                if (orderId == null)
                {
                    throw new ArgumentNullException(orderId);
                }

                // Make the request.
                return(service.Orders.Updateshipment(body, merchantId, orderId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Orders.Updateshipment failed.", ex);
            }
        }
예제 #10
0
        /// <summary>
        /// Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox. This method can only be called for non-multi-client accounts.
        /// Documentation https://developers.google.com/shoppingcontent/v2sandbox/reference/orders/gettestordertemplate
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Shoppingcontent service.</param>
        /// <param name="merchantId">The ID of the managing account.</param>
        /// <param name="templateName">The name of the template to retrieve.</param>
        /// <returns>OrdersGetTestOrderTemplateResponseResponse</returns>
        public static OrdersGetTestOrderTemplateResponse Gettestordertemplate(ShoppingcontentService service, string merchantId, string templateName)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (merchantId == null)
                {
                    throw new ArgumentNullException(merchantId);
                }
                if (templateName == null)
                {
                    throw new ArgumentNullException(templateName);
                }

                // Make the request.
                return(service.Orders.Gettestordertemplate(merchantId, templateName).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Orders.Gettestordertemplate failed.", ex);
            }
        }
예제 #11
0
        /// <summary>
        /// Retrieves an order using merchant order id. This method can only be called for non-multi-client accounts.
        /// Documentation https://developers.google.com/shoppingcontent/v2sandbox/reference/orders/getbymerchantorderid
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Shoppingcontent service.</param>
        /// <param name="merchantId">The ID of the managing account.</param>
        /// <param name="merchantOrderId">The merchant order id to be looked for.</param>
        /// <returns>OrdersGetByMerchantOrderIdResponseResponse</returns>
        public static OrdersGetByMerchantOrderIdResponse Getbymerchantorderid(ShoppingcontentService service, string merchantId, string merchantOrderId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (merchantId == null)
                {
                    throw new ArgumentNullException(merchantId);
                }
                if (merchantOrderId == null)
                {
                    throw new ArgumentNullException(merchantOrderId);
                }

                // Make the request.
                return(service.Orders.Getbymerchantorderid(merchantId, merchantOrderId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Orders.Getbymerchantorderid failed.", ex);
            }
        }
예제 #12
0
        /// <summary>
        /// Sandbox only. Moves a test order from state "inProgress" to state "pendingShipment". This method can only be called for non-multi-client accounts.
        /// Documentation https://developers.google.com/shoppingcontent/v2sandbox/reference/orders/advancetestorder
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Shoppingcontent service.</param>
        /// <param name="merchantId">The ID of the managing account.</param>
        /// <param name="orderId">The ID of the test order to modify.</param>
        /// <returns>OrdersAdvanceTestOrderResponseResponse</returns>
        public static OrdersAdvanceTestOrderResponse Advancetestorder(ShoppingcontentService service, string merchantId, string orderId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (merchantId == null)
                {
                    throw new ArgumentNullException(merchantId);
                }
                if (orderId == null)
                {
                    throw new ArgumentNullException(orderId);
                }

                // Make the request.
                return(service.Orders.Advancetestorder(merchantId, orderId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Orders.Advancetestorder failed.", ex);
            }
        }
예제 #13
0
        /// <summary>
        /// Returns information about the authenticated user.
        /// Documentation https://developers.google.com/shoppingcontent/v2/reference/accounts/authinfo
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Shoppingcontent service.</param>
        /// <returns>AccountsAuthInfoResponseResponse</returns>
        public static AccountsAuthInfoResponse Authinfo(ShoppingcontentService service)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }

                // Make the request.
                return(service.Accounts.Authinfo().Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Accounts.Authinfo failed.", ex);
            }
        }
예제 #14
0
        /// <summary>
        /// Updates price and availability of a product in your Merchant Center account. This operation does not update the expiration date of the product. This method can only be called for non-multi-client accounts.
        /// Documentation https://developers.google.com/shoppingcontent/v2/reference/inventory/set
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Shoppingcontent service.</param>
        /// <param name="merchantId">The ID of the managing account.</param>
        /// <param name="storeCode">The code of the store for which to update price and availability. Use online to update price and availability of an online product.</param>
        /// <param name="productId">The ID of the product for which to update price and availability.</param>
        /// <param name="body">A valid Shoppingcontent v2 body.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>InventorySetResponseResponse</returns>
        public static InventorySetResponse Set(ShoppingcontentService service, string merchantId, string storeCode, string productId, InventorySetRequest body, InventorySetOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (merchantId == null)
                {
                    throw new ArgumentNullException(merchantId);
                }
                if (storeCode == null)
                {
                    throw new ArgumentNullException(storeCode);
                }
                if (productId == null)
                {
                    throw new ArgumentNullException(productId);
                }

                // Building the initial request.
                var request = service.Inventory.Set(body, merchantId, storeCode, productId);

                // Applying optional parameters to the request.
                request = (InventoryResource.SetRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Inventory.Set failed.", ex);
            }
        }
        /// <summary>
        /// NA
        /// Documentation https://developers.google.com/shoppingcontent/v2/reference/datafeedstatuses/custombatch
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Shoppingcontent service.</param>
        /// <param name="body">A valid Shoppingcontent v2 body.</param>
        /// <returns>DatafeedstatusesCustomBatchResponseResponse</returns>
        public static DatafeedstatusesCustomBatchResponse Custombatch(ShoppingcontentService service, DatafeedstatusesCustomBatchRequest body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }

                // Make the request.
                return(service.Datafeedstatuses.Custombatch(body).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Datafeedstatuses.Custombatch failed.", ex);
            }
        }
예제 #16
0
        /// <summary>
        /// Retrieves supported carriers and carrier services for an account.
        /// Documentation https://developers.google.com/shoppingcontent/v2/reference/shippingsettings/getsupportedcarriers
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Shoppingcontent service.</param>
        /// <param name="merchantId">The ID of the account for which to retrieve the supported carriers.</param>
        /// <returns>ShippingsettingsGetSupportedCarriersResponseResponse</returns>
        public static ShippingsettingsGetSupportedCarriersResponse Getsupportedcarriers(ShoppingcontentService service, string merchantId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (merchantId == null)
                {
                    throw new ArgumentNullException(merchantId);
                }

                // Make the request.
                return(service.Shippingsettings.Getsupportedcarriers(merchantId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Shippingsettings.Getsupportedcarriers failed.", ex);
            }
        }