diff --git a/.github/pull.yml b/.github/pull.yml new file mode 100644 index 000000000000..cba38338ca1b --- /dev/null +++ b/.github/pull.yml @@ -0,0 +1,7 @@ +# https://github.com/wei/pull#advanced-setup-with-config +version: "1" +rules: + - base: master + upstream: Azure:master + mergeMethod: rebase +label: "AutoPull" diff --git a/billing/resource-manager/v2019_10_01_preview/pom.xml b/billing/resource-manager/v2019_10_01_preview/pom.xml new file mode 100644 index 000000000000..1b5bcb448df0 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.billing.v2019_10_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-billing + 1.0.0-beta + jar + Microsoft Azure SDK for Billing Management + This package contains Microsoft Billing Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AcceptTransferRequest.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AcceptTransferRequest.java new file mode 100644 index 000000000000..f6c6e1f949c6 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AcceptTransferRequest.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Request parameters to accept transfer. + */ +@JsonFlatten +public class AcceptTransferRequest { + /** + * Request parameters to accept transfer. + */ + @JsonProperty(value = "properties.productDetails") + private List productDetails; + + /** + * Get request parameters to accept transfer. + * + * @return the productDetails value + */ + public List productDetails() { + return this.productDetails; + } + + /** + * Set request parameters to accept transfer. + * + * @param productDetails the productDetails value to set + * @return the AcceptTransferRequest object itself. + */ + public AcceptTransferRequest withProductDetails(List productDetails) { + this.productDetails = productDetails; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Address.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Address.java new file mode 100644 index 000000000000..20ea3718229f --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Address.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.AddressInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Address. + */ +public interface Address extends HasInner { + /** + * Validates the address. + * + * @param address the AddressDetails value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable validateAsync(AddressDetails address); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AddressDetails.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AddressDetails.java new file mode 100644 index 000000000000..1f8a16b2d2bc --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AddressDetails.java @@ -0,0 +1,277 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Address details. + */ +public class AddressDetails { + /** + * First Name. + */ + @JsonProperty(value = "firstName") + private String firstName; + + /** + * Last Name. + */ + @JsonProperty(value = "lastName") + private String lastName; + + /** + * Company Name. + */ + @JsonProperty(value = "companyName") + private String companyName; + + /** + * Address Line1. + */ + @JsonProperty(value = "addressLine1") + private String addressLine1; + + /** + * Address Line2. + */ + @JsonProperty(value = "addressLine2") + private String addressLine2; + + /** + * Address Line3. + */ + @JsonProperty(value = "addressLine3") + private String addressLine3; + + /** + * Address City. + */ + @JsonProperty(value = "city") + private String city; + + /** + * Address Region. + */ + @JsonProperty(value = "region") + private String region; + + /** + * Country code uses ISO2, 2-digit format. + */ + @JsonProperty(value = "country") + private String country; + + /** + * Address Postal Code. + */ + @JsonProperty(value = "postalCode") + private String postalCode; + + /** + * Get first Name. + * + * @return the firstName value + */ + public String firstName() { + return this.firstName; + } + + /** + * Set first Name. + * + * @param firstName the firstName value to set + * @return the AddressDetails object itself. + */ + public AddressDetails withFirstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get last Name. + * + * @return the lastName value + */ + public String lastName() { + return this.lastName; + } + + /** + * Set last Name. + * + * @param lastName the lastName value to set + * @return the AddressDetails object itself. + */ + public AddressDetails withLastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get company Name. + * + * @return the companyName value + */ + public String companyName() { + return this.companyName; + } + + /** + * Set company Name. + * + * @param companyName the companyName value to set + * @return the AddressDetails object itself. + */ + public AddressDetails withCompanyName(String companyName) { + this.companyName = companyName; + return this; + } + + /** + * Get address Line1. + * + * @return the addressLine1 value + */ + public String addressLine1() { + return this.addressLine1; + } + + /** + * Set address Line1. + * + * @param addressLine1 the addressLine1 value to set + * @return the AddressDetails object itself. + */ + public AddressDetails withAddressLine1(String addressLine1) { + this.addressLine1 = addressLine1; + return this; + } + + /** + * Get address Line2. + * + * @return the addressLine2 value + */ + public String addressLine2() { + return this.addressLine2; + } + + /** + * Set address Line2. + * + * @param addressLine2 the addressLine2 value to set + * @return the AddressDetails object itself. + */ + public AddressDetails withAddressLine2(String addressLine2) { + this.addressLine2 = addressLine2; + return this; + } + + /** + * Get address Line3. + * + * @return the addressLine3 value + */ + public String addressLine3() { + return this.addressLine3; + } + + /** + * Set address Line3. + * + * @param addressLine3 the addressLine3 value to set + * @return the AddressDetails object itself. + */ + public AddressDetails withAddressLine3(String addressLine3) { + this.addressLine3 = addressLine3; + return this; + } + + /** + * Get address City. + * + * @return the city value + */ + public String city() { + return this.city; + } + + /** + * Set address City. + * + * @param city the city value to set + * @return the AddressDetails object itself. + */ + public AddressDetails withCity(String city) { + this.city = city; + return this; + } + + /** + * Get address Region. + * + * @return the region value + */ + public String region() { + return this.region; + } + + /** + * Set address Region. + * + * @param region the region value to set + * @return the AddressDetails object itself. + */ + public AddressDetails withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get country code uses ISO2, 2-digit format. + * + * @return the country value + */ + public String country() { + return this.country; + } + + /** + * Set country code uses ISO2, 2-digit format. + * + * @param country the country value to set + * @return the AddressDetails object itself. + */ + public AddressDetails withCountry(String country) { + this.country = country; + return this; + } + + /** + * Get address Postal Code. + * + * @return the postalCode value + */ + public String postalCode() { + return this.postalCode; + } + + /** + * Set address Postal Code. + * + * @param postalCode the postalCode value to set + * @return the AddressDetails object itself. + */ + public AddressDetails withPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AddressValidationStatus.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AddressValidationStatus.java new file mode 100644 index 000000000000..4d9ea95a8614 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AddressValidationStatus.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AddressValidationStatus. + */ +public final class AddressValidationStatus extends ExpandableStringEnum { + /** Static value Valid for AddressValidationStatus. */ + public static final AddressValidationStatus VALID = fromString("Valid"); + + /** Static value Invalid for AddressValidationStatus. */ + public static final AddressValidationStatus INVALID = fromString("Invalid"); + + /** + * Creates or finds a AddressValidationStatus from its string representation. + * @param name a name to look for + * @return the corresponding AddressValidationStatus + */ + @JsonCreator + public static AddressValidationStatus fromString(String name) { + return fromString(name, AddressValidationStatus.class); + } + + /** + * @return known AddressValidationStatus values + */ + public static Collection values() { + return values(AddressValidationStatus.class); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Agreement.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Agreement.java new file mode 100644 index 000000000000..fc9ed37a5a58 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Agreement.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.AgreementInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing Agreement. + */ +public interface Agreement extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the agreementLink value. + */ + String agreementLink(); + + /** + * @return the effectiveDate value. + */ + DateTime effectiveDate(); + + /** + * @return the expirationDate value. + */ + DateTime expirationDate(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the participants value. + */ + List participants(); + + /** + * @return the status value. + */ + String status(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AgreementListResult.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AgreementListResult.java new file mode 100644 index 000000000000..0f4aded018df --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AgreementListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.AgreementListResultInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.AgreementInner; +import java.util.List; + +/** + * Type representing AgreementListResult. + */ +public interface AgreementListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AgreementType.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AgreementType.java new file mode 100644 index 000000000000..976b97d8cede --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AgreementType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AgreementType. + */ +public final class AgreementType extends ExpandableStringEnum { + /** Static value MicrosoftCustomerAgreement for AgreementType. */ + public static final AgreementType MICROSOFT_CUSTOMER_AGREEMENT = fromString("MicrosoftCustomerAgreement"); + + /** Static value EnterpriseAgreement for AgreementType. */ + public static final AgreementType ENTERPRISE_AGREEMENT = fromString("EnterpriseAgreement"); + + /** Static value MicrosoftOnlineServicesProgram for AgreementType. */ + public static final AgreementType MICROSOFT_ONLINE_SERVICES_PROGRAM = fromString("MicrosoftOnlineServicesProgram"); + + /** + * Creates or finds a AgreementType from its string representation. + * @param name a name to look for + * @return the corresponding AgreementType + */ + @JsonCreator + public static AgreementType fromString(String name) { + return fromString(name, AgreementType.class); + } + + /** + * @return known AgreementType values + */ + public static Collection values() { + return values(AgreementType.class); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Agreements.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Agreements.java new file mode 100644 index 000000000000..59366d29a4cc --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Agreements.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.AgreementsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Agreements. + */ +public interface Agreements extends HasInner { + /** + * Lists all agreements for a billing account. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBillingAccountAsync(String billingAccountName); + + /** + * Get the agreement by name. + * + * @param billingAccountName billing Account Id. + * @param agreementName Agreement Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String billingAccountName, String agreementName); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Amount.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Amount.java new file mode 100644 index 000000000000..38a48c1d84ba --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Amount.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Amount. + */ +public class Amount { + /** + * The currency for the amount value. + */ + @JsonProperty(value = "currency", access = JsonProperty.Access.WRITE_ONLY) + private String currency; + + /** + * Amount value. + */ + @JsonProperty(value = "value") + private Double value; + + /** + * Get the currency for the amount value. + * + * @return the currency value + */ + public String currency() { + return this.currency; + } + + /** + * Get amount value. + * + * @return the value value + */ + public Double value() { + return this.value; + } + + /** + * Set amount value. + * + * @param value the value value to set + * @return the Amount object itself. + */ + public Amount withValue(Double value) { + this.value = value; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AvailableBalance.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AvailableBalance.java new file mode 100644 index 000000000000..ba04740a32e2 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AvailableBalance.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.AvailableBalanceInner; + +/** + * Type representing AvailableBalance. + */ +public interface AvailableBalance extends HasInner, HasManager { + /** + * @return the amount value. + */ + Amount amount(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AvailableBalances.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AvailableBalances.java new file mode 100644 index 000000000000..18b408f304fc --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AvailableBalances.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.AvailableBalancesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AvailableBalances. + */ +public interface AvailableBalances extends HasInner { + /** + * The latest available credit balance for a given billingAccountName and billingProfileName. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByBillingProfileAsync(String billingAccountName, String billingProfileName); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AzurePlan.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AzurePlan.java new file mode 100644 index 000000000000..e7d5939e1e2e --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/AzurePlan.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details about the azure plan. + */ +public class AzurePlan { + /** + * The sku id. + */ + @JsonProperty(value = "skuId") + private String skuId; + + /** + * The sku description. + */ + @JsonProperty(value = "skuDescription", access = JsonProperty.Access.WRITE_ONLY) + private String skuDescription; + + /** + * Get the sku id. + * + * @return the skuId value + */ + public String skuId() { + return this.skuId; + } + + /** + * Set the sku id. + * + * @param skuId the skuId value to set + * @return the AzurePlan object itself. + */ + public AzurePlan withSkuId(String skuId) { + this.skuId = skuId; + return this; + } + + /** + * Get the sku description. + * + * @return the skuDescription value + */ + public String skuDescription() { + return this.skuDescription; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingAccount.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingAccount.java new file mode 100644 index 000000000000..ab902a298404 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingAccount.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingAccountInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingProfileInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.DepartmentInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.EnrollmentAccountInner; + +/** + * Type representing BillingAccount. + */ +public interface BillingAccount extends HasInner, Indexable, Updatable, Refreshable, HasManager { + /** + * @return the address value. + */ + AddressDetails address(); + + /** + * @return the agreementType value. + */ + AgreementType agreementType(); + + /** + * @return the billingProfiles value. + */ + List billingProfiles(); + + /** + * @return the customerType value. + */ + CustomerType customerType(); + + /** + * @return the departments value. + */ + List departments(); + + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the enrollmentAccounts value. + */ + List enrollmentAccounts(); + + /** + * @return the enrollmentDetails value. + */ + Enrollment enrollmentDetails(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the organizationId value. + */ + String organizationId(); + + /** + * @return the type value. + */ + String type(); + + /** + * The template for a BillingAccount update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAddress, UpdateStages.WithBillingProfiles, UpdateStages.WithDepartments, UpdateStages.WithEnrollmentAccounts { + } + + /** + * Grouping of BillingAccount update stages. + */ + interface UpdateStages { + /** + * The stage of the billingaccount update allowing to specify Address. + */ + interface WithAddress { + /** + * Specifies address. + * @param address The address associated with billing account + * @return the next update stage + */ + Update withAddress(AddressDetails address); + } + + /** + * The stage of the billingaccount update allowing to specify BillingProfiles. + */ + interface WithBillingProfiles { + /** + * Specifies billingProfiles. + * @param billingProfiles The billing profiles associated to the billing account. By default this is not populated, unless it's specified in $expand + * @return the next update stage + */ + Update withBillingProfiles(List billingProfiles); + } + + /** + * The stage of the billingaccount update allowing to specify Departments. + */ + interface WithDepartments { + /** + * Specifies departments. + * @param departments The departments associated to the enrollment + * @return the next update stage + */ + Update withDepartments(List departments); + } + + /** + * The stage of the billingaccount update allowing to specify EnrollmentAccounts. + */ + interface WithEnrollmentAccounts { + /** + * Specifies enrollmentAccounts. + * @param enrollmentAccounts The accounts associated to the enrollment + * @return the next update stage + */ + Update withEnrollmentAccounts(List enrollmentAccounts); + } + + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingAccountListResult.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingAccountListResult.java new file mode 100644 index 000000000000..381d33ccc6fc --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingAccountListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingAccountListResultInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingAccountInner; +import java.util.List; + +/** + * Type representing BillingAccountListResult. + */ +public interface BillingAccountListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingAccountUpdateRequest.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingAccountUpdateRequest.java new file mode 100644 index 000000000000..db150a60a1f1 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingAccountUpdateRequest.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingProfileInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.DepartmentInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.EnrollmentAccountInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The request properties of the billing account that can be updated. + */ +@JsonFlatten +public class BillingAccountUpdateRequest { + /** + * The billing account name. + */ + @JsonProperty(value = "properties.displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /** + * The address associated with billing account. + */ + @JsonProperty(value = "properties.address") + private AddressDetails address; + + /** + * The type of agreement. Possible values include: + * 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', + * 'MicrosoftOnlineServicesProgram'. + */ + @JsonProperty(value = "properties.agreementType", access = JsonProperty.Access.WRITE_ONLY) + private AgreementType agreementType; + + /** + * The type of customer. Possible values include: 'Enterprise', + * 'Individual', 'Partner'. + */ + @JsonProperty(value = "properties.customerType", access = JsonProperty.Access.WRITE_ONLY) + private CustomerType customerType; + + /** + * The billing profiles associated to the billing account. By default this + * is not populated, unless it's specified in $expand. + */ + @JsonProperty(value = "properties.billingProfiles") + private List billingProfiles; + + /** + * The details about the associated legacy enrollment. By default this is + * not populated, unless it's specified in $expand. + */ + @JsonProperty(value = "properties.enrollmentDetails", access = JsonProperty.Access.WRITE_ONLY) + private Enrollment enrollmentDetails; + + /** + * The departments associated to the enrollment. + */ + @JsonProperty(value = "properties.departments") + private List departments; + + /** + * The accounts associated to the enrollment. + */ + @JsonProperty(value = "properties.enrollmentAccounts") + private List enrollmentAccounts; + + /** + * Organization id. + */ + @JsonProperty(value = "properties.organizationId", access = JsonProperty.Access.WRITE_ONLY) + private String organizationId; + + /** + * Get the billing account name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the address associated with billing account. + * + * @return the address value + */ + public AddressDetails address() { + return this.address; + } + + /** + * Set the address associated with billing account. + * + * @param address the address value to set + * @return the BillingAccountUpdateRequest object itself. + */ + public BillingAccountUpdateRequest withAddress(AddressDetails address) { + this.address = address; + return this; + } + + /** + * Get the type of agreement. Possible values include: 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', 'MicrosoftOnlineServicesProgram'. + * + * @return the agreementType value + */ + public AgreementType agreementType() { + return this.agreementType; + } + + /** + * Get the type of customer. Possible values include: 'Enterprise', 'Individual', 'Partner'. + * + * @return the customerType value + */ + public CustomerType customerType() { + return this.customerType; + } + + /** + * Get the billing profiles associated to the billing account. By default this is not populated, unless it's specified in $expand. + * + * @return the billingProfiles value + */ + public List billingProfiles() { + return this.billingProfiles; + } + + /** + * Set the billing profiles associated to the billing account. By default this is not populated, unless it's specified in $expand. + * + * @param billingProfiles the billingProfiles value to set + * @return the BillingAccountUpdateRequest object itself. + */ + public BillingAccountUpdateRequest withBillingProfiles(List billingProfiles) { + this.billingProfiles = billingProfiles; + return this; + } + + /** + * Get the details about the associated legacy enrollment. By default this is not populated, unless it's specified in $expand. + * + * @return the enrollmentDetails value + */ + public Enrollment enrollmentDetails() { + return this.enrollmentDetails; + } + + /** + * Get the departments associated to the enrollment. + * + * @return the departments value + */ + public List departments() { + return this.departments; + } + + /** + * Set the departments associated to the enrollment. + * + * @param departments the departments value to set + * @return the BillingAccountUpdateRequest object itself. + */ + public BillingAccountUpdateRequest withDepartments(List departments) { + this.departments = departments; + return this; + } + + /** + * Get the accounts associated to the enrollment. + * + * @return the enrollmentAccounts value + */ + public List enrollmentAccounts() { + return this.enrollmentAccounts; + } + + /** + * Set the accounts associated to the enrollment. + * + * @param enrollmentAccounts the enrollmentAccounts value to set + * @return the BillingAccountUpdateRequest object itself. + */ + public BillingAccountUpdateRequest withEnrollmentAccounts(List enrollmentAccounts) { + this.enrollmentAccounts = enrollmentAccounts; + return this; + } + + /** + * Get organization id. + * + * @return the organizationId value + */ + public String organizationId() { + return this.organizationId; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingAccounts.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingAccounts.java new file mode 100644 index 000000000000..279025773916 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingAccounts.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingAccountsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BillingAccounts. + */ +public interface BillingAccounts extends HasInner { + /** + * Get the billing account by id. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String billingAccountName); + + /** + * Lists all invoice sections with create subscription permission for a user. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listInvoiceSectionsByCreateSubscriptionPermissionAsync(final String billingAccountName); + + /** + * Lists all billing accounts for a user which he has access to. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingFrequency.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingFrequency.java new file mode 100644 index 000000000000..86115830fc09 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingFrequency.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BillingFrequency. + */ +public final class BillingFrequency extends ExpandableStringEnum { + /** Static value OneTime for BillingFrequency. */ + public static final BillingFrequency ONE_TIME = fromString("OneTime"); + + /** Static value Monthly for BillingFrequency. */ + public static final BillingFrequency MONTHLY = fromString("Monthly"); + + /** Static value UsageBased for BillingFrequency. */ + public static final BillingFrequency USAGE_BASED = fromString("UsageBased"); + + /** + * Creates or finds a BillingFrequency from its string representation. + * @param name a name to look for + * @return the corresponding BillingFrequency + */ + @JsonCreator + public static BillingFrequency fromString(String name) { + return fromString(name, BillingFrequency.class); + } + + /** + * @return known BillingFrequency values + */ + public static Collection values() { + return values(BillingFrequency.class); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingPermissions.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingPermissions.java new file mode 100644 index 000000000000..4c22a4eb57a2 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingPermissions.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Observable; + +/** + * Type representing BillingPermissions. + */ +public interface BillingPermissions { + /** + * Lists all billing permissions the caller has for a customer. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByCustomerAsync(String billingAccountName, String customerName); + + /** + * Lists all billing permissions for the caller under a billing account. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBillingAccountAsync(String billingAccountName); + + /** + * Lists all billing permissions for the caller under invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByInvoiceSectionsAsync(String billingAccountName, String billingProfileName, String invoiceSectionName); + + /** + * Lists all billing permissions the caller has for a billing account. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBillingProfileAsync(String billingAccountName, String billingProfileName); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingPermissionsListResult.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingPermissionsListResult.java new file mode 100644 index 000000000000..3a05157962c8 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingPermissionsListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingPermissionsListResultInner; +import java.util.List; + +/** + * Type representing BillingPermissionsListResult. + */ +public interface BillingPermissionsListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingPermissionsProperties.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingPermissionsProperties.java new file mode 100644 index 000000000000..4f8b4b254641 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingPermissionsProperties.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The set of allowed action and not allowed actions a caller has on a billing + * account. + */ +public class BillingPermissionsProperties { + /** + * The set of actions that the caller is allowed to do. + */ + @JsonProperty(value = "actions", access = JsonProperty.Access.WRITE_ONLY) + private List actions; + + /** + * The set of actions the caller is not allowed to do. + */ + @JsonProperty(value = "notActions", access = JsonProperty.Access.WRITE_ONLY) + private List notActions; + + /** + * Get the set of actions that the caller is allowed to do. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Get the set of actions the caller is not allowed to do. + * + * @return the notActions value + */ + public List notActions() { + return this.notActions; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingProfile.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingProfile.java new file mode 100644 index 000000000000..87778e653798 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingProfile.java @@ -0,0 +1,249 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingProfileInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.InvoiceSectionInner; + +/** + * Type representing BillingProfile. + */ +public interface BillingProfile extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the address value. + */ + AddressDetails address(); + + /** + * @return the currency value. + */ + String currency(); + + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the enabledAzurePlans value. + */ + List enabledAzurePlans(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the invoiceDay value. + */ + Integer invoiceDay(); + + /** + * @return the invoiceEmailOptIn value. + */ + Boolean invoiceEmailOptIn(); + + /** + * @return the invoiceSections value. + */ + List invoiceSections(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the poNumber value. + */ + String poNumber(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the BillingProfile definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithBillingAccount, DefinitionStages.WithCreate { + } + + /** + * Grouping of BillingProfile definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a BillingProfile definition. + */ + interface Blank extends WithBillingAccount { + } + + /** + * The stage of the billingprofile definition allowing to specify BillingAccount. + */ + interface WithBillingAccount { + /** + * Specifies billingAccountName. + * @param billingAccountName billing Account Id + * @return the next definition stage + */ + WithCreate withExistingBillingAccount(String billingAccountName); + } + + /** + * The stage of the billingprofile definition allowing to specify Address. + */ + interface WithAddress { + /** + * Specifies address. + * @param address Billing address + * @return the next definition stage + */ + WithCreate withAddress(AddressDetails address); + } + + /** + * The stage of the billingprofile definition allowing to specify DisplayName. + */ + interface WithDisplayName { + /** + * Specifies displayName. + * @param displayName The billing profile name + * @return the next definition stage + */ + WithCreate withDisplayName(String displayName); + } + + /** + * The stage of the billingprofile definition allowing to specify EnabledAzurePlans. + */ + interface WithEnabledAzurePlans { + /** + * Specifies enabledAzurePlans. + * @param enabledAzurePlans Enabled azure plans for this billing profile + * @return the next definition stage + */ + WithCreate withEnabledAzurePlans(List enabledAzurePlans); + } + + /** + * The stage of the billingprofile definition allowing to specify InvoiceEmailOptIn. + */ + interface WithInvoiceEmailOptIn { + /** + * Specifies invoiceEmailOptIn. + * @param invoiceEmailOptIn If the billing profile is opted in to receive invoices via email + * @return the next definition stage + */ + WithCreate withInvoiceEmailOptIn(Boolean invoiceEmailOptIn); + } + + /** + * The stage of the billingprofile definition allowing to specify PoNumber. + */ + interface WithPoNumber { + /** + * Specifies poNumber. + * @param poNumber Purchase order number + * @return the next definition stage + */ + WithCreate withPoNumber(String poNumber); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAddress, DefinitionStages.WithDisplayName, DefinitionStages.WithEnabledAzurePlans, DefinitionStages.WithInvoiceEmailOptIn, DefinitionStages.WithPoNumber { + } + } + /** + * The template for a BillingProfile update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAddress, UpdateStages.WithDisplayName, UpdateStages.WithEnabledAzurePlans, UpdateStages.WithInvoiceSections, UpdateStages.WithPoNumber { + } + + /** + * Grouping of BillingProfile update stages. + */ + interface UpdateStages { + /** + * The stage of the billingprofile update allowing to specify Address. + */ + interface WithAddress { + /** + * Specifies address. + * @param address Billing address + * @return the next update stage + */ + Update withAddress(AddressDetails address); + } + + /** + * The stage of the billingprofile update allowing to specify DisplayName. + */ + interface WithDisplayName { + /** + * Specifies displayName. + * @param displayName The billing profile name + * @return the next update stage + */ + Update withDisplayName(String displayName); + } + + /** + * The stage of the billingprofile update allowing to specify EnabledAzurePlans. + */ + interface WithEnabledAzurePlans { + /** + * Specifies enabledAzurePlans. + * @param enabledAzurePlans Information about the enabled azure plans + * @return the next update stage + */ + Update withEnabledAzurePlans(List enabledAzurePlans); + } + + /** + * The stage of the billingprofile update allowing to specify InvoiceSections. + */ + interface WithInvoiceSections { + /** + * Specifies invoiceSections. + * @param invoiceSections The invoice sections associated to the billing profile + * @return the next update stage + */ + Update withInvoiceSections(List invoiceSections); + } + + /** + * The stage of the billingprofile update allowing to specify PoNumber. + */ + interface WithPoNumber { + /** + * Specifies poNumber. + * @param poNumber Purchase order number + * @return the next update stage + */ + Update withPoNumber(String poNumber); + } + + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingProfileCreationRequest.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingProfileCreationRequest.java new file mode 100644 index 000000000000..62805b75b4b8 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingProfileCreationRequest.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The request parameters for creating a new billing profile. + */ +public class BillingProfileCreationRequest { + /** + * The billing profile name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Purchase order number. + */ + @JsonProperty(value = "poNumber") + private String poNumber; + + /** + * Billing address. + */ + @JsonProperty(value = "address") + private AddressDetails address; + + /** + * If the billing profile is opted in to receive invoices via email. + */ + @JsonProperty(value = "invoiceEmailOptIn") + private Boolean invoiceEmailOptIn; + + /** + * Enabled azure plans for this billing profile. + */ + @JsonProperty(value = "enabledAzurePlans") + private List enabledAzurePlans; + + /** + * Get the billing profile name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the billing profile name. + * + * @param displayName the displayName value to set + * @return the BillingProfileCreationRequest object itself. + */ + public BillingProfileCreationRequest withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get purchase order number. + * + * @return the poNumber value + */ + public String poNumber() { + return this.poNumber; + } + + /** + * Set purchase order number. + * + * @param poNumber the poNumber value to set + * @return the BillingProfileCreationRequest object itself. + */ + public BillingProfileCreationRequest withPoNumber(String poNumber) { + this.poNumber = poNumber; + return this; + } + + /** + * Get billing address. + * + * @return the address value + */ + public AddressDetails address() { + return this.address; + } + + /** + * Set billing address. + * + * @param address the address value to set + * @return the BillingProfileCreationRequest object itself. + */ + public BillingProfileCreationRequest withAddress(AddressDetails address) { + this.address = address; + return this; + } + + /** + * Get if the billing profile is opted in to receive invoices via email. + * + * @return the invoiceEmailOptIn value + */ + public Boolean invoiceEmailOptIn() { + return this.invoiceEmailOptIn; + } + + /** + * Set if the billing profile is opted in to receive invoices via email. + * + * @param invoiceEmailOptIn the invoiceEmailOptIn value to set + * @return the BillingProfileCreationRequest object itself. + */ + public BillingProfileCreationRequest withInvoiceEmailOptIn(Boolean invoiceEmailOptIn) { + this.invoiceEmailOptIn = invoiceEmailOptIn; + return this; + } + + /** + * Get enabled azure plans for this billing profile. + * + * @return the enabledAzurePlans value + */ + public List enabledAzurePlans() { + return this.enabledAzurePlans; + } + + /** + * Set enabled azure plans for this billing profile. + * + * @param enabledAzurePlans the enabledAzurePlans value to set + * @return the BillingProfileCreationRequest object itself. + */ + public BillingProfileCreationRequest withEnabledAzurePlans(List enabledAzurePlans) { + this.enabledAzurePlans = enabledAzurePlans; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingProfileListResult.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingProfileListResult.java new file mode 100644 index 000000000000..464f5824ab3f --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingProfileListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingProfileListResultInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingProfileInner; +import java.util.List; + +/** + * Type representing BillingProfileListResult. + */ +public interface BillingProfileListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingProfiles.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingProfiles.java new file mode 100644 index 000000000000..a6301147080d --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingProfiles.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingProfilesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BillingProfiles. + */ +public interface BillingProfiles extends SupportsCreating, HasInner { + /** + * Lists all billing profiles for a user which that user has access to. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBillingAccountAsync(String billingAccountName); + + /** + * Get the billing profile by id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String billingAccountName, String billingProfileName); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingProfilesCreateHeaders.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingProfilesCreateHeaders.java new file mode 100644 index 000000000000..afcaf38b807f --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingProfilesCreateHeaders.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Create operation. + */ +public class BillingProfilesCreateHeaders { + /** + * Location URI to poll for result. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Recommends the retryable time after receiving this. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get location URI to poll for result. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set location URI to poll for result. + * + * @param location the location value to set + * @return the BillingProfilesCreateHeaders object itself. + */ + public BillingProfilesCreateHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get recommends the retryable time after receiving this. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set recommends the retryable time after receiving this. + * + * @param retryAfter the retryAfter value to set + * @return the BillingProfilesCreateHeaders object itself. + */ + public BillingProfilesCreateHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingProfilesUpdateHeaders.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingProfilesUpdateHeaders.java new file mode 100644 index 000000000000..5ed220081878 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingProfilesUpdateHeaders.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Update operation. + */ +public class BillingProfilesUpdateHeaders { + /** + * GET this URL to retrieve the status of the asynchronous operation. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * The amount of delay to use while the status of the operation is checked. + * The value is expressed in seconds. + */ + @JsonProperty(value = "Retry-After") + private String retryAfter; + + /** + * Get gET this URL to retrieve the status of the asynchronous operation. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set gET this URL to retrieve the status of the asynchronous operation. + * + * @param location the location value to set + * @return the BillingProfilesUpdateHeaders object itself. + */ + public BillingProfilesUpdateHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the amount of delay to use while the status of the operation is checked. The value is expressed in seconds. + * + * @return the retryAfter value + */ + public String retryAfter() { + return this.retryAfter; + } + + /** + * Set the amount of delay to use while the status of the operation is checked. The value is expressed in seconds. + * + * @param retryAfter the retryAfter value to set + * @return the BillingProfilesUpdateHeaders object itself. + */ + public BillingProfilesUpdateHeaders withRetryAfter(String retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingProperty.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingProperty.java new file mode 100644 index 000000000000..547a73ede1cf --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingProperty.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingPropertyInner; + +/** + * Type representing BillingProperty. + */ +public interface BillingProperty extends HasInner, HasManager { + /** + * @return the billingAccountDisplayName value. + */ + String billingAccountDisplayName(); + + /** + * @return the billingAccountId value. + */ + String billingAccountId(); + + /** + * @return the billingProfileDisplayName value. + */ + String billingProfileDisplayName(); + + /** + * @return the billingProfileId value. + */ + String billingProfileId(); + + /** + * @return the billingTenantId value. + */ + String billingTenantId(); + + /** + * @return the costCenter value. + */ + String costCenter(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the invoiceSectionDisplayName value. + */ + String invoiceSectionDisplayName(); + + /** + * @return the invoiceSectionId value. + */ + String invoiceSectionId(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the productId value. + */ + String productId(); + + /** + * @return the productName value. + */ + String productName(); + + /** + * @return the skuDescription value. + */ + String skuDescription(); + + /** + * @return the skuId value. + */ + String skuId(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingPropertys.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingPropertys.java new file mode 100644 index 000000000000..a8861e6f8b54 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingPropertys.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingPropertysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BillingPropertys. + */ +public interface BillingPropertys extends HasInner { + /** + * Get billing property by subscription Id. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingRoleAssignment.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingRoleAssignment.java new file mode 100644 index 000000000000..7db03d45f45f --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingRoleAssignment.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingRoleAssignmentInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; + +/** + * Type representing BillingRoleAssignment. + */ +public interface BillingRoleAssignment extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the billingRoleAssignmentName value. + */ + String billingRoleAssignmentName(); + + /** + * @return the createdByPrincipalId value. + */ + String createdByPrincipalId(); + + /** + * @return the createdByPrincipalTenantId value. + */ + String createdByPrincipalTenantId(); + + /** + * @return the createdOn value. + */ + String createdOn(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the principalId value. + */ + String principalId(); + + /** + * @return the roleDefinitionName value. + */ + String roleDefinitionName(); + + /** + * @return the scope value. + */ + String scope(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingRoleAssignmentListResult.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingRoleAssignmentListResult.java new file mode 100644 index 000000000000..579cd3330cb8 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingRoleAssignmentListResult.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingRoleAssignmentListResultInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingRoleAssignmentInner; +import java.util.List; + +/** + * Type representing BillingRoleAssignmentListResult. + */ +public interface BillingRoleAssignmentListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingRoleAssignmentPayload.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingRoleAssignmentPayload.java new file mode 100644 index 000000000000..68f652825a3b --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingRoleAssignmentPayload.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The payload use to update role assignment on a scope. + */ +public class BillingRoleAssignmentPayload { + /** + * The user's principal id that the role gets assigned to. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /** + * The role definition id. + */ + @JsonProperty(value = "billingRoleDefinitionId") + private String billingRoleDefinitionId; + + /** + * Get the user's principal id that the role gets assigned to. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the user's principal id that the role gets assigned to. + * + * @param principalId the principalId value to set + * @return the BillingRoleAssignmentPayload object itself. + */ + public BillingRoleAssignmentPayload withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the role definition id. + * + * @return the billingRoleDefinitionId value + */ + public String billingRoleDefinitionId() { + return this.billingRoleDefinitionId; + } + + /** + * Set the role definition id. + * + * @param billingRoleDefinitionId the billingRoleDefinitionId value to set + * @return the BillingRoleAssignmentPayload object itself. + */ + public BillingRoleAssignmentPayload withBillingRoleDefinitionId(String billingRoleDefinitionId) { + this.billingRoleDefinitionId = billingRoleDefinitionId; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingRoleAssignments.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingRoleAssignments.java new file mode 100644 index 000000000000..a3a0773d0353 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingRoleAssignments.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingRoleAssignmentsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BillingRoleAssignments. + */ +public interface BillingRoleAssignments extends HasInner { + /** + * Get the role assignment for the caller on the invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingRoleAssignmentName); + + /** + * Delete the role assignment on the invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable deleteByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingRoleAssignmentName); + + /** + * Get the role assignment for the caller on the Billing Profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByBillingProfileAsync(String billingAccountName, String billingProfileName, String billingRoleAssignmentName); + + /** + * Delete the role assignment on this Billing Profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable deleteByBillingProfileAsync(String billingAccountName, String billingProfileName, String billingRoleAssignmentName); + + /** + * Get the role assignments on the Billing Account. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBillingAccountAsync(String billingAccountName); + + /** + * Get the role assignments on the invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName); + + /** + * Get the role assignments on the Billing Profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBillingProfileAsync(String billingAccountName, String billingProfileName); + + /** + * Get the role assignment for the caller. + * + * @param billingAccountName billing Account Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByBillingAccountAsync(String billingAccountName, String billingRoleAssignmentName); + + /** + * Delete the role assignment on this billing account. + * + * @param billingAccountName billing Account Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteByBillingAccountAsync(String billingAccountName, String billingRoleAssignmentName); + + /** + * The operation to add a role assignment to a billing account. + * + * @param billingAccountName billing Account Id. + * @param parameters Parameters supplied to add a role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable addByBillingAccountAsync(String billingAccountName, BillingRoleAssignmentPayload parameters); + + /** + * The operation to add a role assignment to a invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param parameters Parameters supplied to add a role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable addByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, BillingRoleAssignmentPayload parameters); + + /** + * The operation to add a role assignment to a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Parameters supplied to add a role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable addByBillingProfileAsync(String billingAccountName, String billingProfileName, BillingRoleAssignmentPayload parameters); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingRoleDefinition.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingRoleDefinition.java new file mode 100644 index 000000000000..ca28289069f3 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingRoleDefinition.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingRoleDefinitionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import java.util.List; + +/** + * Type representing BillingRoleDefinition. + */ +public interface BillingRoleDefinition extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the description value. + */ + String description(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the roleName value. + */ + String roleName(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingRoleDefinitionListResult.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingRoleDefinitionListResult.java new file mode 100644 index 000000000000..de4f300bbe46 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingRoleDefinitionListResult.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingRoleDefinitionListResultInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingRoleDefinitionInner; +import java.util.List; + +/** + * Type representing BillingRoleDefinitionListResult. + */ +public interface BillingRoleDefinitionListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingRoleDefinitions.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingRoleDefinitions.java new file mode 100644 index 000000000000..8ee7bede53f7 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingRoleDefinitions.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingRoleDefinitionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BillingRoleDefinitions. + */ +public interface BillingRoleDefinitions extends HasInner { + /** + * Gets the role definition for a role. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingRoleDefinitionName role definition id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingRoleDefinitionName); + + /** + * Gets the role definition for a role. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param billingRoleDefinitionName role definition id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByBillingProfileAsync(String billingAccountName, String billingProfileName, String billingRoleDefinitionName); + + /** + * Lists the role definition for a billing account. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBillingAccountAsync(String billingAccountName); + + /** + * Lists the role definition for an invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName); + + /** + * Lists the role definition for a Billing Profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBillingProfileAsync(String billingAccountName, String billingProfileName); + + /** + * Gets the role definition for a role. + * + * @param billingAccountName billing Account Id. + * @param billingRoleDefinitionName role definition id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByBillingAccountAsync(String billingAccountName, String billingRoleDefinitionName); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingSubscription.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingSubscription.java new file mode 100644 index 000000000000..03cae8d6c84c --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingSubscription.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingSubscriptionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import java.util.UUID; + +/** + * Type representing BillingSubscription. + */ +public interface BillingSubscription extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the billingProfileDisplayName value. + */ + String billingProfileDisplayName(); + + /** + * @return the billingProfileId value. + */ + String billingProfileId(); + + /** + * @return the customerDisplayName value. + */ + String customerDisplayName(); + + /** + * @return the customerId value. + */ + String customerId(); + + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the invoiceSectionDisplayName value. + */ + String invoiceSectionDisplayName(); + + /** + * @return the invoiceSectionId value. + */ + String invoiceSectionId(); + + /** + * @return the lastMonthCharges value. + */ + Amount lastMonthCharges(); + + /** + * @return the monthToDateCharges value. + */ + Amount monthToDateCharges(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the reseller value. + */ + Reseller reseller(); + + /** + * @return the skuDescription value. + */ + String skuDescription(); + + /** + * @return the skuId value. + */ + String skuId(); + + /** + * @return the subscriptionBillingStatus value. + */ + BillingSubscriptionStatusType subscriptionBillingStatus(); + + /** + * @return the subscriptionId value. + */ + UUID subscriptionId(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingSubscriptionStatusType.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingSubscriptionStatusType.java new file mode 100644 index 000000000000..bc9b2cf08b79 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingSubscriptionStatusType.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BillingSubscriptionStatusType. + */ +public final class BillingSubscriptionStatusType extends ExpandableStringEnum { + /** Static value Active for BillingSubscriptionStatusType. */ + public static final BillingSubscriptionStatusType ACTIVE = fromString("Active"); + + /** Static value Inactive for BillingSubscriptionStatusType. */ + public static final BillingSubscriptionStatusType INACTIVE = fromString("Inactive"); + + /** Static value Abandoned for BillingSubscriptionStatusType. */ + public static final BillingSubscriptionStatusType ABANDONED = fromString("Abandoned"); + + /** Static value Deleted for BillingSubscriptionStatusType. */ + public static final BillingSubscriptionStatusType DELETED = fromString("Deleted"); + + /** Static value Warning for BillingSubscriptionStatusType. */ + public static final BillingSubscriptionStatusType WARNING = fromString("Warning"); + + /** + * Creates or finds a BillingSubscriptionStatusType from its string representation. + * @param name a name to look for + * @return the corresponding BillingSubscriptionStatusType + */ + @JsonCreator + public static BillingSubscriptionStatusType fromString(String name) { + return fromString(name, BillingSubscriptionStatusType.class); + } + + /** + * @return known BillingSubscriptionStatusType values + */ + public static Collection values() { + return values(BillingSubscriptionStatusType.class); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingSubscriptions.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingSubscriptions.java new file mode 100644 index 000000000000..a68fb8ab3b29 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingSubscriptions.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingSubscriptionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BillingSubscriptions. + */ +public interface BillingSubscriptions extends HasInner { + /** + * Lists billing subscriptions by billing account name. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBillingAccountAsync(final String billingAccountName); + + /** + * Lists billing subscriptions by billing profile name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBillingProfileAsync(String billingAccountName, String billingProfileName); + + /** + * Lists billing subscription by invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName); + + /** + * Get a single billing subscription by name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingSubscriptionName Billing Subscription Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingSubscriptionName); + + /** + * Transfers the subscription from one invoice section to another within a billing account. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingSubscriptionName Billing Subscription Id. + * @param parameters Request parameters supplied to the Transfer Billing Subscription operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable transferAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters); + + /** + * Validates the transfer of billing subscriptions across invoice sections. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingSubscriptionName Billing Subscription Id. + * @param parameters Parameters supplied to the Transfer Billing Subscription operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable validateTransferAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters); + + /** + * Get a single billing subscription by id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param billingSubscriptionName Billing Subscription Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByCustomerAsync(String billingAccountName, String customerName, String billingSubscriptionName); + + /** + * Lists billing subscription by customer id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByCustomerAsync(final String billingAccountName, final String customerName); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingSubscriptionsListResult.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingSubscriptionsListResult.java new file mode 100644 index 000000000000..efa0aa2a9c05 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingSubscriptionsListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingSubscriptionsListResultInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingSubscriptionInner; +import java.util.List; + +/** + * Type representing BillingSubscriptionsListResult. + */ +public interface BillingSubscriptionsListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingSubscriptionsTransferHeaders.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingSubscriptionsTransferHeaders.java new file mode 100644 index 000000000000..dbe313693c67 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/BillingSubscriptionsTransferHeaders.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Transfer operation. + */ +public class BillingSubscriptionsTransferHeaders { + /** + * Location URI to poll for result. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Recommends the retryable time after receiving this. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get location URI to poll for result. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set location URI to poll for result. + * + * @param location the location value to set + * @return the BillingSubscriptionsTransferHeaders object itself. + */ + public BillingSubscriptionsTransferHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get recommends the retryable time after receiving this. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set recommends the retryable time after receiving this. + * + * @param retryAfter the retryAfter value to set + * @return the BillingSubscriptionsTransferHeaders object itself. + */ + public BillingSubscriptionsTransferHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Customer.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Customer.java new file mode 100644 index 000000000000..d868c4c63420 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Customer.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.CustomerInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import java.util.List; + +/** + * Type representing Customer. + */ +public interface Customer extends HasInner, HasManager { + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the enabledAzurePlans value. + */ + List enabledAzurePlans(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the resellers value. + */ + List resellers(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/CustomerBillingProfileBillingAccountTransferDetails.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/CustomerBillingProfileBillingAccountTransferDetails.java new file mode 100644 index 000000000000..9242786a9b3c --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/CustomerBillingProfileBillingAccountTransferDetails.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.TransferDetailsInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing CustomerBillingProfileBillingAccountTransferDetails. + */ +public interface CustomerBillingProfileBillingAccountTransferDetails extends HasInner, HasManager { + /** + * @return the billingAccountId value. + */ + String billingAccountId(); + + /** + * @return the billingProfileId value. + */ + String billingProfileId(); + + /** + * @return the canceledBy value. + */ + String canceledBy(); + + /** + * @return the creationTime value. + */ + DateTime creationTime(); + + /** + * @return the detailedTransferStatus value. + */ + List detailedTransferStatus(); + + /** + * @return the expirationTime value. + */ + DateTime expirationTime(); + + /** + * @return the initiatorCustomerType value. + */ + String initiatorCustomerType(); + + /** + * @return the initiatorEmailId value. + */ + String initiatorEmailId(); + + /** + * @return the invoiceSectionId value. + */ + String invoiceSectionId(); + + /** + * @return the lastModifiedTime value. + */ + DateTime lastModifiedTime(); + + /** + * @return the recipientEmailId value. + */ + String recipientEmailId(); + + /** + * @return the resellerId value. + */ + String resellerId(); + + /** + * @return the resellerName value. + */ + String resellerName(); + + /** + * @return the transferStatus value. + */ + TransferStatus transferStatus(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/CustomerBillingProfileBillingAccountTransferDetailsModel.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/CustomerBillingProfileBillingAccountTransferDetailsModel.java new file mode 100644 index 000000000000..26acbad7b9e7 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/CustomerBillingProfileBillingAccountTransferDetailsModel.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.TransferDetailsInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing CustomerBillingProfileBillingAccountTransferDetailsModel. + */ +public interface CustomerBillingProfileBillingAccountTransferDetailsModel extends HasInner, HasManager { + /** + * @return the billingAccountId value. + */ + String billingAccountId(); + + /** + * @return the billingProfileId value. + */ + String billingProfileId(); + + /** + * @return the canceledBy value. + */ + String canceledBy(); + + /** + * @return the creationTime value. + */ + DateTime creationTime(); + + /** + * @return the detailedTransferStatus value. + */ + List detailedTransferStatus(); + + /** + * @return the expirationTime value. + */ + DateTime expirationTime(); + + /** + * @return the initiatorCustomerType value. + */ + String initiatorCustomerType(); + + /** + * @return the initiatorEmailId value. + */ + String initiatorEmailId(); + + /** + * @return the invoiceSectionId value. + */ + String invoiceSectionId(); + + /** + * @return the lastModifiedTime value. + */ + DateTime lastModifiedTime(); + + /** + * @return the recipientEmailId value. + */ + String recipientEmailId(); + + /** + * @return the resellerId value. + */ + String resellerId(); + + /** + * @return the resellerName value. + */ + String resellerName(); + + /** + * @return the transferStatus value. + */ + TransferStatus transferStatus(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/CustomerType.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/CustomerType.java new file mode 100644 index 000000000000..3a5f4935ae2e --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/CustomerType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CustomerType. + */ +public final class CustomerType extends ExpandableStringEnum { + /** Static value Enterprise for CustomerType. */ + public static final CustomerType ENTERPRISE = fromString("Enterprise"); + + /** Static value Individual for CustomerType. */ + public static final CustomerType INDIVIDUAL = fromString("Individual"); + + /** Static value Partner for CustomerType. */ + public static final CustomerType PARTNER = fromString("Partner"); + + /** + * Creates or finds a CustomerType from its string representation. + * @param name a name to look for + * @return the corresponding CustomerType + */ + @JsonCreator + public static CustomerType fromString(String name) { + return fromString(name, CustomerType.class); + } + + /** + * @return known CustomerType values + */ + public static Collection values() { + return values(CustomerType.class); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Customers.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Customers.java new file mode 100644 index 000000000000..a760f51007ea --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Customers.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.CustomersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Customers. + */ +public interface Customers extends HasInner { + /** + * Lists customers which the current user can work with on-behalf of a partner. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBillingAccountAsync(final String billingAccountName); + + /** + * Gets a customer by its id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String billingAccountName, String customerName); + + /** + * Lists customers by billing profile which the current user can work with on-behalf of a partner. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBillingProfileAsync(final String billingAccountName, final String billingProfileName); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Department.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Department.java new file mode 100644 index 000000000000..09763d84ada5 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Department.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.DepartmentInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import java.util.List; + +/** + * Type representing Department. + */ +public interface Department extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the costCenter value. + */ + String costCenter(); + + /** + * @return the departmentName value. + */ + String departmentName(); + + /** + * @return the enrollmentAccounts value. + */ + List enrollmentAccounts(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the status value. + */ + String status(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/DepartmentListResult.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/DepartmentListResult.java new file mode 100644 index 000000000000..b0c14ee027d3 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/DepartmentListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.DepartmentListResultInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.DepartmentInner; +import java.util.List; + +/** + * Type representing DepartmentListResult. + */ +public interface DepartmentListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Departments.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Departments.java new file mode 100644 index 000000000000..ee3ec99c8b89 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Departments.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.DepartmentsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Departments. + */ +public interface Departments extends HasInner { + /** + * Lists all departments for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBillingAccountNameAsync(String billingAccountName); + + /** + * Get the department by id. + * + * @param billingAccountName billing Account Id. + * @param departmentName Department Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String billingAccountName, String departmentName); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/DetailedTransferStatus.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/DetailedTransferStatus.java new file mode 100644 index 000000000000..d815c40597dd --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/DetailedTransferStatus.java @@ -0,0 +1,90 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Detailed transfer status. + */ +public class DetailedTransferStatus { + /** + * Type of product being transferred. Possible values include: + * 'AzureSubscription', 'AzureReservation'. + */ + @JsonProperty(value = "productType", access = JsonProperty.Access.WRITE_ONLY) + private ProductType productType; + + /** + * Id of product being transferred. + */ + @JsonProperty(value = "productId", access = JsonProperty.Access.WRITE_ONLY) + private String productId; + + /** + * Transfer status. Possible values include: 'NotStarted', 'InProgress', + * 'Completed', 'Failed'. + */ + @JsonProperty(value = "transferStatus", access = JsonProperty.Access.WRITE_ONLY) + private ProductTransferStatus transferStatus; + + /** + * Error details for transfer execution. + */ + @JsonProperty(value = "errorDetails") + private Error errorDetails; + + /** + * Get type of product being transferred. Possible values include: 'AzureSubscription', 'AzureReservation'. + * + * @return the productType value + */ + public ProductType productType() { + return this.productType; + } + + /** + * Get id of product being transferred. + * + * @return the productId value + */ + public String productId() { + return this.productId; + } + + /** + * Get transfer status. Possible values include: 'NotStarted', 'InProgress', 'Completed', 'Failed'. + * + * @return the transferStatus value + */ + public ProductTransferStatus transferStatus() { + return this.transferStatus; + } + + /** + * Get error details for transfer execution. + * + * @return the errorDetails value + */ + public Error errorDetails() { + return this.errorDetails; + } + + /** + * Set error details for transfer execution. + * + * @param errorDetails the errorDetails value to set + * @return the DetailedTransferStatus object itself. + */ + public DetailedTransferStatus withErrorDetails(Error errorDetails) { + this.errorDetails = errorDetails; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Document.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Document.java new file mode 100644 index 000000000000..3d05fe8686d3 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Document.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the invoice download. + */ +public class Document { + /** + * Document type. Possible values include: 'Invoice', 'VoidNote', + * 'Receipt', 'CreditNote'. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private DocumentType kind; + + /** + * Document URL. + */ + @JsonProperty(value = "url", access = JsonProperty.Access.WRITE_ONLY) + private String url; + + /** + * Get document type. Possible values include: 'Invoice', 'VoidNote', 'Receipt', 'CreditNote'. + * + * @return the kind value + */ + public DocumentType kind() { + return this.kind; + } + + /** + * Get document URL. + * + * @return the url value + */ + public String url() { + return this.url; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/DocumentType.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/DocumentType.java new file mode 100644 index 000000000000..a907ccbabd95 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/DocumentType.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DocumentType. + */ +public final class DocumentType extends ExpandableStringEnum { + /** Static value Invoice for DocumentType. */ + public static final DocumentType INVOICE = fromString("Invoice"); + + /** Static value VoidNote for DocumentType. */ + public static final DocumentType VOID_NOTE = fromString("VoidNote"); + + /** Static value Receipt for DocumentType. */ + public static final DocumentType RECEIPT = fromString("Receipt"); + + /** Static value CreditNote for DocumentType. */ + public static final DocumentType CREDIT_NOTE = fromString("CreditNote"); + + /** + * Creates or finds a DocumentType from its string representation. + * @param name a name to look for + * @return the corresponding DocumentType + */ + @JsonCreator + public static DocumentType fromString(String name) { + return fromString(name, DocumentType.class); + } + + /** + * @return known DocumentType values + */ + public static Collection values() { + return values(DocumentType.class); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/DownloadUrl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/DownloadUrl.java new file mode 100644 index 000000000000..875a3bbaafdb --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/DownloadUrl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.DownloadUrlInner; +import org.joda.time.DateTime; + +/** + * Type representing DownloadUrl. + */ +public interface DownloadUrl extends HasInner, HasManager { + /** + * @return the expiryTime value. + */ + DateTime expiryTime(); + + /** + * @return the url value. + */ + String url(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/EligibleProductType.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/EligibleProductType.java new file mode 100644 index 000000000000..e30aa4dc2495 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/EligibleProductType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EligibleProductType. + */ +public final class EligibleProductType extends ExpandableStringEnum { + /** Static value DevTestAzureSubscription for EligibleProductType. */ + public static final EligibleProductType DEV_TEST_AZURE_SUBSCRIPTION = fromString("DevTestAzureSubscription"); + + /** Static value StandardAzureSubscription for EligibleProductType. */ + public static final EligibleProductType STANDARD_AZURE_SUBSCRIPTION = fromString("StandardAzureSubscription"); + + /** Static value AzureReservation for EligibleProductType. */ + public static final EligibleProductType AZURE_RESERVATION = fromString("AzureReservation"); + + /** + * Creates or finds a EligibleProductType from its string representation. + * @param name a name to look for + * @return the corresponding EligibleProductType + */ + @JsonCreator + public static EligibleProductType fromString(String name) { + return fromString(name, EligibleProductType.class); + } + + /** + * @return known EligibleProductType values + */ + public static Collection values() { + return values(EligibleProductType.class); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Enrollment.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Enrollment.java new file mode 100644 index 000000000000..182c36a5fbec --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Enrollment.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Current entity level details. + */ +public class Enrollment { + /** + * Enrollment Start Date. + */ + @JsonProperty(value = "startDate") + private DateTime startDate; + + /** + * Enrollment End Date. + */ + @JsonProperty(value = "endDate") + private DateTime endDate; + + /** + * The currency associated with enrollment. + */ + @JsonProperty(value = "currency", access = JsonProperty.Access.WRITE_ONLY) + private String currency; + + /** + * The channel for Enrollment. + */ + @JsonProperty(value = "channel", access = JsonProperty.Access.WRITE_ONLY) + private String channel; + + /** + * The attributes associated with legacy enrollment. + */ + @JsonProperty(value = "policies", access = JsonProperty.Access.WRITE_ONLY) + private EnrollmentPolicies policies; + + /** + * The language for Enrollment. + */ + @JsonProperty(value = "language", access = JsonProperty.Access.WRITE_ONLY) + private String language; + + /** + * The countryCode for Enrollment. + */ + @JsonProperty(value = "countryCode", access = JsonProperty.Access.WRITE_ONLY) + private String countryCode; + + /** + * Enrollment status. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * Enrollment billing cycle. + */ + @JsonProperty(value = "billingCycle", access = JsonProperty.Access.WRITE_ONLY) + private String billingCycle; + + /** + * Get enrollment Start Date. + * + * @return the startDate value + */ + public DateTime startDate() { + return this.startDate; + } + + /** + * Set enrollment Start Date. + * + * @param startDate the startDate value to set + * @return the Enrollment object itself. + */ + public Enrollment withStartDate(DateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get enrollment End Date. + * + * @return the endDate value + */ + public DateTime endDate() { + return this.endDate; + } + + /** + * Set enrollment End Date. + * + * @param endDate the endDate value to set + * @return the Enrollment object itself. + */ + public Enrollment withEndDate(DateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Get the currency associated with enrollment. + * + * @return the currency value + */ + public String currency() { + return this.currency; + } + + /** + * Get the channel for Enrollment. + * + * @return the channel value + */ + public String channel() { + return this.channel; + } + + /** + * Get the attributes associated with legacy enrollment. + * + * @return the policies value + */ + public EnrollmentPolicies policies() { + return this.policies; + } + + /** + * Get the language for Enrollment. + * + * @return the language value + */ + public String language() { + return this.language; + } + + /** + * Get the countryCode for Enrollment. + * + * @return the countryCode value + */ + public String countryCode() { + return this.countryCode; + } + + /** + * Get enrollment status. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Get enrollment billing cycle. + * + * @return the billingCycle value + */ + public String billingCycle() { + return this.billingCycle; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/EnrollmentAccount.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/EnrollmentAccount.java new file mode 100644 index 000000000000..645bcc55edab --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/EnrollmentAccount.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.EnrollmentAccountInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import org.joda.time.DateTime; + +/** + * Type representing EnrollmentAccount. + */ +public interface EnrollmentAccount extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the accountName value. + */ + String accountName(); + + /** + * @return the accountOwner value. + */ + String accountOwner(); + + /** + * @return the costCenter value. + */ + String costCenter(); + + /** + * @return the department value. + */ + Department department(); + + /** + * @return the endDate value. + */ + DateTime endDate(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the startDate value. + */ + DateTime startDate(); + + /** + * @return the status value. + */ + String status(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/EnrollmentAccountContext.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/EnrollmentAccountContext.java new file mode 100644 index 000000000000..74562970f661 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/EnrollmentAccountContext.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The rating context. + */ +public class EnrollmentAccountContext { + /** + * The cost center name. + */ + @JsonProperty(value = "costCenter") + private String costCenter; + + /** + * Account Start Date. + */ + @JsonProperty(value = "startDate") + private DateTime startDate; + + /** + * Account End Date. + */ + @JsonProperty(value = "endDate") + private DateTime endDate; + + /** + * The enrollment account id. + */ + @JsonProperty(value = "enrollmentAccountName") + private String enrollmentAccountName; + + /** + * Get the cost center name. + * + * @return the costCenter value + */ + public String costCenter() { + return this.costCenter; + } + + /** + * Set the cost center name. + * + * @param costCenter the costCenter value to set + * @return the EnrollmentAccountContext object itself. + */ + public EnrollmentAccountContext withCostCenter(String costCenter) { + this.costCenter = costCenter; + return this; + } + + /** + * Get account Start Date. + * + * @return the startDate value + */ + public DateTime startDate() { + return this.startDate; + } + + /** + * Set account Start Date. + * + * @param startDate the startDate value to set + * @return the EnrollmentAccountContext object itself. + */ + public EnrollmentAccountContext withStartDate(DateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get account End Date. + * + * @return the endDate value + */ + public DateTime endDate() { + return this.endDate; + } + + /** + * Set account End Date. + * + * @param endDate the endDate value to set + * @return the EnrollmentAccountContext object itself. + */ + public EnrollmentAccountContext withEndDate(DateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Get the enrollment account id. + * + * @return the enrollmentAccountName value + */ + public String enrollmentAccountName() { + return this.enrollmentAccountName; + } + + /** + * Set the enrollment account id. + * + * @param enrollmentAccountName the enrollmentAccountName value to set + * @return the EnrollmentAccountContext object itself. + */ + public EnrollmentAccountContext withEnrollmentAccountName(String enrollmentAccountName) { + this.enrollmentAccountName = enrollmentAccountName; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/EnrollmentAccountListResult.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/EnrollmentAccountListResult.java new file mode 100644 index 000000000000..0571f5c925cc --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/EnrollmentAccountListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.EnrollmentAccountListResultInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.EnrollmentAccountInner; +import java.util.List; + +/** + * Type representing EnrollmentAccountListResult. + */ +public interface EnrollmentAccountListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/EnrollmentAccounts.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/EnrollmentAccounts.java new file mode 100644 index 000000000000..223746844310 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/EnrollmentAccounts.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.EnrollmentAccountsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing EnrollmentAccounts. + */ +public interface EnrollmentAccounts extends HasInner { + /** + * Lists all Enrollment Accounts for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBillingAccountNameAsync(String billingAccountName); + + /** + * Get the enrollment account by id. + * + * @param billingAccountName billing Account Id. + * @param enrollmentAccountName Enrollment Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByEnrollmentAccountIdAsync(String billingAccountName, String enrollmentAccountName); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/EnrollmentPolicies.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/EnrollmentPolicies.java new file mode 100644 index 000000000000..0a3473a64b61 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/EnrollmentPolicies.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The attributes associated with legacy enrollment. + */ +public class EnrollmentPolicies { + /** + * The accountOwnerViewCharges flag for Enrollment. + */ + @JsonProperty(value = "accountOwnerViewCharges", access = JsonProperty.Access.WRITE_ONLY) + private Boolean accountOwnerViewCharges; + + /** + * The departmentAdminViewCharges flag for Enrollment. + */ + @JsonProperty(value = "departmentAdminViewCharges", access = JsonProperty.Access.WRITE_ONLY) + private Boolean departmentAdminViewCharges; + + /** + * The marketplaces flag for Enrollment. + */ + @JsonProperty(value = "marketplacesEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean marketplacesEnabled; + + /** + * The reserved instances flag for Enrollment. + */ + @JsonProperty(value = "reservedInstancesEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean reservedInstancesEnabled; + + /** + * Get the accountOwnerViewCharges flag for Enrollment. + * + * @return the accountOwnerViewCharges value + */ + public Boolean accountOwnerViewCharges() { + return this.accountOwnerViewCharges; + } + + /** + * Get the departmentAdminViewCharges flag for Enrollment. + * + * @return the departmentAdminViewCharges value + */ + public Boolean departmentAdminViewCharges() { + return this.departmentAdminViewCharges; + } + + /** + * Get the marketplaces flag for Enrollment. + * + * @return the marketplacesEnabled value + */ + public Boolean marketplacesEnabled() { + return this.marketplacesEnabled; + } + + /** + * Get the reserved instances flag for Enrollment. + * + * @return the reservedInstancesEnabled value + */ + public Boolean reservedInstancesEnabled() { + return this.reservedInstancesEnabled; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Error.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Error.java new file mode 100644 index 000000000000..56d2fc1b4963 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Error.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error details for transfer execution. + */ +public class Error { + /** + * Error code. + */ + @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY) + private String errorCode; + + /** + * Error message. + */ + @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String errorMessage; + + /** + * Get error code. + * + * @return the errorCode value + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Get error message. + * + * @return the errorMessage value + */ + public String errorMessage() { + return this.errorMessage; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ErrorDetails.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ErrorDetails.java new file mode 100644 index 000000000000..f231be41fab6 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ErrorDetails.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The details of the error. + */ +public class ErrorDetails { + /** + * Error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * Error message indicating why the operation failed. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The target of the particular error. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * Get error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get error message indicating why the operation failed. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the target of the particular error. + * + * @return the target value + */ + public String target() { + return this.target; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ErrorResponse.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ErrorResponse.java new file mode 100644 index 000000000000..dcc0014f88b0 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ErrorResponse.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error response indicates that the service is not able to process the + * incoming request. The reason is provided in the error message. + */ +public class ErrorResponse { + /** + * The details of the error. + */ + @JsonProperty(value = "error") + private ErrorDetails error; + + /** + * Get the details of the error. + * + * @return the error value + */ + public ErrorDetails error() { + return this.error; + } + + /** + * Set the details of the error. + * + * @param error the error value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withError(ErrorDetails error) { + this.error = error; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ErrorResponseException.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ErrorResponseException.java new file mode 100644 index 000000000000..59d8b1a93fa2 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ErrorResponseException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InitiateTransferRequest.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InitiateTransferRequest.java new file mode 100644 index 000000000000..7ade07e2be78 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InitiateTransferRequest.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Request parameters to initiate transfer. + */ +@JsonFlatten +public class InitiateTransferRequest { + /** + * Email Id of recipient for transfer. + */ + @JsonProperty(value = "properties.recipientEmailId") + private String recipientEmailId; + + /** + * Optional reseller Id for transfer. + */ + @JsonProperty(value = "properties.resellerId") + private String resellerId; + + /** + * Get email Id of recipient for transfer. + * + * @return the recipientEmailId value + */ + public String recipientEmailId() { + return this.recipientEmailId; + } + + /** + * Set email Id of recipient for transfer. + * + * @param recipientEmailId the recipientEmailId value to set + * @return the InitiateTransferRequest object itself. + */ + public InitiateTransferRequest withRecipientEmailId(String recipientEmailId) { + this.recipientEmailId = recipientEmailId; + return this; + } + + /** + * Get optional reseller Id for transfer. + * + * @return the resellerId value + */ + public String resellerId() { + return this.resellerId; + } + + /** + * Set optional reseller Id for transfer. + * + * @param resellerId the resellerId value to set + * @return the InitiateTransferRequest object itself. + */ + public InitiateTransferRequest withResellerId(String resellerId) { + this.resellerId = resellerId; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Invoice.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Invoice.java new file mode 100644 index 000000000000..13870bd56384 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Invoice.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.InvoiceInner; +import java.util.List; +import org.joda.time.DateTime; + +/** + * Type representing Invoice. + */ +public interface Invoice extends HasInner, HasManager { + /** + * @return the amountDue value. + */ + Amount amountDue(); + + /** + * @return the billedAmount value. + */ + Amount billedAmount(); + + /** + * @return the billingProfileDisplayName value. + */ + String billingProfileDisplayName(); + + /** + * @return the billingProfileId value. + */ + String billingProfileId(); + + /** + * @return the documents value. + */ + List documents(); + + /** + * @return the dueDate value. + */ + DateTime dueDate(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the invoiceDate value. + */ + DateTime invoiceDate(); + + /** + * @return the invoicePeriodEndDate value. + */ + DateTime invoicePeriodEndDate(); + + /** + * @return the invoicePeriodStartDate value. + */ + DateTime invoicePeriodStartDate(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the payments value. + */ + List payments(); + + /** + * @return the purchaseOrderNumber value. + */ + String purchaseOrderNumber(); + + /** + * @return the status value. + */ + InvoiceStatus status(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceListResult.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceListResult.java new file mode 100644 index 000000000000..15b3460edaff --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.InvoiceListResultInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.InvoiceInner; +import java.util.List; + +/** + * Type representing InvoiceListResult. + */ +public interface InvoiceListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSection.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSection.java new file mode 100644 index 000000000000..d06a72cce8a8 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSection.java @@ -0,0 +1,117 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.InvoiceSectionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; + +/** + * Type representing InvoiceSection. + */ +public interface InvoiceSection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the InvoiceSection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithBillingProfile, DefinitionStages.WithDisplayName, DefinitionStages.WithCreate { + } + + /** + * Grouping of InvoiceSection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a InvoiceSection definition. + */ + interface Blank extends WithBillingProfile { + } + + /** + * The stage of the invoicesection definition allowing to specify BillingProfile. + */ + interface WithBillingProfile { + /** + * Specifies billingAccountName, billingProfileName. + * @param billingAccountName billing Account Id + * @param billingProfileName Billing Profile Id + * @return the next definition stage + */ + WithDisplayName withExistingBillingProfile(String billingAccountName, String billingProfileName); + } + + /** + * The stage of the invoicesection definition allowing to specify DisplayName. + */ + interface WithDisplayName { + /** + * Specifies displayName. + * @param displayName The name of the InvoiceSection + * @return the next definition stage + */ + WithCreate withDisplayName(String displayName); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a InvoiceSection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDisplayName { + } + + /** + * Grouping of InvoiceSection update stages. + */ + interface UpdateStages { + /** + * The stage of the invoicesection update allowing to specify DisplayName. + */ + interface WithDisplayName { + /** + * Specifies displayName. + * @param displayName The name of the InvoiceSection + * @return the next update stage + */ + Update withDisplayName(String displayName); + } + + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSectionBillingProfileBillingAccountTransferDetails.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSectionBillingProfileBillingAccountTransferDetails.java new file mode 100644 index 000000000000..3e76cc9436fa --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSectionBillingProfileBillingAccountTransferDetails.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.TransferDetailsInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing InvoiceSectionBillingProfileBillingAccountTransferDetails. + */ +public interface InvoiceSectionBillingProfileBillingAccountTransferDetails extends HasInner, HasManager { + /** + * @return the billingAccountId value. + */ + String billingAccountId(); + + /** + * @return the billingProfileId value. + */ + String billingProfileId(); + + /** + * @return the canceledBy value. + */ + String canceledBy(); + + /** + * @return the creationTime value. + */ + DateTime creationTime(); + + /** + * @return the detailedTransferStatus value. + */ + List detailedTransferStatus(); + + /** + * @return the expirationTime value. + */ + DateTime expirationTime(); + + /** + * @return the initiatorCustomerType value. + */ + String initiatorCustomerType(); + + /** + * @return the initiatorEmailId value. + */ + String initiatorEmailId(); + + /** + * @return the invoiceSectionId value. + */ + String invoiceSectionId(); + + /** + * @return the lastModifiedTime value. + */ + DateTime lastModifiedTime(); + + /** + * @return the recipientEmailId value. + */ + String recipientEmailId(); + + /** + * @return the resellerId value. + */ + String resellerId(); + + /** + * @return the resellerName value. + */ + String resellerName(); + + /** + * @return the transferStatus value. + */ + TransferStatus transferStatus(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSectionCreationRequest.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSectionCreationRequest.java new file mode 100644 index 000000000000..18bea13236bd --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSectionCreationRequest.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of an InvoiceSection. + */ +public class InvoiceSectionCreationRequest { + /** + * The name of the InvoiceSection. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get the name of the InvoiceSection. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the name of the InvoiceSection. + * + * @param displayName the displayName value to set + * @return the InvoiceSectionCreationRequest object itself. + */ + public InvoiceSectionCreationRequest withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSectionListResult.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSectionListResult.java new file mode 100644 index 000000000000..9f08ce4b3d9e --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSectionListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.InvoiceSectionListResultInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.InvoiceSectionInner; +import java.util.List; + +/** + * Type representing InvoiceSectionListResult. + */ +public interface InvoiceSectionListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSectionWithCreateSubPermission.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSectionWithCreateSubPermission.java new file mode 100644 index 000000000000..f9151743a129 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSectionWithCreateSubPermission.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.InvoiceSectionWithCreateSubPermissionInner; +import java.util.List; + +/** + * Type representing InvoiceSectionWithCreateSubPermission. + */ +public interface InvoiceSectionWithCreateSubPermission extends HasInner, HasManager { + /** + * @return the billingProfileDisplayName value. + */ + String billingProfileDisplayName(); + + /** + * @return the billingProfileId value. + */ + String billingProfileId(); + + /** + * @return the enabledAzurePlans value. + */ + List enabledAzurePlans(); + + /** + * @return the invoiceSectionDisplayName value. + */ + String invoiceSectionDisplayName(); + + /** + * @return the invoiceSectionId value. + */ + String invoiceSectionId(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSections.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSections.java new file mode 100644 index 000000000000..3d286963fd89 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSections.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import rx.Completable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.InvoiceSectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing InvoiceSections. + */ +public interface InvoiceSections extends SupportsCreating, HasInner { + /** + * Lists all invoice sections for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBillingProfileAsync(String billingAccountName, String billingProfileName); + + /** + * Elevates the caller's access to match their billing profile access. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable elevateToBillingProfileAsync(String billingAccountName, String billingProfileName, String invoiceSectionName); + + /** + * Get the InvoiceSection by id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String billingAccountName, String billingProfileName, String invoiceSectionName); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSectionsCreateHeaders.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSectionsCreateHeaders.java new file mode 100644 index 000000000000..ea994f8ae9d8 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSectionsCreateHeaders.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Create operation. + */ +public class InvoiceSectionsCreateHeaders { + /** + * Location URI to poll for result. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Recommends the retryable time after receiving this. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get location URI to poll for result. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set location URI to poll for result. + * + * @param location the location value to set + * @return the InvoiceSectionsCreateHeaders object itself. + */ + public InvoiceSectionsCreateHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get recommends the retryable time after receiving this. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set recommends the retryable time after receiving this. + * + * @param retryAfter the retryAfter value to set + * @return the InvoiceSectionsCreateHeaders object itself. + */ + public InvoiceSectionsCreateHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSectionsUpdateHeaders.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSectionsUpdateHeaders.java new file mode 100644 index 000000000000..1786f47089f7 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceSectionsUpdateHeaders.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Update operation. + */ +public class InvoiceSectionsUpdateHeaders { + /** + * GET this URL to retrieve the status of the asynchronous operation. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * The amount of delay to use while the status of the operation is checked. + * The value is expressed in seconds. + */ + @JsonProperty(value = "Retry-After") + private String retryAfter; + + /** + * Get gET this URL to retrieve the status of the asynchronous operation. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set gET this URL to retrieve the status of the asynchronous operation. + * + * @param location the location value to set + * @return the InvoiceSectionsUpdateHeaders object itself. + */ + public InvoiceSectionsUpdateHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the amount of delay to use while the status of the operation is checked. The value is expressed in seconds. + * + * @return the retryAfter value + */ + public String retryAfter() { + return this.retryAfter; + } + + /** + * Set the amount of delay to use while the status of the operation is checked. The value is expressed in seconds. + * + * @param retryAfter the retryAfter value to set + * @return the InvoiceSectionsUpdateHeaders object itself. + */ + public InvoiceSectionsUpdateHeaders withRetryAfter(String retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceStatus.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceStatus.java new file mode 100644 index 000000000000..f2d9e8b1d5dd --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/InvoiceStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for InvoiceStatus. + */ +public final class InvoiceStatus extends ExpandableStringEnum { + /** Static value PastDue for InvoiceStatus. */ + public static final InvoiceStatus PAST_DUE = fromString("PastDue"); + + /** Static value Due for InvoiceStatus. */ + public static final InvoiceStatus DUE = fromString("Due"); + + /** Static value Paid for InvoiceStatus. */ + public static final InvoiceStatus PAID = fromString("Paid"); + + /** Static value Void for InvoiceStatus. */ + public static final InvoiceStatus VOID = fromString("Void"); + + /** + * Creates or finds a InvoiceStatus from its string representation. + * @param name a name to look for + * @return the corresponding InvoiceStatus + */ + @JsonCreator + public static InvoiceStatus fromString(String name) { + return fromString(name, InvoiceStatus.class); + } + + /** + * @return known InvoiceStatus values + */ + public static Collection values() { + return values(InvoiceStatus.class); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Invoices.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Invoices.java new file mode 100644 index 000000000000..f47bc37c3edb --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Invoices.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.InvoicesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Invoices. + */ +public interface Invoices extends HasInner { + /** + * List of invoices for a billing account. + * + * @param billingAccountName billing Account Id. + * @param periodStartDate Invoice period start date. + * @param periodEndDate Invoice period end date. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBillingAccountAsync(String billingAccountName, String periodStartDate, String periodEndDate); + + /** + * List of invoices for a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param periodStartDate Invoice period start date. + * @param periodEndDate Invoice period end date. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBillingProfileAsync(String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate); + + /** + * Get the invoice by name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String billingAccountName, String billingProfileName, String invoiceName); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/LineOfCredit.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/LineOfCredit.java new file mode 100644 index 000000000000..471502bcd649 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/LineOfCredit.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.LineOfCreditInner; + +/** + * Type representing LineOfCredit. + */ +public interface LineOfCredit extends HasInner, HasManager { + /** + * @return the creditLimit value. + */ + Amount creditLimit(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the reason value. + */ + String reason(); + + /** + * @return the remainingBalance value. + */ + Amount remainingBalance(); + + /** + * @return the status value. + */ + Status status(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/LineOfCredits.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/LineOfCredits.java new file mode 100644 index 000000000000..01d4a43e5f2f --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/LineOfCredits.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.LineOfCreditInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.LineOfCreditsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LineOfCredits. + */ +public interface LineOfCredits extends HasInner { + /** + * Get the current line of credit. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(); + + /** + * Increase the current line of credit. + * + * @param parameters Parameters supplied to the increase line of credit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable updateAsync(LineOfCreditInner parameters); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/LineOfCreditsUpdateHeaders.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/LineOfCreditsUpdateHeaders.java new file mode 100644 index 000000000000..ee5f8a24bd39 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/LineOfCreditsUpdateHeaders.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Update operation. + */ +public class LineOfCreditsUpdateHeaders { + /** + * Location URI to poll for result. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Recommends the retryable time after receiving this. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get location URI to poll for result. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set location URI to poll for result. + * + * @param location the location value to set + * @return the LineOfCreditsUpdateHeaders object itself. + */ + public LineOfCreditsUpdateHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get recommends the retryable time after receiving this. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set recommends the retryable time after receiving this. + * + * @param retryAfter the retryAfter value to set + * @return the LineOfCreditsUpdateHeaders object itself. + */ + public LineOfCreditsUpdateHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/MarketplacePurchasesPolicy.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/MarketplacePurchasesPolicy.java new file mode 100644 index 000000000000..ff8d5bbcffbd --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/MarketplacePurchasesPolicy.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MarketplacePurchasesPolicy. + */ +public final class MarketplacePurchasesPolicy extends ExpandableStringEnum { + /** Static value AllAllowed for MarketplacePurchasesPolicy. */ + public static final MarketplacePurchasesPolicy ALL_ALLOWED = fromString("AllAllowed"); + + /** Static value FreeAllowed for MarketplacePurchasesPolicy. */ + public static final MarketplacePurchasesPolicy FREE_ALLOWED = fromString("FreeAllowed"); + + /** Static value NotAllowed for MarketplacePurchasesPolicy. */ + public static final MarketplacePurchasesPolicy NOT_ALLOWED = fromString("NotAllowed"); + + /** + * Creates or finds a MarketplacePurchasesPolicy from its string representation. + * @param name a name to look for + * @return the corresponding MarketplacePurchasesPolicy + */ + @JsonCreator + public static MarketplacePurchasesPolicy fromString(String name) { + return fromString(name, MarketplacePurchasesPolicy.class); + } + + /** + * @return known MarketplacePurchasesPolicy values + */ + public static Collection values() { + return values(MarketplacePurchasesPolicy.class); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Operation.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Operation.java new file mode 100644 index 000000000000..3cbb9e6f7370 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Operation.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/OperationDisplay.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/OperationDisplay.java new file mode 100644 index 000000000000..6ecf5fd77a6f --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/OperationDisplay.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that represents the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft.Billing. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * Resource on which the operation is performed: Invoice, etc. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * Operation type: Read, write, delete, etc. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * Get service provider: Microsoft.Billing. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Get resource on which the operation is performed: Invoice, etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get operation type: Read, write, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Operations.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Operations.java new file mode 100644 index 000000000000..40bf6b1b4a0a --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available billing REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Participants.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Participants.java new file mode 100644 index 000000000000..3f75e589521c --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Participants.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details about the participant or signer. + */ +public class Participants { + /** + * The signing status. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * The date when status got changed. + */ + @JsonProperty(value = "statusDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime statusDate; + + /** + * The email address of the participant or signer. + */ + @JsonProperty(value = "email", access = JsonProperty.Access.WRITE_ONLY) + private String email; + + /** + * Get the signing status. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Get the date when status got changed. + * + * @return the statusDate value + */ + public DateTime statusDate() { + return this.statusDate; + } + + /** + * Get the email address of the participant or signer. + * + * @return the email value + */ + public String email() { + return this.email; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PartnerTransfers.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PartnerTransfers.java new file mode 100644 index 000000000000..29b2d586e977 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PartnerTransfers.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.PartnerTransfersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PartnerTransfers. + */ +public interface PartnerTransfers extends HasInner { + /** + * Gets the transfer details for given transfer Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param customerName Customer name. + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String billingAccountName, String billingProfileName, String customerName, String transferName); + + /** + * Cancels the transfer for given transfer Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param customerName Customer name. + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable cancelAsync(String billingAccountName, String billingProfileName, String customerName, String transferName); + + /** + * Initiates the request to transfer the legacy subscriptions or RIs. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param customerName Customer name. + * @param parameters Parameters supplied to initiate the transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable initiateAsync(String billingAccountName, String billingProfileName, String customerName, InitiateTransferRequest parameters); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PartnerTransfersTransfers.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PartnerTransfersTransfers.java new file mode 100644 index 000000000000..6b5fecf66c71 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PartnerTransfersTransfers.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.PartnerTransfersTransfersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PartnerTransfersTransfers. + */ +public interface PartnerTransfersTransfers extends HasInner { + /** + * Lists all transfer's details initiated from given invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param customerName Customer name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String billingAccountName, final String billingProfileName, final String customerName); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PaymentMethod.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PaymentMethod.java new file mode 100644 index 000000000000..b8ec7770f7b2 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PaymentMethod.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.PaymentMethodInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; + +/** + * Type representing PaymentMethod. + */ +public interface PaymentMethod extends HasInner, HasManager { + /** + * @return the currency value. + */ + String currency(); + + /** + * @return the details value. + */ + String details(); + + /** + * @return the expiration value. + */ + String expiration(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the paymentMethodType value. + */ + PaymentMethodType paymentMethodType(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PaymentMethodType.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PaymentMethodType.java new file mode 100644 index 000000000000..c53c3c5cc27b --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PaymentMethodType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PaymentMethodType. + */ +public final class PaymentMethodType extends ExpandableStringEnum { + /** Static value Credits for PaymentMethodType. */ + public static final PaymentMethodType CREDITS = fromString("Credits"); + + /** Static value ChequeWire for PaymentMethodType. */ + public static final PaymentMethodType CHEQUE_WIRE = fromString("ChequeWire"); + + /** + * Creates or finds a PaymentMethodType from its string representation. + * @param name a name to look for + * @return the corresponding PaymentMethodType + */ + @JsonCreator + public static PaymentMethodType fromString(String name) { + return fromString(name, PaymentMethodType.class); + } + + /** + * @return known PaymentMethodType values + */ + public static Collection values() { + return values(PaymentMethodType.class); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PaymentMethods.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PaymentMethods.java new file mode 100644 index 000000000000..6d9083de9d31 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PaymentMethods.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.PaymentMethodsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PaymentMethods. + */ +public interface PaymentMethods extends HasInner { + /** + * Lists the Payment Methods by billing profile Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBillingProfileAsync(final String billingAccountName, final String billingProfileName); + + /** + * Lists the Payment Methods by billing account Id. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBillingAccountAsync(final String billingAccountName); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PaymentProperties.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PaymentProperties.java new file mode 100644 index 000000000000..fbf2a2c6f0e6 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PaymentProperties.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the payment. + */ +public class PaymentProperties { + /** + * The type of payment. + */ + @JsonProperty(value = "paymentType", access = JsonProperty.Access.WRITE_ONLY) + private String paymentType; + + /** + * The paid amount. + */ + @JsonProperty(value = "amount", access = JsonProperty.Access.WRITE_ONLY) + private Amount amount; + + /** + * The date of the payment. + */ + @JsonProperty(value = "date", access = JsonProperty.Access.WRITE_ONLY) + private DateTime dateProperty; + + /** + * Get the type of payment. + * + * @return the paymentType value + */ + public String paymentType() { + return this.paymentType; + } + + /** + * Get the paid amount. + * + * @return the amount value + */ + public Amount amount() { + return this.amount; + } + + /** + * Get the date of the payment. + * + * @return the dateProperty value + */ + public DateTime dateProperty() { + return this.dateProperty; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Policies.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Policies.java new file mode 100644 index 000000000000..bad54b6bcd51 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Policies.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.PolicyInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.PoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Policies. + */ +public interface Policies extends HasInner { + /** + * The policy for a given billing account name and billing profile name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByBillingProfileAsync(String billingAccountName, String billingProfileName); + + /** + * The operation to update a policy. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Parameters supplied to the update policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable updateAsync(String billingAccountName, String billingProfileName, PolicyInner parameters); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Policy.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Policy.java new file mode 100644 index 000000000000..3b7618628c63 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Policy.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.PolicyInner; + +/** + * Type representing Policy. + */ +public interface Policy extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the marketplacePurchases value. + */ + MarketplacePurchasesPolicy marketplacePurchases(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the reservationPurchases value. + */ + ReservationPurchasesPolicy reservationPurchases(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the viewCharges value. + */ + ViewChargesPolicy viewCharges(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PriceSheetDownloadByBillingProfileHeaders.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PriceSheetDownloadByBillingProfileHeaders.java new file mode 100644 index 000000000000..cf34904babf7 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PriceSheetDownloadByBillingProfileHeaders.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for DownloadByBillingProfile operation. + */ +public class PriceSheetDownloadByBillingProfileHeaders { + /** + * GET this URL to retrieve the status of the asynchronous operation. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * The amount of delay to use while the status of the operation is checked. + * The value is expressed in seconds. + */ + @JsonProperty(value = "Retry-After") + private String retryAfter; + + /** + * The operation entity Id GUID. + */ + @JsonProperty(value = "OData-EntityId") + private String oDataEntityId; + + /** + * Get gET this URL to retrieve the status of the asynchronous operation. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set gET this URL to retrieve the status of the asynchronous operation. + * + * @param location the location value to set + * @return the PriceSheetDownloadByBillingProfileHeaders object itself. + */ + public PriceSheetDownloadByBillingProfileHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the amount of delay to use while the status of the operation is checked. The value is expressed in seconds. + * + * @return the retryAfter value + */ + public String retryAfter() { + return this.retryAfter; + } + + /** + * Set the amount of delay to use while the status of the operation is checked. The value is expressed in seconds. + * + * @param retryAfter the retryAfter value to set + * @return the PriceSheetDownloadByBillingProfileHeaders object itself. + */ + public PriceSheetDownloadByBillingProfileHeaders withRetryAfter(String retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the operation entity Id GUID. + * + * @return the oDataEntityId value + */ + public String oDataEntityId() { + return this.oDataEntityId; + } + + /** + * Set the operation entity Id GUID. + * + * @param oDataEntityId the oDataEntityId value to set + * @return the PriceSheetDownloadByBillingProfileHeaders object itself. + */ + public PriceSheetDownloadByBillingProfileHeaders withODataEntityId(String oDataEntityId) { + this.oDataEntityId = oDataEntityId; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PriceSheetDownloadHeaders.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PriceSheetDownloadHeaders.java new file mode 100644 index 000000000000..760a2c76f018 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PriceSheetDownloadHeaders.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Download operation. + */ +public class PriceSheetDownloadHeaders { + /** + * GET this URL to retrieve the status of the asynchronous operation. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * The amount of delay to use while the status of the operation is checked. + * The value is expressed in seconds. + */ + @JsonProperty(value = "Retry-After") + private String retryAfter; + + /** + * The operation entity Id GUID. + */ + @JsonProperty(value = "OData-EntityId") + private String oDataEntityId; + + /** + * Get gET this URL to retrieve the status of the asynchronous operation. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set gET this URL to retrieve the status of the asynchronous operation. + * + * @param location the location value to set + * @return the PriceSheetDownloadHeaders object itself. + */ + public PriceSheetDownloadHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the amount of delay to use while the status of the operation is checked. The value is expressed in seconds. + * + * @return the retryAfter value + */ + public String retryAfter() { + return this.retryAfter; + } + + /** + * Set the amount of delay to use while the status of the operation is checked. The value is expressed in seconds. + * + * @param retryAfter the retryAfter value to set + * @return the PriceSheetDownloadHeaders object itself. + */ + public PriceSheetDownloadHeaders withRetryAfter(String retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the operation entity Id GUID. + * + * @return the oDataEntityId value + */ + public String oDataEntityId() { + return this.oDataEntityId; + } + + /** + * Set the operation entity Id GUID. + * + * @param oDataEntityId the oDataEntityId value to set + * @return the PriceSheetDownloadHeaders object itself. + */ + public PriceSheetDownloadHeaders withODataEntityId(String oDataEntityId) { + this.oDataEntityId = oDataEntityId; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PriceSheets.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PriceSheets.java new file mode 100644 index 000000000000..34b3aa54096a --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/PriceSheets.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Observable; + +/** + * Type representing PriceSheets. + */ +public interface PriceSheets { + /** + * Download price sheet for an invoice. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable downloadAsync(String billingAccountName, String billingProfileName, String invoiceName); + + /** + * Download price sheet for a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable downloadByBillingProfileAsync(String billingAccountName, String billingProfileName); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Product.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Product.java new file mode 100644 index 000000000000..538dab842d18 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Product.java @@ -0,0 +1,143 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.ProductInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import org.joda.time.DateTime; + +/** + * Type representing Product. + */ +public interface Product extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the availabilityId value. + */ + String availabilityId(); + + /** + * @return the billingFrequency value. + */ + BillingFrequency billingFrequency(); + + /** + * @return the billingProfileDisplayName value. + */ + String billingProfileDisplayName(); + + /** + * @return the billingProfileId value. + */ + String billingProfileId(); + + /** + * @return the customerDisplayName value. + */ + String customerDisplayName(); + + /** + * @return the customerId value. + */ + String customerId(); + + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the endDate value. + */ + DateTime endDate(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the invoiceSectionDisplayName value. + */ + String invoiceSectionDisplayName(); + + /** + * @return the invoiceSectionId value. + */ + String invoiceSectionId(); + + /** + * @return the lastCharge value. + */ + Amount lastCharge(); + + /** + * @return the lastChargeDate value. + */ + DateTime lastChargeDate(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the parentProductId value. + */ + String parentProductId(); + + /** + * @return the productType value. + */ + String productType(); + + /** + * @return the productTypeId value. + */ + String productTypeId(); + + /** + * @return the purchaseDate value. + */ + DateTime purchaseDate(); + + /** + * @return the quantity value. + */ + Double quantity(); + + /** + * @return the reseller value. + */ + Reseller reseller(); + + /** + * @return the skuDescription value. + */ + String skuDescription(); + + /** + * @return the skuId value. + */ + String skuId(); + + /** + * @return the status value. + */ + ProductStatusType status(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ProductDetails.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ProductDetails.java new file mode 100644 index 000000000000..8482f939e815 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ProductDetails.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of the product to be transferred. + */ +public class ProductDetails { + /** + * Type of the product to be transferred. Possible values include: + * 'AzureSubscription', 'AzureReservation'. + */ + @JsonProperty(value = "productType") + private ProductType productType; + + /** + * Id of product to be transferred. + */ + @JsonProperty(value = "productId") + private String productId; + + /** + * Get type of the product to be transferred. Possible values include: 'AzureSubscription', 'AzureReservation'. + * + * @return the productType value + */ + public ProductType productType() { + return this.productType; + } + + /** + * Set type of the product to be transferred. Possible values include: 'AzureSubscription', 'AzureReservation'. + * + * @param productType the productType value to set + * @return the ProductDetails object itself. + */ + public ProductDetails withProductType(ProductType productType) { + this.productType = productType; + return this; + } + + /** + * Get id of product to be transferred. + * + * @return the productId value + */ + public String productId() { + return this.productId; + } + + /** + * Set id of product to be transferred. + * + * @param productId the productId value to set + * @return the ProductDetails object itself. + */ + public ProductDetails withProductId(String productId) { + this.productId = productId; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ProductStatusType.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ProductStatusType.java new file mode 100644 index 000000000000..54885b626b53 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ProductStatusType.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProductStatusType. + */ +public final class ProductStatusType extends ExpandableStringEnum { + /** Static value Active for ProductStatusType. */ + public static final ProductStatusType ACTIVE = fromString("Active"); + + /** Static value Inactive for ProductStatusType. */ + public static final ProductStatusType INACTIVE = fromString("Inactive"); + + /** Static value PastDue for ProductStatusType. */ + public static final ProductStatusType PAST_DUE = fromString("PastDue"); + + /** Static value Expiring for ProductStatusType. */ + public static final ProductStatusType EXPIRING = fromString("Expiring"); + + /** Static value Expired for ProductStatusType. */ + public static final ProductStatusType EXPIRED = fromString("Expired"); + + /** Static value Disabled for ProductStatusType. */ + public static final ProductStatusType DISABLED = fromString("Disabled"); + + /** Static value Cancelled for ProductStatusType. */ + public static final ProductStatusType CANCELLED = fromString("Cancelled"); + + /** Static value AutoRenew for ProductStatusType. */ + public static final ProductStatusType AUTO_RENEW = fromString("AutoRenew"); + + /** + * Creates or finds a ProductStatusType from its string representation. + * @param name a name to look for + * @return the corresponding ProductStatusType + */ + @JsonCreator + public static ProductStatusType fromString(String name) { + return fromString(name, ProductStatusType.class); + } + + /** + * @return known ProductStatusType values + */ + public static Collection values() { + return values(ProductStatusType.class); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ProductTransferStatus.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ProductTransferStatus.java new file mode 100644 index 000000000000..f5c328e1c819 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ProductTransferStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProductTransferStatus. + */ +public final class ProductTransferStatus extends ExpandableStringEnum { + /** Static value NotStarted for ProductTransferStatus. */ + public static final ProductTransferStatus NOT_STARTED = fromString("NotStarted"); + + /** Static value InProgress for ProductTransferStatus. */ + public static final ProductTransferStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Completed for ProductTransferStatus. */ + public static final ProductTransferStatus COMPLETED = fromString("Completed"); + + /** Static value Failed for ProductTransferStatus. */ + public static final ProductTransferStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a ProductTransferStatus from its string representation. + * @param name a name to look for + * @return the corresponding ProductTransferStatus + */ + @JsonCreator + public static ProductTransferStatus fromString(String name) { + return fromString(name, ProductTransferStatus.class); + } + + /** + * @return known ProductTransferStatus values + */ + public static Collection values() { + return values(ProductTransferStatus.class); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ProductTransferValidationErrorCode.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ProductTransferValidationErrorCode.java new file mode 100644 index 000000000000..2f1536a3827c --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ProductTransferValidationErrorCode.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProductTransferValidationErrorCode. + */ +public final class ProductTransferValidationErrorCode extends ExpandableStringEnum { + /** Static value InvalidSource for ProductTransferValidationErrorCode. */ + public static final ProductTransferValidationErrorCode INVALID_SOURCE = fromString("InvalidSource"); + + /** Static value ProductNotActive for ProductTransferValidationErrorCode. */ + public static final ProductTransferValidationErrorCode PRODUCT_NOT_ACTIVE = fromString("ProductNotActive"); + + /** Static value InsufficientPermissionOnSource for ProductTransferValidationErrorCode. */ + public static final ProductTransferValidationErrorCode INSUFFICIENT_PERMISSION_ON_SOURCE = fromString("InsufficientPermissionOnSource"); + + /** Static value InsufficientPermissionOnDestination for ProductTransferValidationErrorCode. */ + public static final ProductTransferValidationErrorCode INSUFFICIENT_PERMISSION_ON_DESTINATION = fromString("InsufficientPermissionOnDestination"); + + /** Static value DestinationBillingProfilePastDue for ProductTransferValidationErrorCode. */ + public static final ProductTransferValidationErrorCode DESTINATION_BILLING_PROFILE_PAST_DUE = fromString("DestinationBillingProfilePastDue"); + + /** Static value ProductTypeNotSupported for ProductTransferValidationErrorCode. */ + public static final ProductTransferValidationErrorCode PRODUCT_TYPE_NOT_SUPPORTED = fromString("ProductTypeNotSupported"); + + /** Static value CrossBillingAccountNotAllowed for ProductTransferValidationErrorCode. */ + public static final ProductTransferValidationErrorCode CROSS_BILLING_ACCOUNT_NOT_ALLOWED = fromString("CrossBillingAccountNotAllowed"); + + /** Static value NotAvailableForDestinationMarket for ProductTransferValidationErrorCode. */ + public static final ProductTransferValidationErrorCode NOT_AVAILABLE_FOR_DESTINATION_MARKET = fromString("NotAvailableForDestinationMarket"); + + /** Static value OneTimePurchaseProductTransferNotAllowed for ProductTransferValidationErrorCode. */ + public static final ProductTransferValidationErrorCode ONE_TIME_PURCHASE_PRODUCT_TRANSFER_NOT_ALLOWED = fromString("OneTimePurchaseProductTransferNotAllowed"); + + /** + * Creates or finds a ProductTransferValidationErrorCode from its string representation. + * @param name a name to look for + * @return the corresponding ProductTransferValidationErrorCode + */ + @JsonCreator + public static ProductTransferValidationErrorCode fromString(String name) { + return fromString(name, ProductTransferValidationErrorCode.class); + } + + /** + * @return known ProductTransferValidationErrorCode values + */ + public static Collection values() { + return values(ProductTransferValidationErrorCode.class); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ProductType.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ProductType.java new file mode 100644 index 000000000000..c9e316045234 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ProductType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProductType. + */ +public final class ProductType extends ExpandableStringEnum { + /** Static value AzureSubscription for ProductType. */ + public static final ProductType AZURE_SUBSCRIPTION = fromString("AzureSubscription"); + + /** Static value AzureReservation for ProductType. */ + public static final ProductType AZURE_RESERVATION = fromString("AzureReservation"); + + /** + * Creates or finds a ProductType from its string representation. + * @param name a name to look for + * @return the corresponding ProductType + */ + @JsonCreator + public static ProductType fromString(String name) { + return fromString(name, ProductType.class); + } + + /** + * @return known ProductType values + */ + public static Collection values() { + return values(ProductType.class); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Products.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Products.java new file mode 100644 index 000000000000..9217aef097ea --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Products.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.ProductsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Products. + */ +public interface Products extends HasInner { + /** + * Lists products by customer id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByCustomerAsync(String billingAccountName, String customerName); + + /** + * Lists products by billing account name. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBillingAccountAsync(final String billingAccountName); + + /** + * Lists products by invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName); + + /** + * Get a single product by name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName); + + /** + * The operation to transfer a Product to another invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @param parameters Parameters supplied to the Transfer Product operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable transferAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName, TransferProductRequestProperties parameters); + + /** + * Validates the transfer of products across invoice sections. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @param parameters Parameters supplied to the Transfer Products operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable validateTransferAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName, TransferProductRequestProperties parameters); + + /** + * Cancel auto renew for product by product id and invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable updateAutoRenewByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName); + + /** + * Get a customer's product by name. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param productName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByCustomerAsync(String billingAccountName, String customerName, String productName); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ProductsListResult.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ProductsListResult.java new file mode 100644 index 000000000000..797b36f06b59 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ProductsListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.ProductsListResultInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.ProductInner; +import java.util.List; + +/** + * Type representing ProductsListResult. + */ +public interface ProductsListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ProductsTransferHeaders.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ProductsTransferHeaders.java new file mode 100644 index 000000000000..87cc687e7302 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ProductsTransferHeaders.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Transfer operation. + */ +public class ProductsTransferHeaders { + /** + * Location URI to poll for result. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Recommends the retryable time after receiving this. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get location URI to poll for result. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set location URI to poll for result. + * + * @param location the location value to set + * @return the ProductsTransferHeaders object itself. + */ + public ProductsTransferHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get recommends the retryable time after receiving this. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set recommends the retryable time after receiving this. + * + * @param retryAfter the retryAfter value to set + * @return the ProductsTransferHeaders object itself. + */ + public ProductsTransferHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/RecipientTransferDetails.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/RecipientTransferDetails.java new file mode 100644 index 000000000000..d79fe28a86df --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/RecipientTransferDetails.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.RecipientTransferDetailsInner; +import java.util.List; +import org.joda.time.DateTime; + +/** + * Type representing RecipientTransferDetails. + */ +public interface RecipientTransferDetails extends HasInner, HasManager { + /** + * @return the allowedProductType value. + */ + List allowedProductType(); + + /** + * @return the canceledBy value. + */ + String canceledBy(); + + /** + * @return the creationTime value. + */ + DateTime creationTime(); + + /** + * @return the detailedTransferStatus value. + */ + List detailedTransferStatus(); + + /** + * @return the expirationTime value. + */ + DateTime expirationTime(); + + /** + * @return the initiatorCustomerType value. + */ + String initiatorCustomerType(); + + /** + * @return the initiatorEmailId value. + */ + String initiatorEmailId(); + + /** + * @return the lastModifiedTime value. + */ + DateTime lastModifiedTime(); + + /** + * @return the recipientEmailId value. + */ + String recipientEmailId(); + + /** + * @return the resellerId value. + */ + String resellerId(); + + /** + * @return the resellerName value. + */ + String resellerName(); + + /** + * @return the transferStatus value. + */ + TransferStatus transferStatus(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/RecipientTransfers.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/RecipientTransfers.java new file mode 100644 index 000000000000..ee71b2f440cc --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/RecipientTransfers.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.RecipientTransfersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RecipientTransfers. + */ +public interface RecipientTransfers extends HasInner { + /** + * Accepts the transfer with given transfer Id. + * + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable acceptAsync(String transferName); + + /** + * Validates if the products can be transferred in the context of the given transfer name. + * + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable validateAsync(String transferName); + + /** + * Declines the transfer with given transfer Id. + * + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable declineAsync(String transferName); + + /** + * Gets the transfer with given transfer Id. + * + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String transferName); + + /** + * Lists the transfers received by caller. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Reseller.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Reseller.java new file mode 100644 index 000000000000..50b648e1677b --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Reseller.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details about a reseller. + */ +public class Reseller { + /** + * The reseller id. + */ + @JsonProperty(value = "resellerId", access = JsonProperty.Access.WRITE_ONLY) + private String resellerId; + + /** + * A description of the reseller. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the reseller id. + * + * @return the resellerId value + */ + public String resellerId() { + return this.resellerId; + } + + /** + * Get a description of the reseller. + * + * @return the description value + */ + public String description() { + return this.description; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ReservationPurchasesPolicy.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ReservationPurchasesPolicy.java new file mode 100644 index 000000000000..4aee74b5e897 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ReservationPurchasesPolicy.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ReservationPurchasesPolicy. + */ +public final class ReservationPurchasesPolicy extends ExpandableStringEnum { + /** Static value Allowed for ReservationPurchasesPolicy. */ + public static final ReservationPurchasesPolicy ALLOWED = fromString("Allowed"); + + /** Static value NotAllowed for ReservationPurchasesPolicy. */ + public static final ReservationPurchasesPolicy NOT_ALLOWED = fromString("NotAllowed"); + + /** + * Creates or finds a ReservationPurchasesPolicy from its string representation. + * @param name a name to look for + * @return the corresponding ReservationPurchasesPolicy + */ + @JsonCreator + public static ReservationPurchasesPolicy fromString(String name) { + return fromString(name, ReservationPurchasesPolicy.class); + } + + /** + * @return known ReservationPurchasesPolicy values + */ + public static Collection values() { + return values(ReservationPurchasesPolicy.class); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ReservationType.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ReservationType.java new file mode 100644 index 000000000000..d11573e9b521 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ReservationType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ReservationType. + */ +public final class ReservationType extends ExpandableStringEnum { + /** Static value Purchase for ReservationType. */ + public static final ReservationType PURCHASE = fromString("Purchase"); + + /** Static value Usage Charge for ReservationType. */ + public static final ReservationType USAGE_CHARGE = fromString("Usage Charge"); + + /** + * Creates or finds a ReservationType from its string representation. + * @param name a name to look for + * @return the corresponding ReservationType + */ + @JsonCreator + public static ReservationType fromString(String name) { + return fromString(name, ReservationType.class); + } + + /** + * @return known ReservationType values + */ + public static Collection values() { + return values(ReservationType.class); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Status.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Status.java new file mode 100644 index 000000000000..6459264ffcd7 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Status.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Status. + */ +public final class Status extends ExpandableStringEnum { + /** Static value Approved for Status. */ + public static final Status APPROVED = fromString("Approved"); + + /** Static value Rejected for Status. */ + public static final Status REJECTED = fromString("Rejected"); + + /** + * Creates or finds a Status from its string representation. + * @param name a name to look for + * @return the corresponding Status + */ + @JsonCreator + public static Status fromString(String name) { + return fromString(name, Status.class); + } + + /** + * @return known Status values + */ + public static Collection values() { + return values(Status.class); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/SubscriptionTransferValidationErrorCode.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/SubscriptionTransferValidationErrorCode.java new file mode 100644 index 000000000000..ce9312cd4a7d --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/SubscriptionTransferValidationErrorCode.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SubscriptionTransferValidationErrorCode. + */ +public final class SubscriptionTransferValidationErrorCode extends ExpandableStringEnum { + /** Static value InvalidSource for SubscriptionTransferValidationErrorCode. */ + public static final SubscriptionTransferValidationErrorCode INVALID_SOURCE = fromString("InvalidSource"); + + /** Static value SubscriptionNotActive for SubscriptionTransferValidationErrorCode. */ + public static final SubscriptionTransferValidationErrorCode SUBSCRIPTION_NOT_ACTIVE = fromString("SubscriptionNotActive"); + + /** Static value InsufficientPermissionOnSource for SubscriptionTransferValidationErrorCode. */ + public static final SubscriptionTransferValidationErrorCode INSUFFICIENT_PERMISSION_ON_SOURCE = fromString("InsufficientPermissionOnSource"); + + /** Static value InsufficientPermissionOnDestination for SubscriptionTransferValidationErrorCode. */ + public static final SubscriptionTransferValidationErrorCode INSUFFICIENT_PERMISSION_ON_DESTINATION = fromString("InsufficientPermissionOnDestination"); + + /** Static value DestinationBillingProfilePastDue for SubscriptionTransferValidationErrorCode. */ + public static final SubscriptionTransferValidationErrorCode DESTINATION_BILLING_PROFILE_PAST_DUE = fromString("DestinationBillingProfilePastDue"); + + /** Static value SubscriptionTypeNotSupported for SubscriptionTransferValidationErrorCode. */ + public static final SubscriptionTransferValidationErrorCode SUBSCRIPTION_TYPE_NOT_SUPPORTED = fromString("SubscriptionTypeNotSupported"); + + /** Static value CrossBillingAccountNotAllowed for SubscriptionTransferValidationErrorCode. */ + public static final SubscriptionTransferValidationErrorCode CROSS_BILLING_ACCOUNT_NOT_ALLOWED = fromString("CrossBillingAccountNotAllowed"); + + /** Static value NotAvailableForDestinationMarket for SubscriptionTransferValidationErrorCode. */ + public static final SubscriptionTransferValidationErrorCode NOT_AVAILABLE_FOR_DESTINATION_MARKET = fromString("NotAvailableForDestinationMarket"); + + /** + * Creates or finds a SubscriptionTransferValidationErrorCode from its string representation. + * @param name a name to look for + * @return the corresponding SubscriptionTransferValidationErrorCode + */ + @JsonCreator + public static SubscriptionTransferValidationErrorCode fromString(String name) { + return fromString(name, SubscriptionTransferValidationErrorCode.class); + } + + /** + * @return known SubscriptionTransferValidationErrorCode values + */ + public static Collection values() { + return values(SubscriptionTransferValidationErrorCode.class); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Transaction.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Transaction.java new file mode 100644 index 000000000000..7df460c4bd4f --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Transaction.java @@ -0,0 +1,136 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.TransactionInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import org.joda.time.DateTime; + +/** + * Type representing Transaction. + */ +public interface Transaction extends HasInner, HasManager { + /** + * @return the billingProfileDisplayName value. + */ + String billingProfileDisplayName(); + + /** + * @return the billingProfileId value. + */ + String billingProfileId(); + + /** + * @return the customerDisplayName value. + */ + String customerDisplayName(); + + /** + * @return the customerId value. + */ + String customerId(); + + /** + * @return the dateProperty value. + */ + DateTime dateProperty(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the invoice value. + */ + String invoice(); + + /** + * @return the invoiceSectionDisplayName value. + */ + String invoiceSectionDisplayName(); + + /** + * @return the invoiceSectionId value. + */ + String invoiceSectionId(); + + /** + * @return the kind value. + */ + TransactionTypeKind kind(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the orderId value. + */ + String orderId(); + + /** + * @return the orderName value. + */ + String orderName(); + + /** + * @return the productDescription value. + */ + String productDescription(); + + /** + * @return the productFamily value. + */ + String productFamily(); + + /** + * @return the productType value. + */ + String productType(); + + /** + * @return the productTypeId value. + */ + String productTypeId(); + + /** + * @return the quantity value. + */ + Integer quantity(); + + /** + * @return the subscriptionId value. + */ + String subscriptionId(); + + /** + * @return the subscriptionName value. + */ + String subscriptionName(); + + /** + * @return the transactionAmount value. + */ + Amount transactionAmount(); + + /** + * @return the transactionType value. + */ + ReservationType transactionType(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/TransactionListResult.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/TransactionListResult.java new file mode 100644 index 000000000000..2b5233584e28 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/TransactionListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.TransactionListResultInner; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.TransactionInner; +import java.util.List; + +/** + * Type representing TransactionListResult. + */ +public interface TransactionListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/TransactionTypeKind.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/TransactionTypeKind.java new file mode 100644 index 000000000000..d5fd2688e45c --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/TransactionTypeKind.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TransactionTypeKind. + */ +public final class TransactionTypeKind extends ExpandableStringEnum { + /** Static value all for TransactionTypeKind. */ + public static final TransactionTypeKind ALL = fromString("all"); + + /** Static value reservation for TransactionTypeKind. */ + public static final TransactionTypeKind RESERVATION = fromString("reservation"); + + /** + * Creates or finds a TransactionTypeKind from its string representation. + * @param name a name to look for + * @return the corresponding TransactionTypeKind + */ + @JsonCreator + public static TransactionTypeKind fromString(String name) { + return fromString(name, TransactionTypeKind.class); + } + + /** + * @return known TransactionTypeKind values + */ + public static Collection values() { + return values(TransactionTypeKind.class); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Transactions.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Transactions.java new file mode 100644 index 000000000000..583a7fc3fb13 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Transactions.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.TransactionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Transactions. + */ +public interface Transactions extends HasInner { + /** + * Lists the transactions by billing account name for given start and end date. + * + * @param billingAccountName billing Account Id. + * @param startDate Start date + * @param endDate End date + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBillingAccountAsync(final String billingAccountName, final String startDate, final String endDate); + + /** + * Lists the transactions by billing profile name for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param startDate Start date + * @param endDate End date + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBillingProfileAsync(String billingAccountName, String billingProfileName, String startDate, String endDate); + + /** + * Lists the transactions by invoice section name for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param startDate Start date + * @param endDate End date + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String startDate, String endDate); + + /** + * Get the transaction. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param transactionName Transaction name. + * @param startDate Start date + * @param endDate End date + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String billingAccountName, String billingProfileName, String transactionName, String startDate, String endDate); + + /** + * Lists the transactions by customer id for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param startDate Start date + * @param endDate End date + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByCustomerAsync(final String billingAccountName, final String customerName, final String startDate, final String endDate); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/TransferBillingSubscriptionRequest.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/TransferBillingSubscriptionRequest.java new file mode 100644 index 000000000000..17dcc5b50cd1 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/TransferBillingSubscriptionRequest.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Request parameters to transfer billing subscription. + */ +@JsonFlatten +public class TransferBillingSubscriptionRequest { + /** + * The destination invoice section id. + */ + @JsonProperty(value = "properties.destinationInvoiceSectionId") + private String destinationInvoiceSectionId; + + /** + * The destination billing profile id. + */ + @JsonProperty(value = "properties.destinationBillingProfileId") + private String destinationBillingProfileId; + + /** + * Get the destination invoice section id. + * + * @return the destinationInvoiceSectionId value + */ + public String destinationInvoiceSectionId() { + return this.destinationInvoiceSectionId; + } + + /** + * Set the destination invoice section id. + * + * @param destinationInvoiceSectionId the destinationInvoiceSectionId value to set + * @return the TransferBillingSubscriptionRequest object itself. + */ + public TransferBillingSubscriptionRequest withDestinationInvoiceSectionId(String destinationInvoiceSectionId) { + this.destinationInvoiceSectionId = destinationInvoiceSectionId; + return this; + } + + /** + * Get the destination billing profile id. + * + * @return the destinationBillingProfileId value + */ + public String destinationBillingProfileId() { + return this.destinationBillingProfileId; + } + + /** + * Set the destination billing profile id. + * + * @param destinationBillingProfileId the destinationBillingProfileId value to set + * @return the TransferBillingSubscriptionRequest object itself. + */ + public TransferBillingSubscriptionRequest withDestinationBillingProfileId(String destinationBillingProfileId) { + this.destinationBillingProfileId = destinationBillingProfileId; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/TransferBillingSubscriptionRequestProperties.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/TransferBillingSubscriptionRequestProperties.java new file mode 100644 index 000000000000..3f7b1c31262c --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/TransferBillingSubscriptionRequestProperties.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Request parameters to transfer billing subscription. + */ +public class TransferBillingSubscriptionRequestProperties { + /** + * The destination invoice section id. + */ + @JsonProperty(value = "destinationInvoiceSectionId") + private String destinationInvoiceSectionId; + + /** + * The destination billing profile id. + */ + @JsonProperty(value = "destinationBillingProfileId") + private String destinationBillingProfileId; + + /** + * Get the destination invoice section id. + * + * @return the destinationInvoiceSectionId value + */ + public String destinationInvoiceSectionId() { + return this.destinationInvoiceSectionId; + } + + /** + * Set the destination invoice section id. + * + * @param destinationInvoiceSectionId the destinationInvoiceSectionId value to set + * @return the TransferBillingSubscriptionRequestProperties object itself. + */ + public TransferBillingSubscriptionRequestProperties withDestinationInvoiceSectionId(String destinationInvoiceSectionId) { + this.destinationInvoiceSectionId = destinationInvoiceSectionId; + return this; + } + + /** + * Get the destination billing profile id. + * + * @return the destinationBillingProfileId value + */ + public String destinationBillingProfileId() { + return this.destinationBillingProfileId; + } + + /** + * Set the destination billing profile id. + * + * @param destinationBillingProfileId the destinationBillingProfileId value to set + * @return the TransferBillingSubscriptionRequestProperties object itself. + */ + public TransferBillingSubscriptionRequestProperties withDestinationBillingProfileId(String destinationBillingProfileId) { + this.destinationBillingProfileId = destinationBillingProfileId; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/TransferBillingSubscriptionResult.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/TransferBillingSubscriptionResult.java new file mode 100644 index 000000000000..ef94a0abf85a --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/TransferBillingSubscriptionResult.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.TransferBillingSubscriptionResultInner; + +/** + * Type representing TransferBillingSubscriptionResult. + */ +public interface TransferBillingSubscriptionResult extends HasInner, HasManager { + /** + * @return the billingSubscriptionName value. + */ + String billingSubscriptionName(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/TransferProductRequestProperties.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/TransferProductRequestProperties.java new file mode 100644 index 000000000000..9441fb372699 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/TransferProductRequestProperties.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the product to initiate a transfer. + */ +public class TransferProductRequestProperties { + /** + * The destination invoice section id. + */ + @JsonProperty(value = "destinationInvoiceSectionId") + private String destinationInvoiceSectionId; + + /** + * The destination billing profile id. + */ + @JsonProperty(value = "destinationBillingProfileId") + private String destinationBillingProfileId; + + /** + * Get the destination invoice section id. + * + * @return the destinationInvoiceSectionId value + */ + public String destinationInvoiceSectionId() { + return this.destinationInvoiceSectionId; + } + + /** + * Set the destination invoice section id. + * + * @param destinationInvoiceSectionId the destinationInvoiceSectionId value to set + * @return the TransferProductRequestProperties object itself. + */ + public TransferProductRequestProperties withDestinationInvoiceSectionId(String destinationInvoiceSectionId) { + this.destinationInvoiceSectionId = destinationInvoiceSectionId; + return this; + } + + /** + * Get the destination billing profile id. + * + * @return the destinationBillingProfileId value + */ + public String destinationBillingProfileId() { + return this.destinationBillingProfileId; + } + + /** + * Set the destination billing profile id. + * + * @param destinationBillingProfileId the destinationBillingProfileId value to set + * @return the TransferProductRequestProperties object itself. + */ + public TransferProductRequestProperties withDestinationBillingProfileId(String destinationBillingProfileId) { + this.destinationBillingProfileId = destinationBillingProfileId; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/TransferStatus.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/TransferStatus.java new file mode 100644 index 000000000000..8aa715d1f6f1 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/TransferStatus.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TransferStatus. + */ +public final class TransferStatus extends ExpandableStringEnum { + /** Static value Pending for TransferStatus. */ + public static final TransferStatus PENDING = fromString("Pending"); + + /** Static value InProgress for TransferStatus. */ + public static final TransferStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Completed for TransferStatus. */ + public static final TransferStatus COMPLETED = fromString("Completed"); + + /** Static value CompletedWithErrors for TransferStatus. */ + public static final TransferStatus COMPLETED_WITH_ERRORS = fromString("CompletedWithErrors"); + + /** Static value Failed for TransferStatus. */ + public static final TransferStatus FAILED = fromString("Failed"); + + /** Static value Canceled for TransferStatus. */ + public static final TransferStatus CANCELED = fromString("Canceled"); + + /** Static value Declined for TransferStatus. */ + public static final TransferStatus DECLINED = fromString("Declined"); + + /** + * Creates or finds a TransferStatus from its string representation. + * @param name a name to look for + * @return the corresponding TransferStatus + */ + @JsonCreator + public static TransferStatus fromString(String name) { + return fromString(name, TransferStatus.class); + } + + /** + * @return known TransferStatus values + */ + public static Collection values() { + return values(TransferStatus.class); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Transfers.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Transfers.java new file mode 100644 index 000000000000..e76d25f181cc --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Transfers.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.TransfersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Transfers. + */ +public interface Transfers extends HasInner { + /** + * Gets the transfer details for given transfer Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String transferName); + + /** + * Lists all transfer's details initiated from given invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String billingAccountName, final String billingProfileName, final String invoiceSectionName); + + /** + * Cancels the transfer for given transfer Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable cancelAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String transferName); + + /** + * Initiates the request to transfer the legacy subscriptions or RIs. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param parameters Parameters supplied to initiate the transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable initiateAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, InitiateTransferRequest parameters); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/UpdateAutoRenew.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/UpdateAutoRenew.java new file mode 100644 index 000000000000..9eaabbce32fa --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/UpdateAutoRenew.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for UpdateAutoRenew. + */ +public final class UpdateAutoRenew extends ExpandableStringEnum { + /** Static value true for UpdateAutoRenew. */ + public static final UpdateAutoRenew TRUE = fromString("true"); + + /** Static value false for UpdateAutoRenew. */ + public static final UpdateAutoRenew FALSE = fromString("false"); + + /** + * Creates or finds a UpdateAutoRenew from its string representation. + * @param name a name to look for + * @return the corresponding UpdateAutoRenew + */ + @JsonCreator + public static UpdateAutoRenew fromString(String name) { + return fromString(name, UpdateAutoRenew.class); + } + + /** + * @return known UpdateAutoRenew values + */ + public static Collection values() { + return values(UpdateAutoRenew.class); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/UpdateAutoRenewOperation.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/UpdateAutoRenewOperation.java new file mode 100644 index 000000000000..6c0d46a41523 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/UpdateAutoRenewOperation.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.UpdateAutoRenewOperationInner; +import org.joda.time.DateTime; + +/** + * Type representing UpdateAutoRenewOperation. + */ +public interface UpdateAutoRenewOperation extends HasInner, HasManager { + /** + * @return the endDate value. + */ + DateTime endDate(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/UpdateAutoRenewRequest.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/UpdateAutoRenewRequest.java new file mode 100644 index 000000000000..7a282a2ce117 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/UpdateAutoRenewRequest.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Request parameters to update auto renew for support product. + */ +public class UpdateAutoRenewRequest { + /** + * Request parameters to update auto renew policy a product. Possible + * values include: 'true', 'false'. + */ + @JsonProperty(value = "autoRenew") + private UpdateAutoRenew autoRenew; + + /** + * Get request parameters to update auto renew policy a product. Possible values include: 'true', 'false'. + * + * @return the autoRenew value + */ + public UpdateAutoRenew autoRenew() { + return this.autoRenew; + } + + /** + * Set request parameters to update auto renew policy a product. Possible values include: 'true', 'false'. + * + * @param autoRenew the autoRenew value to set + * @return the UpdateAutoRenewRequest object itself. + */ + public UpdateAutoRenewRequest withAutoRenew(UpdateAutoRenew autoRenew) { + this.autoRenew = autoRenew; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidateAddressResponse.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidateAddressResponse.java new file mode 100644 index 000000000000..715bc1132695 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidateAddressResponse.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.ValidateAddressResponseInner; +import java.util.List; + +/** + * Type representing ValidateAddressResponse. + */ +public interface ValidateAddressResponse extends HasInner, HasManager { + /** + * @return the status value. + */ + AddressValidationStatus status(); + + /** + * @return the suggestedAddresses value. + */ + List suggestedAddresses(); + + /** + * @return the validationMessage value. + */ + String validationMessage(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidateProductTransferEligibilityError.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidateProductTransferEligibilityError.java new file mode 100644 index 000000000000..52c9876abd98 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidateProductTransferEligibilityError.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error details of the product transfer eligibility validation. + */ +public class ValidateProductTransferEligibilityError { + /** + * Error code for the product transfer validation. Possible values include: + * 'InvalidSource', 'ProductNotActive', 'InsufficientPermissionOnSource', + * 'InsufficientPermissionOnDestination', + * 'DestinationBillingProfilePastDue', 'ProductTypeNotSupported', + * 'CrossBillingAccountNotAllowed', 'NotAvailableForDestinationMarket', + * 'OneTimePurchaseProductTransferNotAllowed'. + */ + @JsonProperty(value = "code") + private ProductTransferValidationErrorCode code; + + /** + * The error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Detailed error message explaining the error. + */ + @JsonProperty(value = "details") + private String details; + + /** + * Get error code for the product transfer validation. Possible values include: 'InvalidSource', 'ProductNotActive', 'InsufficientPermissionOnSource', 'InsufficientPermissionOnDestination', 'DestinationBillingProfilePastDue', 'ProductTypeNotSupported', 'CrossBillingAccountNotAllowed', 'NotAvailableForDestinationMarket', 'OneTimePurchaseProductTransferNotAllowed'. + * + * @return the code value + */ + public ProductTransferValidationErrorCode code() { + return this.code; + } + + /** + * Set error code for the product transfer validation. Possible values include: 'InvalidSource', 'ProductNotActive', 'InsufficientPermissionOnSource', 'InsufficientPermissionOnDestination', 'DestinationBillingProfilePastDue', 'ProductTypeNotSupported', 'CrossBillingAccountNotAllowed', 'NotAvailableForDestinationMarket', 'OneTimePurchaseProductTransferNotAllowed'. + * + * @param code the code value to set + * @return the ValidateProductTransferEligibilityError object itself. + */ + public ValidateProductTransferEligibilityError withCode(ProductTransferValidationErrorCode code) { + this.code = code; + return this; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the error message. + * + * @param message the message value to set + * @return the ValidateProductTransferEligibilityError object itself. + */ + public ValidateProductTransferEligibilityError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get detailed error message explaining the error. + * + * @return the details value + */ + public String details() { + return this.details; + } + + /** + * Set detailed error message explaining the error. + * + * @param details the details value to set + * @return the ValidateProductTransferEligibilityError object itself. + */ + public ValidateProductTransferEligibilityError withDetails(String details) { + this.details = details; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidateProductTransferEligibilityResult.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidateProductTransferEligibilityResult.java new file mode 100644 index 000000000000..f80050753633 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidateProductTransferEligibilityResult.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.ValidateProductTransferEligibilityResultInner; + +/** + * Type representing ValidateProductTransferEligibilityResult. + */ +public interface ValidateProductTransferEligibilityResult extends HasInner, HasManager { + /** + * @return the errorDetails value. + */ + ValidateProductTransferEligibilityError errorDetails(); + + /** + * @return the isTransferEligible value. + */ + Boolean isTransferEligible(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidateSubscriptionTransferEligibilityError.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidateSubscriptionTransferEligibilityError.java new file mode 100644 index 000000000000..d4afa107720b --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidateSubscriptionTransferEligibilityError.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error details of the transfer eligibility validation. + */ +public class ValidateSubscriptionTransferEligibilityError { + /** + * Error code for the product transfer validation. Possible values include: + * 'InvalidSource', 'SubscriptionNotActive', + * 'InsufficientPermissionOnSource', 'InsufficientPermissionOnDestination', + * 'DestinationBillingProfilePastDue', 'SubscriptionTypeNotSupported', + * 'CrossBillingAccountNotAllowed', 'NotAvailableForDestinationMarket'. + */ + @JsonProperty(value = "code") + private SubscriptionTransferValidationErrorCode code; + + /** + * The error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Detailed error message explaining the error. + */ + @JsonProperty(value = "details") + private String details; + + /** + * Get error code for the product transfer validation. Possible values include: 'InvalidSource', 'SubscriptionNotActive', 'InsufficientPermissionOnSource', 'InsufficientPermissionOnDestination', 'DestinationBillingProfilePastDue', 'SubscriptionTypeNotSupported', 'CrossBillingAccountNotAllowed', 'NotAvailableForDestinationMarket'. + * + * @return the code value + */ + public SubscriptionTransferValidationErrorCode code() { + return this.code; + } + + /** + * Set error code for the product transfer validation. Possible values include: 'InvalidSource', 'SubscriptionNotActive', 'InsufficientPermissionOnSource', 'InsufficientPermissionOnDestination', 'DestinationBillingProfilePastDue', 'SubscriptionTypeNotSupported', 'CrossBillingAccountNotAllowed', 'NotAvailableForDestinationMarket'. + * + * @param code the code value to set + * @return the ValidateSubscriptionTransferEligibilityError object itself. + */ + public ValidateSubscriptionTransferEligibilityError withCode(SubscriptionTransferValidationErrorCode code) { + this.code = code; + return this; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the error message. + * + * @param message the message value to set + * @return the ValidateSubscriptionTransferEligibilityError object itself. + */ + public ValidateSubscriptionTransferEligibilityError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get detailed error message explaining the error. + * + * @return the details value + */ + public String details() { + return this.details; + } + + /** + * Set detailed error message explaining the error. + * + * @param details the details value to set + * @return the ValidateSubscriptionTransferEligibilityError object itself. + */ + public ValidateSubscriptionTransferEligibilityError withDetails(String details) { + this.details = details; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidateSubscriptionTransferEligibilityResult.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidateSubscriptionTransferEligibilityResult.java new file mode 100644 index 000000000000..2d49ce34e747 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidateSubscriptionTransferEligibilityResult.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.ValidateSubscriptionTransferEligibilityResultInner; + +/** + * Type representing ValidateSubscriptionTransferEligibilityResult. + */ +public interface ValidateSubscriptionTransferEligibilityResult extends HasInner, HasManager { + /** + * @return the errorDetails value. + */ + ValidateSubscriptionTransferEligibilityError errorDetails(); + + /** + * @return the isTransferEligible value. + */ + Boolean isTransferEligible(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidateTransferListResponse.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidateTransferListResponse.java new file mode 100644 index 000000000000..731fa761a89f --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidateTransferListResponse.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager; +import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.ValidateTransferListResponseInner; +import java.util.List; + +/** + * Type representing ValidateTransferListResponse. + */ +public interface ValidateTransferListResponse extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidateTransferResponse.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidateTransferResponse.java new file mode 100644 index 000000000000..69bd43c289f2 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidateTransferResponse.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Transfer validation response. + */ +@JsonFlatten +public class ValidateTransferResponse { + /** + * The status of validation. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * The product id for which this result applies. + */ + @JsonProperty(value = "properties.productId", access = JsonProperty.Access.WRITE_ONLY) + private String productId; + + /** + * Array of validation results. + */ + @JsonProperty(value = "properties.results") + private List results; + + /** + * Get the status of validation. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Get the product id for which this result applies. + * + * @return the productId value + */ + public String productId() { + return this.productId; + } + + /** + * Get array of validation results. + * + * @return the results value + */ + public List results() { + return this.results; + } + + /** + * Set array of validation results. + * + * @param results the results value to set + * @return the ValidateTransferResponse object itself. + */ + public ValidateTransferResponse withResults(List results) { + this.results = results; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidationResultProperties.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidationResultProperties.java new file mode 100644 index 000000000000..9f4a5afbe522 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ValidationResultProperties.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the validation result. + */ +public class ValidationResultProperties { + /** + * Result Level. + */ + @JsonProperty(value = "level", access = JsonProperty.Access.WRITE_ONLY) + private String level; + + /** + * Result Code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * The validation message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get result Level. + * + * @return the level value + */ + public String level() { + return this.level; + } + + /** + * Get result Code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the validation message. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ViewChargesPolicy.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ViewChargesPolicy.java new file mode 100644 index 000000000000..f9d0cf80e823 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/ViewChargesPolicy.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ViewChargesPolicy. + */ +public final class ViewChargesPolicy extends ExpandableStringEnum { + /** Static value None for ViewChargesPolicy. */ + public static final ViewChargesPolicy NONE = fromString("None"); + + /** Static value SubscriptionOwner for ViewChargesPolicy. */ + public static final ViewChargesPolicy SUBSCRIPTION_OWNER = fromString("SubscriptionOwner"); + + /** + * Creates or finds a ViewChargesPolicy from its string representation. + * @param name a name to look for + * @return the corresponding ViewChargesPolicy + */ + @JsonCreator + public static ViewChargesPolicy fromString(String name) { + return fromString(name, ViewChargesPolicy.class); + } + + /** + * @return known ViewChargesPolicy values + */ + public static Collection values() { + return values(ViewChargesPolicy.class); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AddressImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AddressImpl.java new file mode 100644 index 000000000000..ca009c82a48b --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AddressImpl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Address; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ValidateAddressResponse; +import com.microsoft.azure.management.billing.v2019_10_01_preview.AddressDetails; + +class AddressImpl extends WrapperImpl implements Address { + private final BillingManager manager; + + AddressImpl(BillingManager manager) { + super(manager.inner().address()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + @Override + public Observable validateAsync(AddressDetails address) { + AddressInner client = this.inner(); + return client.validateAsync(address) + .map(new Func1() { + @Override + public ValidateAddressResponse call(ValidateAddressResponseInner inner) { + return new ValidateAddressResponseImpl(inner, manager()); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AddressInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AddressInner.java new file mode 100644 index 000000000000..d133037c05ce --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AddressInner.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.billing.v2019_10_01_preview.AddressDetails; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Address. + */ +public class AddressInner { + /** The Retrofit service to perform REST calls. */ + private AddressService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of AddressInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AddressInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(AddressService.class); + this.client = client; + } + + /** + * The interface defining all the services for Address to be + * used by Retrofit to perform actually REST calls. + */ + interface AddressService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Address validate" }) + @POST("providers/Microsoft.Billing/validateAddress") + Observable> validate(@Query("api-version") String apiVersion, @Body AddressDetails address, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Validates the address. + * + * @param address the AddressDetails value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ValidateAddressResponseInner object if successful. + */ + public ValidateAddressResponseInner validate(AddressDetails address) { + return validateWithServiceResponseAsync(address).toBlocking().single().body(); + } + + /** + * Validates the address. + * + * @param address the AddressDetails value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture validateAsync(AddressDetails address, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(validateWithServiceResponseAsync(address), serviceCallback); + } + + /** + * Validates the address. + * + * @param address the AddressDetails value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ValidateAddressResponseInner object + */ + public Observable validateAsync(AddressDetails address) { + return validateWithServiceResponseAsync(address).map(new Func1, ValidateAddressResponseInner>() { + @Override + public ValidateAddressResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Validates the address. + * + * @param address the AddressDetails value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ValidateAddressResponseInner object + */ + public Observable> validateWithServiceResponseAsync(AddressDetails address) { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (address == null) { + throw new IllegalArgumentException("Parameter address is required and cannot be null."); + } + Validator.validate(address); + return service.validate(this.client.apiVersion(), address, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = validateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse validateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AgreementImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AgreementImpl.java new file mode 100644 index 000000000000..482eea0fa6ca --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AgreementImpl.java @@ -0,0 +1,84 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.Agreement; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Participants; + +class AgreementImpl extends IndexableRefreshableWrapperImpl implements Agreement { + private final BillingManager manager; + private String billingAccountName; + private String agreementName; + + AgreementImpl(AgreementInner inner, BillingManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.billingAccountName = IdParsingUtils.getValueFromIdByName(inner.id(), "billingAccounts"); + this.agreementName = IdParsingUtils.getValueFromIdByName(inner.id(), "agreements"); + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + AgreementsInner client = this.manager().inner().agreements(); + return client.getAsync(this.billingAccountName, this.agreementName); + } + + + + @Override + public String agreementLink() { + return this.inner().agreementLink(); + } + + @Override + public DateTime effectiveDate() { + return this.inner().effectiveDate(); + } + + @Override + public DateTime expirationDate() { + return this.inner().expirationDate(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List participants() { + return this.inner().participants(); + } + + @Override + public String status() { + return this.inner().status(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AgreementInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AgreementInner.java new file mode 100644 index 000000000000..71f1c1997580 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AgreementInner.java @@ -0,0 +1,109 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Participants; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * An agreement resource. + */ +@JsonFlatten +public class AgreementInner extends ProxyResource { + /** + * The link to the agreement. + */ + @JsonProperty(value = "properties.agreementLink", access = JsonProperty.Access.WRITE_ONLY) + private String agreementLink; + + /** + * Effective date. + */ + @JsonProperty(value = "properties.effectiveDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime effectiveDate; + + /** + * Expiration date. + */ + @JsonProperty(value = "properties.expirationDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime expirationDate; + + /** + * Participants or signer of the agreement. + */ + @JsonProperty(value = "properties.participants") + private List participants; + + /** + * The agreement status. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * Get the link to the agreement. + * + * @return the agreementLink value + */ + public String agreementLink() { + return this.agreementLink; + } + + /** + * Get effective date. + * + * @return the effectiveDate value + */ + public DateTime effectiveDate() { + return this.effectiveDate; + } + + /** + * Get expiration date. + * + * @return the expirationDate value + */ + public DateTime expirationDate() { + return this.expirationDate; + } + + /** + * Get participants or signer of the agreement. + * + * @return the participants value + */ + public List participants() { + return this.participants; + } + + /** + * Set participants or signer of the agreement. + * + * @param participants the participants value to set + * @return the AgreementInner object itself. + */ + public AgreementInner withParticipants(List participants) { + this.participants = participants; + return this; + } + + /** + * Get the agreement status. + * + * @return the status value + */ + public String status() { + return this.status; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AgreementListResultImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AgreementListResultImpl.java new file mode 100644 index 000000000000..e01903c065f0 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AgreementListResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.AgreementListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class AgreementListResultImpl extends WrapperImpl implements AgreementListResult { + private final BillingManager manager; + AgreementListResultImpl(AgreementListResultInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AgreementListResultInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AgreementListResultInner.java new file mode 100644 index 000000000000..712e9a03a966 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AgreementListResultInner.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of listing agreements. + */ +public class AgreementListResultInner { + /** + * The list of agreements. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the list of agreements. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Get the link (url) to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AgreementsImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AgreementsImpl.java new file mode 100644 index 000000000000..f0122aedbef8 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AgreementsImpl.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Agreements; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.billing.v2019_10_01_preview.AgreementListResult; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Agreement; + +class AgreementsImpl extends WrapperImpl implements Agreements { + private final BillingManager manager; + + AgreementsImpl(BillingManager manager) { + super(manager.inner().agreements()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + private AgreementImpl wrapModel(AgreementInner inner) { + return new AgreementImpl(inner, manager()); + } + + @Override + public Observable listByBillingAccountAsync(String billingAccountName) { + AgreementsInner client = this.inner(); + return client.listByBillingAccountAsync(billingAccountName) + .map(new Func1() { + @Override + public AgreementListResult call(AgreementListResultInner inner) { + return new AgreementListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String billingAccountName, String agreementName) { + AgreementsInner client = this.inner(); + return client.getAsync(billingAccountName, agreementName) + .map(new Func1() { + @Override + public Agreement call(AgreementInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AgreementsInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AgreementsInner.java new file mode 100644 index 000000000000..1eaaee2a1858 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AgreementsInner.java @@ -0,0 +1,378 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Agreements. + */ +public class AgreementsInner { + /** The Retrofit service to perform REST calls. */ + private AgreementsService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of AgreementsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AgreementsInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(AgreementsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Agreements to be + * used by Retrofit to perform actually REST calls. + */ + interface AgreementsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Agreements listByBillingAccount" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/agreements") + Observable> listByBillingAccount(@Path("billingAccountName") String billingAccountName, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Agreements get" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/agreements/{agreementName}") + Observable> get(@Path("billingAccountName") String billingAccountName, @Path("agreementName") String agreementName, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all agreements for a billing account. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AgreementListResultInner object if successful. + */ + public AgreementListResultInner listByBillingAccount(String billingAccountName) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName).toBlocking().single().body(); + } + + /** + * Lists all agreements for a billing account. + * + * @param billingAccountName billing Account Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByBillingAccountAsync(String billingAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingAccountWithServiceResponseAsync(billingAccountName), serviceCallback); + } + + /** + * Lists all agreements for a billing account. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AgreementListResultInner object + */ + public Observable listByBillingAccountAsync(String billingAccountName) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName).map(new Func1, AgreementListResultInner>() { + @Override + public AgreementListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all agreements for a billing account. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AgreementListResultInner object + */ + public Observable> listByBillingAccountWithServiceResponseAsync(String billingAccountName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + return service.listByBillingAccount(billingAccountName, this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByBillingAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists all agreements for a billing account. + * + * @param billingAccountName billing Account Id. + * @param expand May be used to expand the participants. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AgreementListResultInner object if successful. + */ + public AgreementListResultInner listByBillingAccount(String billingAccountName, String expand) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName, expand).toBlocking().single().body(); + } + + /** + * Lists all agreements for a billing account. + * + * @param billingAccountName billing Account Id. + * @param expand May be used to expand the participants. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByBillingAccountAsync(String billingAccountName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingAccountWithServiceResponseAsync(billingAccountName, expand), serviceCallback); + } + + /** + * Lists all agreements for a billing account. + * + * @param billingAccountName billing Account Id. + * @param expand May be used to expand the participants. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AgreementListResultInner object + */ + public Observable listByBillingAccountAsync(String billingAccountName, String expand) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName, expand).map(new Func1, AgreementListResultInner>() { + @Override + public AgreementListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all agreements for a billing account. + * + * @param billingAccountName billing Account Id. + * @param expand May be used to expand the participants. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AgreementListResultInner object + */ + public Observable> listByBillingAccountWithServiceResponseAsync(String billingAccountName, String expand) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByBillingAccount(billingAccountName, this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByBillingAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByBillingAccountDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get the agreement by name. + * + * @param billingAccountName billing Account Id. + * @param agreementName Agreement Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AgreementInner object if successful. + */ + public AgreementInner get(String billingAccountName, String agreementName) { + return getWithServiceResponseAsync(billingAccountName, agreementName).toBlocking().single().body(); + } + + /** + * Get the agreement by name. + * + * @param billingAccountName billing Account Id. + * @param agreementName Agreement Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String billingAccountName, String agreementName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(billingAccountName, agreementName), serviceCallback); + } + + /** + * Get the agreement by name. + * + * @param billingAccountName billing Account Id. + * @param agreementName Agreement Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AgreementInner object + */ + public Observable getAsync(String billingAccountName, String agreementName) { + return getWithServiceResponseAsync(billingAccountName, agreementName).map(new Func1, AgreementInner>() { + @Override + public AgreementInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the agreement by name. + * + * @param billingAccountName billing Account Id. + * @param agreementName Agreement Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AgreementInner object + */ + public Observable> getWithServiceResponseAsync(String billingAccountName, String agreementName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (agreementName == null) { + throw new IllegalArgumentException("Parameter agreementName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + return service.get(billingAccountName, agreementName, this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the agreement by name. + * + * @param billingAccountName billing Account Id. + * @param agreementName Agreement Id. + * @param expand May be used to expand the participants. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AgreementInner object if successful. + */ + public AgreementInner get(String billingAccountName, String agreementName, String expand) { + return getWithServiceResponseAsync(billingAccountName, agreementName, expand).toBlocking().single().body(); + } + + /** + * Get the agreement by name. + * + * @param billingAccountName billing Account Id. + * @param agreementName Agreement Id. + * @param expand May be used to expand the participants. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String billingAccountName, String agreementName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(billingAccountName, agreementName, expand), serviceCallback); + } + + /** + * Get the agreement by name. + * + * @param billingAccountName billing Account Id. + * @param agreementName Agreement Id. + * @param expand May be used to expand the participants. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AgreementInner object + */ + public Observable getAsync(String billingAccountName, String agreementName, String expand) { + return getWithServiceResponseAsync(billingAccountName, agreementName, expand).map(new Func1, AgreementInner>() { + @Override + public AgreementInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the agreement by name. + * + * @param billingAccountName billing Account Id. + * @param agreementName Agreement Id. + * @param expand May be used to expand the participants. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AgreementInner object + */ + public Observable> getWithServiceResponseAsync(String billingAccountName, String agreementName, String expand) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (agreementName == null) { + throw new IllegalArgumentException("Parameter agreementName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(billingAccountName, agreementName, this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AvailableBalanceImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AvailableBalanceImpl.java new file mode 100644 index 000000000000..a1ede847a470 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AvailableBalanceImpl.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.AvailableBalance; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Amount; + +class AvailableBalanceImpl extends WrapperImpl implements AvailableBalance { + private final BillingManager manager; + AvailableBalanceImpl(AvailableBalanceInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public Amount amount() { + return this.inner().amount(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AvailableBalanceInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AvailableBalanceInner.java new file mode 100644 index 000000000000..a30a385874cc --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AvailableBalanceInner.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.Amount; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Latest available balance on Monetary Credit PI. + */ +@JsonFlatten +public class AvailableBalanceInner extends ProxyResource { + /** + * Balance Amount. + */ + @JsonProperty(value = "properties.amount", access = JsonProperty.Access.WRITE_ONLY) + private Amount amount; + + /** + * Get balance Amount. + * + * @return the amount value + */ + public Amount amount() { + return this.amount; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AvailableBalancesImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AvailableBalancesImpl.java new file mode 100644 index 000000000000..adf6a77f678b --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AvailableBalancesImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.AvailableBalances; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.AvailableBalance; + +class AvailableBalancesImpl extends WrapperImpl implements AvailableBalances { + private final BillingManager manager; + + AvailableBalancesImpl(BillingManager manager) { + super(manager.inner().availableBalances()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + @Override + public Observable getByBillingProfileAsync(String billingAccountName, String billingProfileName) { + AvailableBalancesInner client = this.inner(); + return client.getByBillingProfileAsync(billingAccountName, billingProfileName) + .map(new Func1() { + @Override + public AvailableBalance call(AvailableBalanceInner inner) { + return new AvailableBalanceImpl(inner, manager()); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AvailableBalancesInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AvailableBalancesInner.java new file mode 100644 index 000000000000..2fe329ed2c70 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/AvailableBalancesInner.java @@ -0,0 +1,143 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AvailableBalances. + */ +public class AvailableBalancesInner { + /** The Retrofit service to perform REST calls. */ + private AvailableBalancesService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of AvailableBalancesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AvailableBalancesInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(AvailableBalancesService.class); + this.client = client; + } + + /** + * The interface defining all the services for AvailableBalances to be + * used by Retrofit to perform actually REST calls. + */ + interface AvailableBalancesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.AvailableBalances getByBillingProfile" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/availableBalance/default") + Observable> getByBillingProfile(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * The latest available credit balance for a given billingAccountName and billingProfileName. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AvailableBalanceInner object if successful. + */ + public AvailableBalanceInner getByBillingProfile(String billingAccountName, String billingProfileName) { + return getByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName).toBlocking().single().body(); + } + + /** + * The latest available credit balance for a given billingAccountName and billingProfileName. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByBillingProfileAsync(String billingAccountName, String billingProfileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName), serviceCallback); + } + + /** + * The latest available credit balance for a given billingAccountName and billingProfileName. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailableBalanceInner object + */ + public Observable getByBillingProfileAsync(String billingAccountName, String billingProfileName) { + return getByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName).map(new Func1, AvailableBalanceInner>() { + @Override + public AvailableBalanceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The latest available credit balance for a given billingAccountName and billingProfileName. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailableBalanceInner object + */ + public Observable> getByBillingProfileWithServiceResponseAsync(String billingAccountName, String billingProfileName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByBillingProfile(billingAccountName, billingProfileName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByBillingProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByBillingProfileDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingAccountImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingAccountImpl.java new file mode 100644 index 000000000000..12fe65dcf687 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingAccountImpl.java @@ -0,0 +1,194 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingAccount; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingAccountUpdateRequest; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.AddressDetails; +import com.microsoft.azure.management.billing.v2019_10_01_preview.AgreementType; +import java.util.ArrayList; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingProfile; +import com.microsoft.azure.management.billing.v2019_10_01_preview.CustomerType; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Department; +import com.microsoft.azure.management.billing.v2019_10_01_preview.EnrollmentAccount; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Enrollment; +import rx.functions.Func1; + +class BillingAccountImpl extends CreatableUpdatableImpl implements BillingAccount, BillingAccount.Update { + private String billingAccountName; + private BillingAccountUpdateRequest updateParameter; + private final BillingManager manager; + + BillingAccountImpl(String name, BillingManager manager) { + super(name, new BillingAccountInner()); + this.manager = manager; + // Set resource name + this.billingAccountName = name; + // + this.updateParameter = new BillingAccountUpdateRequest(); + } + + BillingAccountImpl(BillingAccountInner inner, BillingManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.billingAccountName = inner.name(); + // set resource ancestor and positional variables + this.billingAccountName = IdParsingUtils.getValueFromIdByName(inner.id(), "billingAccounts"); + // set other parameters for create and update + this.updateParameter = new BillingAccountUpdateRequest(); + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + BillingAccountsInner client = this.manager().inner().billingAccounts(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + BillingAccountsInner client = this.manager().inner().billingAccounts(); + return client.updateAsync(this.billingAccountName, this.updateParameter) + .map(new Func1() { + @Override + public BillingAccountInner call(BillingAccountInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + BillingAccountsInner client = this.manager().inner().billingAccounts(); + return client.getAsync(this.billingAccountName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new BillingAccountUpdateRequest(); + } + + @Override + public AddressDetails address() { + return this.inner().address(); + } + + @Override + public AgreementType agreementType() { + return this.inner().agreementType(); + } + + @Override + public List billingProfiles() { + List lst = new ArrayList(); + if (this.inner().billingProfiles() != null) { + for (BillingProfileInner inner : this.inner().billingProfiles()) { + lst.add( new BillingProfileImpl(inner, manager())); + } + } + return lst; + } + + @Override + public CustomerType customerType() { + return this.inner().customerType(); + } + + @Override + public List departments() { + List lst = new ArrayList(); + if (this.inner().departments() != null) { + for (DepartmentInner inner : this.inner().departments()) { + lst.add( new DepartmentImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public List enrollmentAccounts() { + List lst = new ArrayList(); + if (this.inner().enrollmentAccounts() != null) { + for (EnrollmentAccountInner inner : this.inner().enrollmentAccounts()) { + lst.add( new EnrollmentAccountImpl(inner, manager())); + } + } + return lst; + } + + @Override + public Enrollment enrollmentDetails() { + return this.inner().enrollmentDetails(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String organizationId() { + return this.inner().organizationId(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public BillingAccountImpl withAddress(AddressDetails address) { + this.updateParameter.withAddress(address); + return this; + } + + @Override + public BillingAccountImpl withBillingProfiles(List billingProfiles) { + this.updateParameter.withBillingProfiles(billingProfiles); + return this; + } + + @Override + public BillingAccountImpl withDepartments(List departments) { + this.updateParameter.withDepartments(departments); + return this; + } + + @Override + public BillingAccountImpl withEnrollmentAccounts(List enrollmentAccounts) { + this.updateParameter.withEnrollmentAccounts(enrollmentAccounts); + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingAccountInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingAccountInner.java new file mode 100644 index 000000000000..d1e7335290ad --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingAccountInner.java @@ -0,0 +1,209 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.AddressDetails; +import com.microsoft.azure.management.billing.v2019_10_01_preview.AgreementType; +import com.microsoft.azure.management.billing.v2019_10_01_preview.CustomerType; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Enrollment; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A billing account resource. + */ +@JsonFlatten +public class BillingAccountInner extends ProxyResource { + /** + * The billing account name. + */ + @JsonProperty(value = "properties.displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /** + * The address associated with billing account. + */ + @JsonProperty(value = "properties.address") + private AddressDetails address; + + /** + * The type of agreement. Possible values include: + * 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', + * 'MicrosoftOnlineServicesProgram'. + */ + @JsonProperty(value = "properties.agreementType", access = JsonProperty.Access.WRITE_ONLY) + private AgreementType agreementType; + + /** + * The type of customer. Possible values include: 'Enterprise', + * 'Individual', 'Partner'. + */ + @JsonProperty(value = "properties.customerType", access = JsonProperty.Access.WRITE_ONLY) + private CustomerType customerType; + + /** + * The billing profiles associated to the billing account. By default this + * is not populated, unless it's specified in $expand. + */ + @JsonProperty(value = "properties.billingProfiles") + private List billingProfiles; + + /** + * The details about the associated legacy enrollment. By default this is + * not populated, unless it's specified in $expand. + */ + @JsonProperty(value = "properties.enrollmentDetails", access = JsonProperty.Access.WRITE_ONLY) + private Enrollment enrollmentDetails; + + /** + * The departments associated to the enrollment. + */ + @JsonProperty(value = "properties.departments") + private List departments; + + /** + * The accounts associated to the enrollment. + */ + @JsonProperty(value = "properties.enrollmentAccounts") + private List enrollmentAccounts; + + /** + * Organization id. + */ + @JsonProperty(value = "properties.organizationId", access = JsonProperty.Access.WRITE_ONLY) + private String organizationId; + + /** + * Get the billing account name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the address associated with billing account. + * + * @return the address value + */ + public AddressDetails address() { + return this.address; + } + + /** + * Set the address associated with billing account. + * + * @param address the address value to set + * @return the BillingAccountInner object itself. + */ + public BillingAccountInner withAddress(AddressDetails address) { + this.address = address; + return this; + } + + /** + * Get the type of agreement. Possible values include: 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', 'MicrosoftOnlineServicesProgram'. + * + * @return the agreementType value + */ + public AgreementType agreementType() { + return this.agreementType; + } + + /** + * Get the type of customer. Possible values include: 'Enterprise', 'Individual', 'Partner'. + * + * @return the customerType value + */ + public CustomerType customerType() { + return this.customerType; + } + + /** + * Get the billing profiles associated to the billing account. By default this is not populated, unless it's specified in $expand. + * + * @return the billingProfiles value + */ + public List billingProfiles() { + return this.billingProfiles; + } + + /** + * Set the billing profiles associated to the billing account. By default this is not populated, unless it's specified in $expand. + * + * @param billingProfiles the billingProfiles value to set + * @return the BillingAccountInner object itself. + */ + public BillingAccountInner withBillingProfiles(List billingProfiles) { + this.billingProfiles = billingProfiles; + return this; + } + + /** + * Get the details about the associated legacy enrollment. By default this is not populated, unless it's specified in $expand. + * + * @return the enrollmentDetails value + */ + public Enrollment enrollmentDetails() { + return this.enrollmentDetails; + } + + /** + * Get the departments associated to the enrollment. + * + * @return the departments value + */ + public List departments() { + return this.departments; + } + + /** + * Set the departments associated to the enrollment. + * + * @param departments the departments value to set + * @return the BillingAccountInner object itself. + */ + public BillingAccountInner withDepartments(List departments) { + this.departments = departments; + return this; + } + + /** + * Get the accounts associated to the enrollment. + * + * @return the enrollmentAccounts value + */ + public List enrollmentAccounts() { + return this.enrollmentAccounts; + } + + /** + * Set the accounts associated to the enrollment. + * + * @param enrollmentAccounts the enrollmentAccounts value to set + * @return the BillingAccountInner object itself. + */ + public BillingAccountInner withEnrollmentAccounts(List enrollmentAccounts) { + this.enrollmentAccounts = enrollmentAccounts; + return this; + } + + /** + * Get organization id. + * + * @return the organizationId value + */ + public String organizationId() { + return this.organizationId; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingAccountListResultImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingAccountListResultImpl.java new file mode 100644 index 000000000000..980cc887da0c --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingAccountListResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingAccountListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class BillingAccountListResultImpl extends WrapperImpl implements BillingAccountListResult { + private final BillingManager manager; + BillingAccountListResultImpl(BillingAccountListResultInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingAccountListResultInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingAccountListResultInner.java new file mode 100644 index 000000000000..407528efd0b3 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingAccountListResultInner.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of listing billing accounts. + */ +public class BillingAccountListResultInner { + /** + * The list of billing accounts. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the list of billing accounts. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Get the link (url) to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingAccountsImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingAccountsImpl.java new file mode 100644 index 000000000000..71dcf678fbaa --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingAccountsImpl.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * jkl + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingAccounts; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingAccount; +import com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceSectionWithCreateSubPermission; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingAccountListResult; + +class BillingAccountsImpl extends WrapperImpl implements BillingAccounts { + private final BillingManager manager; + + BillingAccountsImpl(BillingManager manager) { + super(manager.inner().billingAccounts()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + private BillingAccountImpl wrapModel(BillingAccountInner inner) { + return new BillingAccountImpl(inner, manager()); + } + + @Override + public Observable getAsync(String billingAccountName) { + BillingAccountsInner client = this.inner(); + return client.getAsync(billingAccountName) + .map(new Func1() { + @Override + public BillingAccount call(BillingAccountInner inner) { + return new BillingAccountImpl(inner, manager()); + } + }); + } + + @Override + public Observable listInvoiceSectionsByCreateSubscriptionPermissionAsync(final String billingAccountName) { + BillingAccountsInner client = this.inner(); + return client.listInvoiceSectionsByCreateSubscriptionPermissionAsync(billingAccountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public InvoiceSectionWithCreateSubPermission call(InvoiceSectionWithCreateSubPermissionInner inner) { + return new InvoiceSectionWithCreateSubPermissionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync() { + BillingAccountsInner client = this.inner(); + return client.listAsync() + .map(new Func1() { + @Override + public BillingAccountListResult call(BillingAccountListResultInner inner) { + return new BillingAccountListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingAccountsInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingAccountsInner.java new file mode 100644 index 000000000000..00c73f7b920e --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingAccountsInner.java @@ -0,0 +1,751 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingAccountUpdateRequest; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BillingAccounts. + */ +public class BillingAccountsInner { + /** The Retrofit service to perform REST calls. */ + private BillingAccountsService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of BillingAccountsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BillingAccountsInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(BillingAccountsService.class); + this.client = client; + } + + /** + * The interface defining all the services for BillingAccounts to be + * used by Retrofit to perform actually REST calls. + */ + interface BillingAccountsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingAccounts list" }) + @GET("providers/Microsoft.Billing/billingAccounts") + Observable> list(@Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingAccounts get" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}") + Observable> get(@Path("billingAccountName") String billingAccountName, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingAccounts update" }) + @PATCH("providers/Microsoft.Billing/billingAccounts/{billingAccountName}") + Observable> update(@Path("billingAccountName") String billingAccountName, @Query("api-version") String apiVersion, @Body BillingAccountUpdateRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingAccounts beginUpdate" }) + @PATCH("providers/Microsoft.Billing/billingAccounts/{billingAccountName}") + Observable> beginUpdate(@Path("billingAccountName") String billingAccountName, @Query("api-version") String apiVersion, @Body BillingAccountUpdateRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingAccounts listInvoiceSectionsByCreateSubscriptionPermission" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/listInvoiceSectionsWithCreateSubscriptionPermission") + Observable> listInvoiceSectionsByCreateSubscriptionPermission(@Path("billingAccountName") String billingAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingAccounts listInvoiceSectionsByCreateSubscriptionPermissionNext" }) + @GET + Observable> listInvoiceSectionsByCreateSubscriptionPermissionNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all billing accounts for a user which he has access to. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingAccountListResultInner object if successful. + */ + public BillingAccountListResultInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists all billing accounts for a user which he has access to. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all billing accounts for a user which he has access to. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingAccountListResultInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, BillingAccountListResultInner>() { + @Override + public BillingAccountListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all billing accounts for a user which he has access to. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingAccountListResultInner object + */ + public Observable> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + return service.list(this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists all billing accounts for a user which he has access to. + * + * @param expand May be used to expand the address, invoiceSections and billingProfiles. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingAccountListResultInner object if successful. + */ + public BillingAccountListResultInner list(String expand) { + return listWithServiceResponseAsync(expand).toBlocking().single().body(); + } + + /** + * Lists all billing accounts for a user which he has access to. + * + * @param expand May be used to expand the address, invoiceSections and billingProfiles. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(expand), serviceCallback); + } + + /** + * Lists all billing accounts for a user which he has access to. + * + * @param expand May be used to expand the address, invoiceSections and billingProfiles. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingAccountListResultInner object + */ + public Observable listAsync(String expand) { + return listWithServiceResponseAsync(expand).map(new Func1, BillingAccountListResultInner>() { + @Override + public BillingAccountListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all billing accounts for a user which he has access to. + * + * @param expand May be used to expand the address, invoiceSections and billingProfiles. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingAccountListResultInner object + */ + public Observable> listWithServiceResponseAsync(String expand) { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get the billing account by id. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingAccountInner object if successful. + */ + public BillingAccountInner get(String billingAccountName) { + return getWithServiceResponseAsync(billingAccountName).toBlocking().single().body(); + } + + /** + * Get the billing account by id. + * + * @param billingAccountName billing Account Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String billingAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(billingAccountName), serviceCallback); + } + + /** + * Get the billing account by id. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingAccountInner object + */ + public Observable getAsync(String billingAccountName) { + return getWithServiceResponseAsync(billingAccountName).map(new Func1, BillingAccountInner>() { + @Override + public BillingAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the billing account by id. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingAccountInner object + */ + public Observable> getWithServiceResponseAsync(String billingAccountName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + return service.get(billingAccountName, this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the billing account by id. + * + * @param billingAccountName billing Account Id. + * @param expand May be used to expand the address, invoiceSections and billingProfiles. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingAccountInner object if successful. + */ + public BillingAccountInner get(String billingAccountName, String expand) { + return getWithServiceResponseAsync(billingAccountName, expand).toBlocking().single().body(); + } + + /** + * Get the billing account by id. + * + * @param billingAccountName billing Account Id. + * @param expand May be used to expand the address, invoiceSections and billingProfiles. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String billingAccountName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(billingAccountName, expand), serviceCallback); + } + + /** + * Get the billing account by id. + * + * @param billingAccountName billing Account Id. + * @param expand May be used to expand the address, invoiceSections and billingProfiles. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingAccountInner object + */ + public Observable getAsync(String billingAccountName, String expand) { + return getWithServiceResponseAsync(billingAccountName, expand).map(new Func1, BillingAccountInner>() { + @Override + public BillingAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the billing account by id. + * + * @param billingAccountName billing Account Id. + * @param expand May be used to expand the address, invoiceSections and billingProfiles. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingAccountInner object + */ + public Observable> getWithServiceResponseAsync(String billingAccountName, String expand) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(billingAccountName, this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * The operation to update a billing account. + * + * @param billingAccountName billing Account Id. + * @param parameters Request parameters supplied to the update billing account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingAccountInner object if successful. + */ + public BillingAccountInner update(String billingAccountName, BillingAccountUpdateRequest parameters) { + return updateWithServiceResponseAsync(billingAccountName, parameters).toBlocking().last().body(); + } + + /** + * The operation to update a billing account. + * + * @param billingAccountName billing Account Id. + * @param parameters Request parameters supplied to the update billing account operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String billingAccountName, BillingAccountUpdateRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(billingAccountName, parameters), serviceCallback); + } + + /** + * The operation to update a billing account. + * + * @param billingAccountName billing Account Id. + * @param parameters Request parameters supplied to the update billing account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String billingAccountName, BillingAccountUpdateRequest parameters) { + return updateWithServiceResponseAsync(billingAccountName, parameters).map(new Func1, BillingAccountInner>() { + @Override + public BillingAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to update a billing account. + * + * @param billingAccountName billing Account Id. + * @param parameters Request parameters supplied to the update billing account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String billingAccountName, BillingAccountUpdateRequest parameters) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(billingAccountName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The operation to update a billing account. + * + * @param billingAccountName billing Account Id. + * @param parameters Request parameters supplied to the update billing account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingAccountInner object if successful. + */ + public BillingAccountInner beginUpdate(String billingAccountName, BillingAccountUpdateRequest parameters) { + return beginUpdateWithServiceResponseAsync(billingAccountName, parameters).toBlocking().single().body(); + } + + /** + * The operation to update a billing account. + * + * @param billingAccountName billing Account Id. + * @param parameters Request parameters supplied to the update billing account operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String billingAccountName, BillingAccountUpdateRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(billingAccountName, parameters), serviceCallback); + } + + /** + * The operation to update a billing account. + * + * @param billingAccountName billing Account Id. + * @param parameters Request parameters supplied to the update billing account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingAccountInner object + */ + public Observable beginUpdateAsync(String billingAccountName, BillingAccountUpdateRequest parameters) { + return beginUpdateWithServiceResponseAsync(billingAccountName, parameters).map(new Func1, BillingAccountInner>() { + @Override + public BillingAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to update a billing account. + * + * @param billingAccountName billing Account Id. + * @param parameters Request parameters supplied to the update billing account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingAccountInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String billingAccountName, BillingAccountUpdateRequest parameters) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(billingAccountName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all invoice sections with create subscription permission for a user. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<InvoiceSectionWithCreateSubPermissionInner> object if successful. + */ + public PagedList listInvoiceSectionsByCreateSubscriptionPermission(final String billingAccountName) { + ServiceResponse> response = listInvoiceSectionsByCreateSubscriptionPermissionSinglePageAsync(billingAccountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listInvoiceSectionsByCreateSubscriptionPermissionNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all invoice sections with create subscription permission for a user. + * + * @param billingAccountName billing Account Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listInvoiceSectionsByCreateSubscriptionPermissionAsync(final String billingAccountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listInvoiceSectionsByCreateSubscriptionPermissionSinglePageAsync(billingAccountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listInvoiceSectionsByCreateSubscriptionPermissionNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all invoice sections with create subscription permission for a user. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InvoiceSectionWithCreateSubPermissionInner> object + */ + public Observable> listInvoiceSectionsByCreateSubscriptionPermissionAsync(final String billingAccountName) { + return listInvoiceSectionsByCreateSubscriptionPermissionWithServiceResponseAsync(billingAccountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all invoice sections with create subscription permission for a user. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InvoiceSectionWithCreateSubPermissionInner> object + */ + public Observable>> listInvoiceSectionsByCreateSubscriptionPermissionWithServiceResponseAsync(final String billingAccountName) { + return listInvoiceSectionsByCreateSubscriptionPermissionSinglePageAsync(billingAccountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listInvoiceSectionsByCreateSubscriptionPermissionNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all invoice sections with create subscription permission for a user. + * + ServiceResponse> * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<InvoiceSectionWithCreateSubPermissionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listInvoiceSectionsByCreateSubscriptionPermissionSinglePageAsync(final String billingAccountName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listInvoiceSectionsByCreateSubscriptionPermission(billingAccountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listInvoiceSectionsByCreateSubscriptionPermissionDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listInvoiceSectionsByCreateSubscriptionPermissionDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all invoice sections with create subscription permission for a user. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<InvoiceSectionWithCreateSubPermissionInner> object if successful. + */ + public PagedList listInvoiceSectionsByCreateSubscriptionPermissionNext(final String nextPageLink) { + ServiceResponse> response = listInvoiceSectionsByCreateSubscriptionPermissionNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listInvoiceSectionsByCreateSubscriptionPermissionNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all invoice sections with create subscription permission for a user. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listInvoiceSectionsByCreateSubscriptionPermissionNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listInvoiceSectionsByCreateSubscriptionPermissionNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listInvoiceSectionsByCreateSubscriptionPermissionNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all invoice sections with create subscription permission for a user. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InvoiceSectionWithCreateSubPermissionInner> object + */ + public Observable> listInvoiceSectionsByCreateSubscriptionPermissionNextAsync(final String nextPageLink) { + return listInvoiceSectionsByCreateSubscriptionPermissionNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all invoice sections with create subscription permission for a user. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<InvoiceSectionWithCreateSubPermissionInner> object + */ + public Observable>> listInvoiceSectionsByCreateSubscriptionPermissionNextWithServiceResponseAsync(final String nextPageLink) { + return listInvoiceSectionsByCreateSubscriptionPermissionNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listInvoiceSectionsByCreateSubscriptionPermissionNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all invoice sections with create subscription permission for a user. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<InvoiceSectionWithCreateSubPermissionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listInvoiceSectionsByCreateSubscriptionPermissionNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listInvoiceSectionsByCreateSubscriptionPermissionNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listInvoiceSectionsByCreateSubscriptionPermissionNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listInvoiceSectionsByCreateSubscriptionPermissionNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingManagementClientImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingManagementClientImpl.java new file mode 100644 index 000000000000..70168e706a04 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingManagementClientImpl.java @@ -0,0 +1,546 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the BillingManagementClientImpl class. + */ +public class BillingManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Version of the API to be used with the client request. The current version is 2019-10-01-preview. */ + private String apiVersion; + + /** + * Gets Version of the API to be used with the client request. The current version is 2019-10-01-preview. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Azure Subscription ID. */ + private String subscriptionId; + + /** + * Gets Azure Subscription ID. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Azure Subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public BillingManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public BillingManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public BillingManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public BillingManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The BillingAccountsInner object to access its operations. + */ + private BillingAccountsInner billingAccounts; + + /** + * Gets the BillingAccountsInner object to access its operations. + * @return the BillingAccountsInner object. + */ + public BillingAccountsInner billingAccounts() { + return this.billingAccounts; + } + + /** + * The PaymentMethodsInner object to access its operations. + */ + private PaymentMethodsInner paymentMethods; + + /** + * Gets the PaymentMethodsInner object to access its operations. + * @return the PaymentMethodsInner object. + */ + public PaymentMethodsInner paymentMethods() { + return this.paymentMethods; + } + + /** + * The AddressInner object to access its operations. + */ + private AddressInner address; + + /** + * Gets the AddressInner object to access its operations. + * @return the AddressInner object. + */ + public AddressInner address() { + return this.address; + } + + /** + * The AvailableBalancesInner object to access its operations. + */ + private AvailableBalancesInner availableBalances; + + /** + * Gets the AvailableBalancesInner object to access its operations. + * @return the AvailableBalancesInner object. + */ + public AvailableBalancesInner availableBalances() { + return this.availableBalances; + } + + /** + * The BillingProfilesInner object to access its operations. + */ + private BillingProfilesInner billingProfiles; + + /** + * Gets the BillingProfilesInner object to access its operations. + * @return the BillingProfilesInner object. + */ + public BillingProfilesInner billingProfiles() { + return this.billingProfiles; + } + + /** + * The CustomersInner object to access its operations. + */ + private CustomersInner customers; + + /** + * Gets the CustomersInner object to access its operations. + * @return the CustomersInner object. + */ + public CustomersInner customers() { + return this.customers; + } + + /** + * The InvoiceSectionsInner object to access its operations. + */ + private InvoiceSectionsInner invoiceSections; + + /** + * Gets the InvoiceSectionsInner object to access its operations. + * @return the InvoiceSectionsInner object. + */ + public InvoiceSectionsInner invoiceSections() { + return this.invoiceSections; + } + + /** + * The BillingPermissionsInner object to access its operations. + */ + private BillingPermissionsInner billingPermissions; + + /** + * Gets the BillingPermissionsInner object to access its operations. + * @return the BillingPermissionsInner object. + */ + public BillingPermissionsInner billingPermissions() { + return this.billingPermissions; + } + + /** + * The BillingSubscriptionsInner object to access its operations. + */ + private BillingSubscriptionsInner billingSubscriptions; + + /** + * Gets the BillingSubscriptionsInner object to access its operations. + * @return the BillingSubscriptionsInner object. + */ + public BillingSubscriptionsInner billingSubscriptions() { + return this.billingSubscriptions; + } + + /** + * The ProductsInner object to access its operations. + */ + private ProductsInner products; + + /** + * Gets the ProductsInner object to access its operations. + * @return the ProductsInner object. + */ + public ProductsInner products() { + return this.products; + } + + /** + * The TransactionsInner object to access its operations. + */ + private TransactionsInner transactions; + + /** + * Gets the TransactionsInner object to access its operations. + * @return the TransactionsInner object. + */ + public TransactionsInner transactions() { + return this.transactions; + } + + /** + * The DepartmentsInner object to access its operations. + */ + private DepartmentsInner departments; + + /** + * Gets the DepartmentsInner object to access its operations. + * @return the DepartmentsInner object. + */ + public DepartmentsInner departments() { + return this.departments; + } + + /** + * The EnrollmentAccountsInner object to access its operations. + */ + private EnrollmentAccountsInner enrollmentAccounts; + + /** + * Gets the EnrollmentAccountsInner object to access its operations. + * @return the EnrollmentAccountsInner object. + */ + public EnrollmentAccountsInner enrollmentAccounts() { + return this.enrollmentAccounts; + } + + /** + * The InvoicesInner object to access its operations. + */ + private InvoicesInner invoices; + + /** + * Gets the InvoicesInner object to access its operations. + * @return the InvoicesInner object. + */ + public InvoicesInner invoices() { + return this.invoices; + } + + /** + * The PriceSheetsInner object to access its operations. + */ + private PriceSheetsInner priceSheets; + + /** + * Gets the PriceSheetsInner object to access its operations. + * @return the PriceSheetsInner object. + */ + public PriceSheetsInner priceSheets() { + return this.priceSheets; + } + + /** + * The PoliciesInner object to access its operations. + */ + private PoliciesInner policies; + + /** + * Gets the PoliciesInner object to access its operations. + * @return the PoliciesInner object. + */ + public PoliciesInner policies() { + return this.policies; + } + + /** + * The BillingPropertysInner object to access its operations. + */ + private BillingPropertysInner billingPropertys; + + /** + * Gets the BillingPropertysInner object to access its operations. + * @return the BillingPropertysInner object. + */ + public BillingPropertysInner billingPropertys() { + return this.billingPropertys; + } + + /** + * The TransfersInner object to access its operations. + */ + private TransfersInner transfers; + + /** + * Gets the TransfersInner object to access its operations. + * @return the TransfersInner object. + */ + public TransfersInner transfers() { + return this.transfers; + } + + /** + * The PartnerTransfersInner object to access its operations. + */ + private PartnerTransfersInner partnerTransfers; + + /** + * Gets the PartnerTransfersInner object to access its operations. + * @return the PartnerTransfersInner object. + */ + public PartnerTransfersInner partnerTransfers() { + return this.partnerTransfers; + } + + /** + * The PartnerTransfersTransfersInner object to access its operations. + */ + private PartnerTransfersTransfersInner partnerTransfersTransfers; + + /** + * Gets the PartnerTransfersTransfersInner object to access its operations. + * @return the PartnerTransfersTransfersInner object. + */ + public PartnerTransfersTransfersInner partnerTransfersTransfers() { + return this.partnerTransfersTransfers; + } + + /** + * The RecipientTransfersInner object to access its operations. + */ + private RecipientTransfersInner recipientTransfers; + + /** + * Gets the RecipientTransfersInner object to access its operations. + * @return the RecipientTransfersInner object. + */ + public RecipientTransfersInner recipientTransfers() { + return this.recipientTransfers; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The BillingRoleDefinitionsInner object to access its operations. + */ + private BillingRoleDefinitionsInner billingRoleDefinitions; + + /** + * Gets the BillingRoleDefinitionsInner object to access its operations. + * @return the BillingRoleDefinitionsInner object. + */ + public BillingRoleDefinitionsInner billingRoleDefinitions() { + return this.billingRoleDefinitions; + } + + /** + * The BillingRoleAssignmentsInner object to access its operations. + */ + private BillingRoleAssignmentsInner billingRoleAssignments; + + /** + * Gets the BillingRoleAssignmentsInner object to access its operations. + * @return the BillingRoleAssignmentsInner object. + */ + public BillingRoleAssignmentsInner billingRoleAssignments() { + return this.billingRoleAssignments; + } + + /** + * The AgreementsInner object to access its operations. + */ + private AgreementsInner agreements; + + /** + * Gets the AgreementsInner object to access its operations. + * @return the AgreementsInner object. + */ + public AgreementsInner agreements() { + return this.agreements; + } + + /** + * The LineOfCreditsInner object to access its operations. + */ + private LineOfCreditsInner lineOfCredits; + + /** + * Gets the LineOfCreditsInner object to access its operations. + * @return the LineOfCreditsInner object. + */ + public LineOfCreditsInner lineOfCredits() { + return this.lineOfCredits; + } + + /** + * Initializes an instance of BillingManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public BillingManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of BillingManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public BillingManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of BillingManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public BillingManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2019-10-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.billingAccounts = new BillingAccountsInner(restClient().retrofit(), this); + this.paymentMethods = new PaymentMethodsInner(restClient().retrofit(), this); + this.address = new AddressInner(restClient().retrofit(), this); + this.availableBalances = new AvailableBalancesInner(restClient().retrofit(), this); + this.billingProfiles = new BillingProfilesInner(restClient().retrofit(), this); + this.customers = new CustomersInner(restClient().retrofit(), this); + this.invoiceSections = new InvoiceSectionsInner(restClient().retrofit(), this); + this.billingPermissions = new BillingPermissionsInner(restClient().retrofit(), this); + this.billingSubscriptions = new BillingSubscriptionsInner(restClient().retrofit(), this); + this.products = new ProductsInner(restClient().retrofit(), this); + this.transactions = new TransactionsInner(restClient().retrofit(), this); + this.departments = new DepartmentsInner(restClient().retrofit(), this); + this.enrollmentAccounts = new EnrollmentAccountsInner(restClient().retrofit(), this); + this.invoices = new InvoicesInner(restClient().retrofit(), this); + this.priceSheets = new PriceSheetsInner(restClient().retrofit(), this); + this.policies = new PoliciesInner(restClient().retrofit(), this); + this.billingPropertys = new BillingPropertysInner(restClient().retrofit(), this); + this.transfers = new TransfersInner(restClient().retrofit(), this); + this.partnerTransfers = new PartnerTransfersInner(restClient().retrofit(), this); + this.partnerTransfersTransfers = new PartnerTransfersTransfersInner(restClient().retrofit(), this); + this.recipientTransfers = new RecipientTransfersInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.billingRoleDefinitions = new BillingRoleDefinitionsInner(restClient().retrofit(), this); + this.billingRoleAssignments = new BillingRoleAssignmentsInner(restClient().retrofit(), this); + this.agreements = new AgreementsInner(restClient().retrofit(), this); + this.lineOfCredits = new LineOfCreditsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "BillingManagementClient", "2019-10-01-preview"); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingManager.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingManager.java new file mode 100644 index 000000000000..a42e2ad46575 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingManager.java @@ -0,0 +1,399 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingAccounts; +import com.microsoft.azure.management.billing.v2019_10_01_preview.PaymentMethods; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Address; +import com.microsoft.azure.management.billing.v2019_10_01_preview.AvailableBalances; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingProfiles; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Customers; +import com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceSections; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingPermissions; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingSubscriptions; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Products; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Transactions; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Departments; +import com.microsoft.azure.management.billing.v2019_10_01_preview.EnrollmentAccounts; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Invoices; +import com.microsoft.azure.management.billing.v2019_10_01_preview.PriceSheets; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Policies; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingPropertys; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Transfers; +import com.microsoft.azure.management.billing.v2019_10_01_preview.PartnerTransfers; +import com.microsoft.azure.management.billing.v2019_10_01_preview.PartnerTransfersTransfers; +import com.microsoft.azure.management.billing.v2019_10_01_preview.RecipientTransfers; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Operations; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleDefinitions; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleAssignments; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Agreements; +import com.microsoft.azure.management.billing.v2019_10_01_preview.LineOfCredits; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Billing resource management. + */ +public final class BillingManager extends ManagerCore { + private BillingAccounts billingAccounts; + private PaymentMethods paymentMethods; + private Address address; + private AvailableBalances availableBalances; + private BillingProfiles billingProfiles; + private Customers customers; + private InvoiceSections invoiceSections; + private BillingPermissions billingPermissions; + private BillingSubscriptions billingSubscriptions; + private Products products; + private Transactions transactions; + private Departments departments; + private EnrollmentAccounts enrollmentAccounts; + private Invoices invoices; + private PriceSheets priceSheets; + private Policies policies; + private BillingPropertys billingPropertys; + private Transfers transfers; + private PartnerTransfers partnerTransfers; + private PartnerTransfersTransfers partnerTransfersTransfers; + private RecipientTransfers recipientTransfers; + private Operations operations; + private BillingRoleDefinitions billingRoleDefinitions; + private BillingRoleAssignments billingRoleAssignments; + private Agreements agreements; + private LineOfCredits lineOfCredits; + /** + * Get a Configurable instance that can be used to create BillingManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new BillingManager.ConfigurableImpl(); + } + /** + * Creates an instance of BillingManager that exposes Billing resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the BillingManager + */ + public static BillingManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new BillingManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of BillingManager that exposes Billing resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the BillingManager + */ + public static BillingManager authenticate(RestClient restClient, String subscriptionId) { + return new BillingManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of BillingManager that exposes Billing management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Billing management API entry points that work across subscriptions + */ + BillingManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage BillingAccounts. + */ + public BillingAccounts billingAccounts() { + if (this.billingAccounts == null) { + this.billingAccounts = new BillingAccountsImpl(this); + } + return this.billingAccounts; + } + + /** + * @return Entry point to manage PaymentMethods. + */ + public PaymentMethods paymentMethods() { + if (this.paymentMethods == null) { + this.paymentMethods = new PaymentMethodsImpl(this); + } + return this.paymentMethods; + } + + /** + * @return Entry point to manage Address. + */ + public Address address() { + if (this.address == null) { + this.address = new AddressImpl(this); + } + return this.address; + } + + /** + * @return Entry point to manage AvailableBalances. + */ + public AvailableBalances availableBalances() { + if (this.availableBalances == null) { + this.availableBalances = new AvailableBalancesImpl(this); + } + return this.availableBalances; + } + + /** + * @return Entry point to manage BillingProfiles. + */ + public BillingProfiles billingProfiles() { + if (this.billingProfiles == null) { + this.billingProfiles = new BillingProfilesImpl(this); + } + return this.billingProfiles; + } + + /** + * @return Entry point to manage Customers. + */ + public Customers customers() { + if (this.customers == null) { + this.customers = new CustomersImpl(this); + } + return this.customers; + } + + /** + * @return Entry point to manage InvoiceSections. + */ + public InvoiceSections invoiceSections() { + if (this.invoiceSections == null) { + this.invoiceSections = new InvoiceSectionsImpl(this); + } + return this.invoiceSections; + } + + /** + * @return Entry point to manage BillingPermissions. + */ + public BillingPermissions billingPermissions() { + if (this.billingPermissions == null) { + this.billingPermissions = new BillingPermissionsImpl(this); + } + return this.billingPermissions; + } + + /** + * @return Entry point to manage BillingSubscriptions. + */ + public BillingSubscriptions billingSubscriptions() { + if (this.billingSubscriptions == null) { + this.billingSubscriptions = new BillingSubscriptionsImpl(this); + } + return this.billingSubscriptions; + } + + /** + * @return Entry point to manage Products. + */ + public Products products() { + if (this.products == null) { + this.products = new ProductsImpl(this); + } + return this.products; + } + + /** + * @return Entry point to manage Transactions. + */ + public Transactions transactions() { + if (this.transactions == null) { + this.transactions = new TransactionsImpl(this); + } + return this.transactions; + } + + /** + * @return Entry point to manage Departments. + */ + public Departments departments() { + if (this.departments == null) { + this.departments = new DepartmentsImpl(this); + } + return this.departments; + } + + /** + * @return Entry point to manage EnrollmentAccounts. + */ + public EnrollmentAccounts enrollmentAccounts() { + if (this.enrollmentAccounts == null) { + this.enrollmentAccounts = new EnrollmentAccountsImpl(this); + } + return this.enrollmentAccounts; + } + + /** + * @return Entry point to manage Invoices. + */ + public Invoices invoices() { + if (this.invoices == null) { + this.invoices = new InvoicesImpl(this); + } + return this.invoices; + } + + /** + * @return Entry point to manage PriceSheets. + */ + public PriceSheets priceSheets() { + if (this.priceSheets == null) { + this.priceSheets = new PriceSheetsImpl(this); + } + return this.priceSheets; + } + + /** + * @return Entry point to manage Policies. + */ + public Policies policies() { + if (this.policies == null) { + this.policies = new PoliciesImpl(this); + } + return this.policies; + } + + /** + * @return Entry point to manage BillingPropertys. + */ + public BillingPropertys billingPropertys() { + if (this.billingPropertys == null) { + this.billingPropertys = new BillingPropertysImpl(this); + } + return this.billingPropertys; + } + + /** + * @return Entry point to manage Transfers. + */ + public Transfers transfers() { + if (this.transfers == null) { + this.transfers = new TransfersImpl(this); + } + return this.transfers; + } + + /** + * @return Entry point to manage PartnerTransfers. + */ + public PartnerTransfers partnerTransfers() { + if (this.partnerTransfers == null) { + this.partnerTransfers = new PartnerTransfersImpl(this); + } + return this.partnerTransfers; + } + + /** + * @return Entry point to manage PartnerTransfersTransfers. + */ + public PartnerTransfersTransfers partnerTransfersTransfers() { + if (this.partnerTransfersTransfers == null) { + this.partnerTransfersTransfers = new PartnerTransfersTransfersImpl(this); + } + return this.partnerTransfersTransfers; + } + + /** + * @return Entry point to manage RecipientTransfers. + */ + public RecipientTransfers recipientTransfers() { + if (this.recipientTransfers == null) { + this.recipientTransfers = new RecipientTransfersImpl(this); + } + return this.recipientTransfers; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage BillingRoleDefinitions. + */ + public BillingRoleDefinitions billingRoleDefinitions() { + if (this.billingRoleDefinitions == null) { + this.billingRoleDefinitions = new BillingRoleDefinitionsImpl(this); + } + return this.billingRoleDefinitions; + } + + /** + * @return Entry point to manage BillingRoleAssignments. + */ + public BillingRoleAssignments billingRoleAssignments() { + if (this.billingRoleAssignments == null) { + this.billingRoleAssignments = new BillingRoleAssignmentsImpl(this); + } + return this.billingRoleAssignments; + } + + /** + * @return Entry point to manage Agreements. + */ + public Agreements agreements() { + if (this.agreements == null) { + this.agreements = new AgreementsImpl(this); + } + return this.agreements; + } + + /** + * @return Entry point to manage LineOfCredits. + */ + public LineOfCredits lineOfCredits() { + if (this.lineOfCredits == null) { + this.lineOfCredits = new LineOfCreditsImpl(this); + } + return this.lineOfCredits; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public BillingManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return BillingManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private BillingManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new BillingManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPermissionsImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPermissionsImpl.java new file mode 100644 index 000000000000..5116d44e3d72 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPermissionsImpl.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingPermissions; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingPermissionsListResult; + +class BillingPermissionsImpl extends WrapperImpl implements BillingPermissions { + private final BillingManager manager; + + BillingPermissionsImpl(BillingManager manager) { + super(manager.inner().billingPermissions()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + @Override + public Observable listByCustomerAsync(String billingAccountName, String customerName) { + BillingPermissionsInner client = this.inner(); + return client.listByCustomerAsync(billingAccountName, customerName) + .map(new Func1() { + @Override + public BillingPermissionsListResult call(BillingPermissionsListResultInner inner) { + return new BillingPermissionsListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByBillingAccountAsync(String billingAccountName) { + BillingPermissionsInner client = this.inner(); + return client.listByBillingAccountAsync(billingAccountName) + .map(new Func1() { + @Override + public BillingPermissionsListResult call(BillingPermissionsListResultInner inner) { + return new BillingPermissionsListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByInvoiceSectionsAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + BillingPermissionsInner client = this.inner(); + return client.listByInvoiceSectionsAsync(billingAccountName, billingProfileName, invoiceSectionName) + .map(new Func1() { + @Override + public BillingPermissionsListResult call(BillingPermissionsListResultInner inner) { + return new BillingPermissionsListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByBillingProfileAsync(String billingAccountName, String billingProfileName) { + BillingPermissionsInner client = this.inner(); + return client.listByBillingProfileAsync(billingAccountName, billingProfileName) + .map(new Func1() { + @Override + public BillingPermissionsListResult call(BillingPermissionsListResultInner inner) { + return new BillingPermissionsListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPermissionsInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPermissionsInner.java new file mode 100644 index 000000000000..7bf335b6e1ba --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPermissionsInner.java @@ -0,0 +1,404 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BillingPermissions. + */ +public class BillingPermissionsInner { + /** The Retrofit service to perform REST calls. */ + private BillingPermissionsService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of BillingPermissionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BillingPermissionsInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(BillingPermissionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for BillingPermissions to be + * used by Retrofit to perform actually REST calls. + */ + interface BillingPermissionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingPermissions listByCustomer" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/billingPermissions") + Observable> listByCustomer(@Path("billingAccountName") String billingAccountName, @Path("customerName") String customerName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingPermissions listByBillingAccount" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingPermissions") + Observable> listByBillingAccount(@Path("billingAccountName") String billingAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingPermissions listByInvoiceSections" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingPermissions") + Observable> listByInvoiceSections(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingPermissions listByBillingProfile" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingPermissions") + Observable> listByBillingProfile(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all billing permissions the caller has for a customer. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingPermissionsListResultInner object if successful. + */ + public BillingPermissionsListResultInner listByCustomer(String billingAccountName, String customerName) { + return listByCustomerWithServiceResponseAsync(billingAccountName, customerName).toBlocking().single().body(); + } + + /** + * Lists all billing permissions the caller has for a customer. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByCustomerAsync(String billingAccountName, String customerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByCustomerWithServiceResponseAsync(billingAccountName, customerName), serviceCallback); + } + + /** + * Lists all billing permissions the caller has for a customer. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingPermissionsListResultInner object + */ + public Observable listByCustomerAsync(String billingAccountName, String customerName) { + return listByCustomerWithServiceResponseAsync(billingAccountName, customerName).map(new Func1, BillingPermissionsListResultInner>() { + @Override + public BillingPermissionsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all billing permissions the caller has for a customer. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingPermissionsListResultInner object + */ + public Observable> listByCustomerWithServiceResponseAsync(String billingAccountName, String customerName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (customerName == null) { + throw new IllegalArgumentException("Parameter customerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByCustomer(billingAccountName, customerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByCustomerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByCustomerDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all billing permissions for the caller under a billing account. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingPermissionsListResultInner object if successful. + */ + public BillingPermissionsListResultInner listByBillingAccount(String billingAccountName) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName).toBlocking().single().body(); + } + + /** + * Lists all billing permissions for the caller under a billing account. + * + * @param billingAccountName billing Account Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByBillingAccountAsync(String billingAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingAccountWithServiceResponseAsync(billingAccountName), serviceCallback); + } + + /** + * Lists all billing permissions for the caller under a billing account. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingPermissionsListResultInner object + */ + public Observable listByBillingAccountAsync(String billingAccountName) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName).map(new Func1, BillingPermissionsListResultInner>() { + @Override + public BillingPermissionsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all billing permissions for the caller under a billing account. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingPermissionsListResultInner object + */ + public Observable> listByBillingAccountWithServiceResponseAsync(String billingAccountName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByBillingAccount(billingAccountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByBillingAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByBillingAccountDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all billing permissions for the caller under invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingPermissionsListResultInner object if successful. + */ + public BillingPermissionsListResultInner listByInvoiceSections(String billingAccountName, String billingProfileName, String invoiceSectionName) { + return listByInvoiceSectionsWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName).toBlocking().single().body(); + } + + /** + * Lists all billing permissions for the caller under invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByInvoiceSectionsAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByInvoiceSectionsWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName), serviceCallback); + } + + /** + * Lists all billing permissions for the caller under invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingPermissionsListResultInner object + */ + public Observable listByInvoiceSectionsAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + return listByInvoiceSectionsWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName).map(new Func1, BillingPermissionsListResultInner>() { + @Override + public BillingPermissionsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all billing permissions for the caller under invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingPermissionsListResultInner object + */ + public Observable> listByInvoiceSectionsWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByInvoiceSections(billingAccountName, billingProfileName, invoiceSectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByInvoiceSectionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByInvoiceSectionsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all billing permissions the caller has for a billing account. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingPermissionsListResultInner object if successful. + */ + public BillingPermissionsListResultInner listByBillingProfile(String billingAccountName, String billingProfileName) { + return listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName).toBlocking().single().body(); + } + + /** + * Lists all billing permissions the caller has for a billing account. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByBillingProfileAsync(String billingAccountName, String billingProfileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName), serviceCallback); + } + + /** + * Lists all billing permissions the caller has for a billing account. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingPermissionsListResultInner object + */ + public Observable listByBillingProfileAsync(String billingAccountName, String billingProfileName) { + return listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName).map(new Func1, BillingPermissionsListResultInner>() { + @Override + public BillingPermissionsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all billing permissions the caller has for a billing account. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingPermissionsListResultInner object + */ + public Observable> listByBillingProfileWithServiceResponseAsync(String billingAccountName, String billingProfileName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByBillingProfile(billingAccountName, billingProfileName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByBillingProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByBillingProfileDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPermissionsListResultImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPermissionsListResultImpl.java new file mode 100644 index 000000000000..3aa47d32be2e --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPermissionsListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingPermissionsListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingPermissionsProperties; + +class BillingPermissionsListResultImpl extends WrapperImpl implements BillingPermissionsListResult { + private final BillingManager manager; + BillingPermissionsListResultImpl(BillingPermissionsListResultInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPermissionsListResultInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPermissionsListResultInner.java new file mode 100644 index 000000000000..0bba27416ebd --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPermissionsListResultInner.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingPermissionsProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of list billingPermissions a caller has on a billing account. + */ +public class BillingPermissionsListResultInner { + /** + * The list of billingPermissions a caller has on a billing account. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the list of billingPermissions a caller has on a billing account. + * + * @return the value value + */ + public List value() { + return this.value; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingProfileImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingProfileImpl.java new file mode 100644 index 000000000000..629c29fcbab2 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingProfileImpl.java @@ -0,0 +1,216 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingProfile; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.AddressDetails; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.AzurePlan; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingProfileCreationRequest; +import java.util.ArrayList; +import com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceSection; +import rx.functions.Func1; + +class BillingProfileImpl extends CreatableUpdatableImpl implements BillingProfile, BillingProfile.Definition, BillingProfile.Update { + private final BillingManager manager; + private String billingAccountName; + private String billingProfileName; + private BillingProfileCreationRequest createParameter; + + BillingProfileImpl(String name, BillingManager manager) { + super(name, new BillingProfileInner()); + this.manager = manager; + // Set resource name + this.billingProfileName = name; + // + this.createParameter = new BillingProfileCreationRequest(); + } + + BillingProfileImpl(BillingProfileInner inner, BillingManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.billingProfileName = inner.name(); + // set resource ancestor and positional variables + this.billingAccountName = IdParsingUtils.getValueFromIdByName(inner.id(), "billingAccounts"); + this.billingProfileName = IdParsingUtils.getValueFromIdByName(inner.id(), "billingProfiles"); + // + this.createParameter = new BillingProfileCreationRequest(); + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + BillingProfilesInner client = this.manager().inner().billingProfiles(); + return client.createAsync(this.billingAccountName, this.billingProfileName, this.createParameter) + .map(new Func1() { + @Override + public BillingProfileInner call(BillingProfileInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + BillingProfilesInner client = this.manager().inner().billingProfiles(); + return client.updateAsync(this.billingAccountName, this.billingProfileName, this.inner()) + .map(new Func1() { + @Override + public BillingProfileInner call(BillingProfileInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + BillingProfilesInner client = this.manager().inner().billingProfiles(); + return client.getAsync(this.billingAccountName, this.billingProfileName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new BillingProfileCreationRequest(); + } + + @Override + public AddressDetails address() { + return this.inner().address(); + } + + @Override + public String currency() { + return this.inner().currency(); + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public List enabledAzurePlans() { + return this.inner().enabledAzurePlans(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Integer invoiceDay() { + return this.inner().invoiceDay(); + } + + @Override + public Boolean invoiceEmailOptIn() { + return this.inner().invoiceEmailOptIn(); + } + + @Override + public List invoiceSections() { + List lst = new ArrayList(); + if (this.inner().invoiceSections() != null) { + for (InvoiceSectionInner inner : this.inner().invoiceSections()) { + lst.add( new InvoiceSectionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String poNumber() { + return this.inner().poNumber(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public BillingProfileImpl withExistingBillingAccount(String billingAccountName) { + this.billingAccountName = billingAccountName; + return this; + } + + @Override + public BillingProfileImpl withInvoiceEmailOptIn(Boolean invoiceEmailOptIn) { + this.createParameter.withInvoiceEmailOptIn(invoiceEmailOptIn); + return this; + } + + @Override + public BillingProfileImpl withInvoiceSections(List invoiceSections) { + this.inner().withInvoiceSections(invoiceSections); + return this; + } + + @Override + public BillingProfileImpl withAddress(AddressDetails address) { + if (isInCreateMode()) { + this.createParameter.withAddress(address); + } else { + this.inner().withAddress(address); + } + return this; + } + + @Override + public BillingProfileImpl withDisplayName(String displayName) { + if (isInCreateMode()) { + this.createParameter.withDisplayName(displayName); + } else { + this.inner().withDisplayName(displayName); + } + return this; + } + + @Override + public BillingProfileImpl withEnabledAzurePlans(List enabledAzurePlans) { + if (isInCreateMode()) { + this.createParameter.withEnabledAzurePlans(enabledAzurePlans); + } else { + this.inner().withEnabledAzurePlans(enabledAzurePlans); + } + return this; + } + + @Override + public BillingProfileImpl withPoNumber(String poNumber) { + if (isInCreateMode()) { + this.createParameter.withPoNumber(poNumber); + } else { + this.inner().withPoNumber(poNumber); + } + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingProfileInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingProfileInner.java new file mode 100644 index 000000000000..983711a55263 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingProfileInner.java @@ -0,0 +1,198 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.AddressDetails; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.AzurePlan; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A billing profile resource. + */ +@JsonFlatten +public class BillingProfileInner extends ProxyResource { + /** + * The billing profile name. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * Purchase order number. + */ + @JsonProperty(value = "properties.poNumber") + private String poNumber; + + /** + * Billing address. + */ + @JsonProperty(value = "properties.address") + private AddressDetails address; + + /** + * If the billing profile is opted in to receive invoices via email. + */ + @JsonProperty(value = "properties.invoiceEmailOptIn", access = JsonProperty.Access.WRITE_ONLY) + private Boolean invoiceEmailOptIn; + + /** + * Invoice day. + */ + @JsonProperty(value = "properties.invoiceDay", access = JsonProperty.Access.WRITE_ONLY) + private Integer invoiceDay; + + /** + * The currency associated with the billing profile. + */ + @JsonProperty(value = "properties.currency", access = JsonProperty.Access.WRITE_ONLY) + private String currency; + + /** + * Information about the enabled azure plans. + */ + @JsonProperty(value = "properties.enabledAzurePlans") + private List enabledAzurePlans; + + /** + * The invoice sections associated to the billing profile. + */ + @JsonProperty(value = "properties.invoiceSections") + private List invoiceSections; + + /** + * Get the billing profile name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the billing profile name. + * + * @param displayName the displayName value to set + * @return the BillingProfileInner object itself. + */ + public BillingProfileInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get purchase order number. + * + * @return the poNumber value + */ + public String poNumber() { + return this.poNumber; + } + + /** + * Set purchase order number. + * + * @param poNumber the poNumber value to set + * @return the BillingProfileInner object itself. + */ + public BillingProfileInner withPoNumber(String poNumber) { + this.poNumber = poNumber; + return this; + } + + /** + * Get billing address. + * + * @return the address value + */ + public AddressDetails address() { + return this.address; + } + + /** + * Set billing address. + * + * @param address the address value to set + * @return the BillingProfileInner object itself. + */ + public BillingProfileInner withAddress(AddressDetails address) { + this.address = address; + return this; + } + + /** + * Get if the billing profile is opted in to receive invoices via email. + * + * @return the invoiceEmailOptIn value + */ + public Boolean invoiceEmailOptIn() { + return this.invoiceEmailOptIn; + } + + /** + * Get invoice day. + * + * @return the invoiceDay value + */ + public Integer invoiceDay() { + return this.invoiceDay; + } + + /** + * Get the currency associated with the billing profile. + * + * @return the currency value + */ + public String currency() { + return this.currency; + } + + /** + * Get information about the enabled azure plans. + * + * @return the enabledAzurePlans value + */ + public List enabledAzurePlans() { + return this.enabledAzurePlans; + } + + /** + * Set information about the enabled azure plans. + * + * @param enabledAzurePlans the enabledAzurePlans value to set + * @return the BillingProfileInner object itself. + */ + public BillingProfileInner withEnabledAzurePlans(List enabledAzurePlans) { + this.enabledAzurePlans = enabledAzurePlans; + return this; + } + + /** + * Get the invoice sections associated to the billing profile. + * + * @return the invoiceSections value + */ + public List invoiceSections() { + return this.invoiceSections; + } + + /** + * Set the invoice sections associated to the billing profile. + * + * @param invoiceSections the invoiceSections value to set + * @return the BillingProfileInner object itself. + */ + public BillingProfileInner withInvoiceSections(List invoiceSections) { + this.invoiceSections = invoiceSections; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingProfileListResultImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingProfileListResultImpl.java new file mode 100644 index 000000000000..ac5f07f76d4e --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingProfileListResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingProfileListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class BillingProfileListResultImpl extends WrapperImpl implements BillingProfileListResult { + private final BillingManager manager; + BillingProfileListResultImpl(BillingProfileListResultInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingProfileListResultInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingProfileListResultInner.java new file mode 100644 index 000000000000..1dbcea8c78f2 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingProfileListResultInner.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of listing billing profiles. + */ +public class BillingProfileListResultInner { + /** + * The list of billing profiles. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the list of billing profiles. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Get the link (url) to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingProfilesImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingProfilesImpl.java new file mode 100644 index 000000000000..afc131f5d3ff --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingProfilesImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingProfiles; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingProfileListResult; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingProfile; + +class BillingProfilesImpl extends WrapperImpl implements BillingProfiles { + private final BillingManager manager; + + BillingProfilesImpl(BillingManager manager) { + super(manager.inner().billingProfiles()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + @Override + public BillingProfileImpl define(String name) { + return wrapModel(name); + } + + private BillingProfileImpl wrapModel(BillingProfileInner inner) { + return new BillingProfileImpl(inner, manager()); + } + + private BillingProfileImpl wrapModel(String name) { + return new BillingProfileImpl(name, this.manager()); + } + + @Override + public Observable listByBillingAccountAsync(String billingAccountName) { + BillingProfilesInner client = this.inner(); + return client.listByBillingAccountAsync(billingAccountName) + .map(new Func1() { + @Override + public BillingProfileListResult call(BillingProfileListResultInner inner) { + return new BillingProfileListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String billingAccountName, String billingProfileName) { + BillingProfilesInner client = this.inner(); + return client.getAsync(billingAccountName, billingProfileName) + .map(new Func1() { + @Override + public BillingProfile call(BillingProfileInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingProfilesInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingProfilesInner.java new file mode 100644 index 000000000000..3b0c215e6685 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingProfilesInner.java @@ -0,0 +1,734 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingProfileCreationRequest; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingProfilesCreateHeaders; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingProfilesUpdateHeaders; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BillingProfiles. + */ +public class BillingProfilesInner { + /** The Retrofit service to perform REST calls. */ + private BillingProfilesService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of BillingProfilesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BillingProfilesInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(BillingProfilesService.class); + this.client = client; + } + + /** + * The interface defining all the services for BillingProfiles to be + * used by Retrofit to perform actually REST calls. + */ + interface BillingProfilesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingProfiles listByBillingAccount" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles") + Observable> listByBillingAccount(@Path("billingAccountName") String billingAccountName, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingProfiles get" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}") + Observable> get(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingProfiles create" }) + @PUT("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}") + Observable> create(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Query("api-version") String apiVersion, @Body BillingProfileCreationRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingProfiles beginCreate" }) + @PUT("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}") + Observable> beginCreate(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Query("api-version") String apiVersion, @Body BillingProfileCreationRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingProfiles update" }) + @PATCH("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}") + Observable> update(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Query("api-version") String apiVersion, @Body BillingProfileInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingProfiles beginUpdate" }) + @PATCH("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}") + Observable> beginUpdate(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Query("api-version") String apiVersion, @Body BillingProfileInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all billing profiles for a user which that user has access to. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingProfileListResultInner object if successful. + */ + public BillingProfileListResultInner listByBillingAccount(String billingAccountName) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName).toBlocking().single().body(); + } + + /** + * Lists all billing profiles for a user which that user has access to. + * + * @param billingAccountName billing Account Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByBillingAccountAsync(String billingAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingAccountWithServiceResponseAsync(billingAccountName), serviceCallback); + } + + /** + * Lists all billing profiles for a user which that user has access to. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingProfileListResultInner object + */ + public Observable listByBillingAccountAsync(String billingAccountName) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName).map(new Func1, BillingProfileListResultInner>() { + @Override + public BillingProfileListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all billing profiles for a user which that user has access to. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingProfileListResultInner object + */ + public Observable> listByBillingAccountWithServiceResponseAsync(String billingAccountName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + return service.listByBillingAccount(billingAccountName, this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByBillingAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists all billing profiles for a user which that user has access to. + * + * @param billingAccountName billing Account Id. + * @param expand May be used to expand the invoiceSections. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingProfileListResultInner object if successful. + */ + public BillingProfileListResultInner listByBillingAccount(String billingAccountName, String expand) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName, expand).toBlocking().single().body(); + } + + /** + * Lists all billing profiles for a user which that user has access to. + * + * @param billingAccountName billing Account Id. + * @param expand May be used to expand the invoiceSections. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByBillingAccountAsync(String billingAccountName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingAccountWithServiceResponseAsync(billingAccountName, expand), serviceCallback); + } + + /** + * Lists all billing profiles for a user which that user has access to. + * + * @param billingAccountName billing Account Id. + * @param expand May be used to expand the invoiceSections. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingProfileListResultInner object + */ + public Observable listByBillingAccountAsync(String billingAccountName, String expand) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName, expand).map(new Func1, BillingProfileListResultInner>() { + @Override + public BillingProfileListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all billing profiles for a user which that user has access to. + * + * @param billingAccountName billing Account Id. + * @param expand May be used to expand the invoiceSections. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingProfileListResultInner object + */ + public Observable> listByBillingAccountWithServiceResponseAsync(String billingAccountName, String expand) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByBillingAccount(billingAccountName, this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByBillingAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByBillingAccountDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get the billing profile by id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingProfileInner object if successful. + */ + public BillingProfileInner get(String billingAccountName, String billingProfileName) { + return getWithServiceResponseAsync(billingAccountName, billingProfileName).toBlocking().single().body(); + } + + /** + * Get the billing profile by id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String billingAccountName, String billingProfileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(billingAccountName, billingProfileName), serviceCallback); + } + + /** + * Get the billing profile by id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingProfileInner object + */ + public Observable getAsync(String billingAccountName, String billingProfileName) { + return getWithServiceResponseAsync(billingAccountName, billingProfileName).map(new Func1, BillingProfileInner>() { + @Override + public BillingProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the billing profile by id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingProfileInner object + */ + public Observable> getWithServiceResponseAsync(String billingAccountName, String billingProfileName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + return service.get(billingAccountName, billingProfileName, this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the billing profile by id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param expand May be used to expand the invoiceSections. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingProfileInner object if successful. + */ + public BillingProfileInner get(String billingAccountName, String billingProfileName, String expand) { + return getWithServiceResponseAsync(billingAccountName, billingProfileName, expand).toBlocking().single().body(); + } + + /** + * Get the billing profile by id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param expand May be used to expand the invoiceSections. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String billingAccountName, String billingProfileName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(billingAccountName, billingProfileName, expand), serviceCallback); + } + + /** + * Get the billing profile by id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param expand May be used to expand the invoiceSections. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingProfileInner object + */ + public Observable getAsync(String billingAccountName, String billingProfileName, String expand) { + return getWithServiceResponseAsync(billingAccountName, billingProfileName, expand).map(new Func1, BillingProfileInner>() { + @Override + public BillingProfileInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the billing profile by id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param expand May be used to expand the invoiceSections. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingProfileInner object + */ + public Observable> getWithServiceResponseAsync(String billingAccountName, String billingProfileName, String expand) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(billingAccountName, billingProfileName, this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * The operation to create a BillingProfile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Request parameters supplied to the Create BillingProfile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingProfileInner object if successful. + */ + public BillingProfileInner create(String billingAccountName, String billingProfileName, BillingProfileCreationRequest parameters) { + return createWithServiceResponseAsync(billingAccountName, billingProfileName, parameters).toBlocking().last().body(); + } + + /** + * The operation to create a BillingProfile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Request parameters supplied to the Create BillingProfile operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String billingAccountName, String billingProfileName, BillingProfileCreationRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(createWithServiceResponseAsync(billingAccountName, billingProfileName, parameters), serviceCallback); + } + + /** + * The operation to create a BillingProfile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Request parameters supplied to the Create BillingProfile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String billingAccountName, String billingProfileName, BillingProfileCreationRequest parameters) { + return createWithServiceResponseAsync(billingAccountName, billingProfileName, parameters).map(new Func1, BillingProfileInner>() { + @Override + public BillingProfileInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * The operation to create a BillingProfile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Request parameters supplied to the Create BillingProfile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String billingAccountName, String billingProfileName, BillingProfileCreationRequest parameters) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(billingAccountName, billingProfileName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), BillingProfilesCreateHeaders.class); + } + + /** + * The operation to create a BillingProfile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Request parameters supplied to the Create BillingProfile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingProfileInner object if successful. + */ + public BillingProfileInner beginCreate(String billingAccountName, String billingProfileName, BillingProfileCreationRequest parameters) { + return beginCreateWithServiceResponseAsync(billingAccountName, billingProfileName, parameters).toBlocking().single().body(); + } + + /** + * The operation to create a BillingProfile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Request parameters supplied to the Create BillingProfile operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String billingAccountName, String billingProfileName, BillingProfileCreationRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginCreateWithServiceResponseAsync(billingAccountName, billingProfileName, parameters), serviceCallback); + } + + /** + * The operation to create a BillingProfile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Request parameters supplied to the Create BillingProfile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingProfileInner object + */ + public Observable beginCreateAsync(String billingAccountName, String billingProfileName, BillingProfileCreationRequest parameters) { + return beginCreateWithServiceResponseAsync(billingAccountName, billingProfileName, parameters).map(new Func1, BillingProfileInner>() { + @Override + public BillingProfileInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * The operation to create a BillingProfile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Request parameters supplied to the Create BillingProfile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingProfileInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String billingAccountName, String billingProfileName, BillingProfileCreationRequest parameters) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(billingAccountName, billingProfileName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .buildWithHeaders(response, BillingProfilesCreateHeaders.class); + } + + /** + * The operation to update a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Request parameters supplied to the update billing profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingProfileInner object if successful. + */ + public BillingProfileInner update(String billingAccountName, String billingProfileName, BillingProfileInner parameters) { + return updateWithServiceResponseAsync(billingAccountName, billingProfileName, parameters).toBlocking().last().body(); + } + + /** + * The operation to update a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Request parameters supplied to the update billing profile operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String billingAccountName, String billingProfileName, BillingProfileInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(updateWithServiceResponseAsync(billingAccountName, billingProfileName, parameters), serviceCallback); + } + + /** + * The operation to update a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Request parameters supplied to the update billing profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String billingAccountName, String billingProfileName, BillingProfileInner parameters) { + return updateWithServiceResponseAsync(billingAccountName, billingProfileName, parameters).map(new Func1, BillingProfileInner>() { + @Override + public BillingProfileInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * The operation to update a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Request parameters supplied to the update billing profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String billingAccountName, String billingProfileName, BillingProfileInner parameters) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(billingAccountName, billingProfileName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), BillingProfilesUpdateHeaders.class); + } + + /** + * The operation to update a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Request parameters supplied to the update billing profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingProfileInner object if successful. + */ + public BillingProfileInner beginUpdate(String billingAccountName, String billingProfileName, BillingProfileInner parameters) { + return beginUpdateWithServiceResponseAsync(billingAccountName, billingProfileName, parameters).toBlocking().single().body(); + } + + /** + * The operation to update a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Request parameters supplied to the update billing profile operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String billingAccountName, String billingProfileName, BillingProfileInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginUpdateWithServiceResponseAsync(billingAccountName, billingProfileName, parameters), serviceCallback); + } + + /** + * The operation to update a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Request parameters supplied to the update billing profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingProfileInner object + */ + public Observable beginUpdateAsync(String billingAccountName, String billingProfileName, BillingProfileInner parameters) { + return beginUpdateWithServiceResponseAsync(billingAccountName, billingProfileName, parameters).map(new Func1, BillingProfileInner>() { + @Override + public BillingProfileInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * The operation to update a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Request parameters supplied to the update billing profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingProfileInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String billingAccountName, String billingProfileName, BillingProfileInner parameters) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(billingAccountName, billingProfileName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .buildWithHeaders(response, BillingProfilesUpdateHeaders.class); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPropertyImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPropertyImpl.java new file mode 100644 index 000000000000..6d0f735b80f5 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPropertyImpl.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingProperty; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class BillingPropertyImpl extends WrapperImpl implements BillingProperty { + private final BillingManager manager; + BillingPropertyImpl(BillingPropertyInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public String billingAccountDisplayName() { + return this.inner().billingAccountDisplayName(); + } + + @Override + public String billingAccountId() { + return this.inner().billingAccountId(); + } + + @Override + public String billingProfileDisplayName() { + return this.inner().billingProfileDisplayName(); + } + + @Override + public String billingProfileId() { + return this.inner().billingProfileId(); + } + + @Override + public String billingTenantId() { + return this.inner().billingTenantId(); + } + + @Override + public String costCenter() { + return this.inner().costCenter(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String invoiceSectionDisplayName() { + return this.inner().invoiceSectionDisplayName(); + } + + @Override + public String invoiceSectionId() { + return this.inner().invoiceSectionId(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String productId() { + return this.inner().productId(); + } + + @Override + public String productName() { + return this.inner().productName(); + } + + @Override + public String skuDescription() { + return this.inner().skuDescription(); + } + + @Override + public String skuId() { + return this.inner().skuId(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPropertyInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPropertyInner.java new file mode 100644 index 000000000000..25df960a826b --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPropertyInner.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A billing property resource. + */ +@JsonFlatten +public class BillingPropertyInner extends ProxyResource { + /** + * Billing tenant Id. + */ + @JsonProperty(value = "properties.billingTenantId", access = JsonProperty.Access.WRITE_ONLY) + private String billingTenantId; + + /** + * Billing account Id. + */ + @JsonProperty(value = "properties.billingAccountId", access = JsonProperty.Access.WRITE_ONLY) + private String billingAccountId; + + /** + * Billing account display name. + */ + @JsonProperty(value = "properties.billingAccountDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String billingAccountDisplayName; + + /** + * Billing profile Id. + */ + @JsonProperty(value = "properties.billingProfileId", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileId; + + /** + * Billing profile display name. + */ + @JsonProperty(value = "properties.billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileDisplayName; + + /** + * Cost center name. + */ + @JsonProperty(value = "properties.costCenter", access = JsonProperty.Access.WRITE_ONLY) + private String costCenter; + + /** + * Invoice Section Id. + */ + @JsonProperty(value = "properties.invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionId; + + /** + * Invoice Section display name. + */ + @JsonProperty(value = "properties.invoiceSectionDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionDisplayName; + + /** + * Product Id. + */ + @JsonProperty(value = "properties.productId", access = JsonProperty.Access.WRITE_ONLY) + private String productId; + + /** + * Product name. + */ + @JsonProperty(value = "properties.productName", access = JsonProperty.Access.WRITE_ONLY) + private String productName; + + /** + * SKU Id. + */ + @JsonProperty(value = "properties.skuId", access = JsonProperty.Access.WRITE_ONLY) + private String skuId; + + /** + * SKU description. + */ + @JsonProperty(value = "properties.skuDescription", access = JsonProperty.Access.WRITE_ONLY) + private String skuDescription; + + /** + * Get billing tenant Id. + * + * @return the billingTenantId value + */ + public String billingTenantId() { + return this.billingTenantId; + } + + /** + * Get billing account Id. + * + * @return the billingAccountId value + */ + public String billingAccountId() { + return this.billingAccountId; + } + + /** + * Get billing account display name. + * + * @return the billingAccountDisplayName value + */ + public String billingAccountDisplayName() { + return this.billingAccountDisplayName; + } + + /** + * Get billing profile Id. + * + * @return the billingProfileId value + */ + public String billingProfileId() { + return this.billingProfileId; + } + + /** + * Get billing profile display name. + * + * @return the billingProfileDisplayName value + */ + public String billingProfileDisplayName() { + return this.billingProfileDisplayName; + } + + /** + * Get cost center name. + * + * @return the costCenter value + */ + public String costCenter() { + return this.costCenter; + } + + /** + * Get invoice Section Id. + * + * @return the invoiceSectionId value + */ + public String invoiceSectionId() { + return this.invoiceSectionId; + } + + /** + * Get invoice Section display name. + * + * @return the invoiceSectionDisplayName value + */ + public String invoiceSectionDisplayName() { + return this.invoiceSectionDisplayName; + } + + /** + * Get product Id. + * + * @return the productId value + */ + public String productId() { + return this.productId; + } + + /** + * Get product name. + * + * @return the productName value + */ + public String productName() { + return this.productName; + } + + /** + * Get sKU Id. + * + * @return the skuId value + */ + public String skuId() { + return this.skuId; + } + + /** + * Get sKU description. + * + * @return the skuDescription value + */ + public String skuDescription() { + return this.skuDescription; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPropertysImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPropertysImpl.java new file mode 100644 index 000000000000..e3b5c9149fe7 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPropertysImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingPropertys; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingProperty; + +class BillingPropertysImpl extends WrapperImpl implements BillingPropertys { + private final BillingManager manager; + + BillingPropertysImpl(BillingManager manager) { + super(manager.inner().billingPropertys()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + @Override + public Observable getAsync() { + BillingPropertysInner client = this.inner(); + return client.getAsync() + .map(new Func1() { + @Override + public BillingProperty call(BillingPropertyInner inner) { + return new BillingPropertyImpl(inner, manager()); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPropertysInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPropertysInner.java new file mode 100644 index 000000000000..ed22d589280d --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingPropertysInner.java @@ -0,0 +1,132 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BillingPropertys. + */ +public class BillingPropertysInner { + /** The Retrofit service to perform REST calls. */ + private BillingPropertysService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of BillingPropertysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BillingPropertysInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(BillingPropertysService.class); + this.client = client; + } + + /** + * The interface defining all the services for BillingPropertys to be + * used by Retrofit to perform actually REST calls. + */ + interface BillingPropertysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingPropertys get" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingProperty/default") + Observable> get(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get billing property by subscription Id. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingPropertyInner object if successful. + */ + public BillingPropertyInner get() { + return getWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get billing property by subscription Id. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get billing property by subscription Id. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingPropertyInner object + */ + public Observable getAsync() { + return getWithServiceResponseAsync().map(new Func1, BillingPropertyInner>() { + @Override + public BillingPropertyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get billing property by subscription Id. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingPropertyInner object + */ + public Observable> getWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleAssignmentImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleAssignmentImpl.java new file mode 100644 index 000000000000..7f7de87ef61a --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleAssignmentImpl.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleAssignment; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; + +class BillingRoleAssignmentImpl extends IndexableRefreshableWrapperImpl implements BillingRoleAssignment { + private final BillingManager manager; + private String billingAccountName; + private String billingRoleAssignmentName; + + BillingRoleAssignmentImpl(BillingRoleAssignmentInner inner, BillingManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.billingAccountName = IdParsingUtils.getValueFromIdByName(inner.id(), "billingAccounts"); + this.billingRoleAssignmentName = IdParsingUtils.getValueFromIdByName(inner.id(), "billingRoleAssignments"); + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + BillingRoleAssignmentsInner client = this.manager().inner().billingRoleAssignments(); + return client.getByBillingAccountAsync(this.billingAccountName, this.billingRoleAssignmentName); + } + + + + @Override + public String billingRoleAssignmentName() { + return this.inner().billingRoleAssignmentName(); + } + + @Override + public String createdByPrincipalId() { + return this.inner().createdByPrincipalId(); + } + + @Override + public String createdByPrincipalTenantId() { + return this.inner().createdByPrincipalTenantId(); + } + + @Override + public String createdOn() { + return this.inner().createdOn(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String principalId() { + return this.inner().principalId(); + } + + @Override + public String roleDefinitionName() { + return this.inner().roleDefinitionName(); + } + + @Override + public String scope() { + return this.inner().scope(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleAssignmentInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleAssignmentInner.java new file mode 100644 index 000000000000..2c9d13dccbde --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleAssignmentInner.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * a role assignment. + */ +@JsonFlatten +public class BillingRoleAssignmentInner extends ProxyResource { + /** + * the date the role assignment is created. + */ + @JsonProperty(value = "properties.createdOn", access = JsonProperty.Access.WRITE_ONLY) + private String createdOn; + + /** + * the creator's tenant Id. + */ + @JsonProperty(value = "properties.createdByPrincipalTenantId", access = JsonProperty.Access.WRITE_ONLY) + private String createdByPrincipalTenantId; + + /** + * the creator's principal Id. + */ + @JsonProperty(value = "properties.createdByPrincipalId", access = JsonProperty.Access.WRITE_ONLY) + private String createdByPrincipalId; + + /** + * the name of the role assignment. + */ + @JsonProperty(value = "properties.name", access = JsonProperty.Access.WRITE_ONLY) + private String billingRoleAssignmentName; + + /** + * The user's principal id that the role gets assigned to. + */ + @JsonProperty(value = "properties.principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The role definition id. + */ + @JsonProperty(value = "properties.roleDefinitionName", access = JsonProperty.Access.WRITE_ONLY) + private String roleDefinitionName; + + /** + * The scope the role get assigned to. + */ + @JsonProperty(value = "properties.scope", access = JsonProperty.Access.WRITE_ONLY) + private String scope; + + /** + * Get the date the role assignment is created. + * + * @return the createdOn value + */ + public String createdOn() { + return this.createdOn; + } + + /** + * Get the creator's tenant Id. + * + * @return the createdByPrincipalTenantId value + */ + public String createdByPrincipalTenantId() { + return this.createdByPrincipalTenantId; + } + + /** + * Get the creator's principal Id. + * + * @return the createdByPrincipalId value + */ + public String createdByPrincipalId() { + return this.createdByPrincipalId; + } + + /** + * Get the name of the role assignment. + * + * @return the billingRoleAssignmentName value + */ + public String billingRoleAssignmentName() { + return this.billingRoleAssignmentName; + } + + /** + * Get the user's principal id that the role gets assigned to. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the role definition id. + * + * @return the roleDefinitionName value + */ + public String roleDefinitionName() { + return this.roleDefinitionName; + } + + /** + * Get the scope the role get assigned to. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleAssignmentListResultImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleAssignmentListResultImpl.java new file mode 100644 index 000000000000..806ffab7a9b8 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleAssignmentListResultImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleAssignmentListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class BillingRoleAssignmentListResultImpl extends WrapperImpl implements BillingRoleAssignmentListResult { + private final BillingManager manager; + BillingRoleAssignmentListResultImpl(BillingRoleAssignmentListResultInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleAssignmentListResultInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleAssignmentListResultInner.java new file mode 100644 index 000000000000..4753d00ace6e --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleAssignmentListResultInner.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of get list of role assignments. + */ +public class BillingRoleAssignmentListResultInner { + /** + * The list role assignments. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the list role assignments. + * + * @return the value value + */ + public List value() { + return this.value; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleAssignmentsImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleAssignmentsImpl.java new file mode 100644 index 000000000000..a606b7762ea5 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleAssignmentsImpl.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleAssignments; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleAssignment; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleAssignmentListResult; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleAssignmentPayload; + +class BillingRoleAssignmentsImpl extends WrapperImpl implements BillingRoleAssignments { + private final BillingManager manager; + + BillingRoleAssignmentsImpl(BillingManager manager) { + super(manager.inner().billingRoleAssignments()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + private BillingRoleAssignmentImpl wrapModel(BillingRoleAssignmentInner inner) { + return new BillingRoleAssignmentImpl(inner, manager()); + } + + @Override + public Observable getByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingRoleAssignmentName) { + BillingRoleAssignmentsInner client = this.inner(); + return client.getByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName) + .map(new Func1() { + @Override + public BillingRoleAssignment call(BillingRoleAssignmentInner inner) { + return new BillingRoleAssignmentImpl(inner, manager()); + } + }); + } + + @Override + public Observable deleteByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingRoleAssignmentName) { + BillingRoleAssignmentsInner client = this.inner(); + return client.deleteByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName) + .map(new Func1() { + @Override + public BillingRoleAssignment call(BillingRoleAssignmentInner inner) { + return new BillingRoleAssignmentImpl(inner, manager()); + } + }); + } + + @Override + public Observable getByBillingProfileAsync(String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { + BillingRoleAssignmentsInner client = this.inner(); + return client.getByBillingProfileAsync(billingAccountName, billingProfileName, billingRoleAssignmentName) + .map(new Func1() { + @Override + public BillingRoleAssignment call(BillingRoleAssignmentInner inner) { + return new BillingRoleAssignmentImpl(inner, manager()); + } + }); + } + + @Override + public Observable deleteByBillingProfileAsync(String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { + BillingRoleAssignmentsInner client = this.inner(); + return client.deleteByBillingProfileAsync(billingAccountName, billingProfileName, billingRoleAssignmentName) + .map(new Func1() { + @Override + public BillingRoleAssignment call(BillingRoleAssignmentInner inner) { + return new BillingRoleAssignmentImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByBillingAccountAsync(String billingAccountName) { + BillingRoleAssignmentsInner client = this.inner(); + return client.listByBillingAccountAsync(billingAccountName) + .map(new Func1() { + @Override + public BillingRoleAssignmentListResult call(BillingRoleAssignmentListResultInner inner) { + return new BillingRoleAssignmentListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + BillingRoleAssignmentsInner client = this.inner(); + return client.listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName) + .map(new Func1() { + @Override + public BillingRoleAssignmentListResult call(BillingRoleAssignmentListResultInner inner) { + return new BillingRoleAssignmentListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByBillingProfileAsync(String billingAccountName, String billingProfileName) { + BillingRoleAssignmentsInner client = this.inner(); + return client.listByBillingProfileAsync(billingAccountName, billingProfileName) + .map(new Func1() { + @Override + public BillingRoleAssignmentListResult call(BillingRoleAssignmentListResultInner inner) { + return new BillingRoleAssignmentListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getByBillingAccountAsync(String billingAccountName, String billingRoleAssignmentName) { + BillingRoleAssignmentsInner client = this.inner(); + return client.getByBillingAccountAsync(billingAccountName, billingRoleAssignmentName) + .map(new Func1() { + @Override + public BillingRoleAssignment call(BillingRoleAssignmentInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteByBillingAccountAsync(String billingAccountName, String billingRoleAssignmentName) { + BillingRoleAssignmentsInner client = this.inner(); + return client.deleteByBillingAccountAsync(billingAccountName, billingRoleAssignmentName).toCompletable(); + } + + @Override + public Observable addByBillingAccountAsync(String billingAccountName, BillingRoleAssignmentPayload parameters) { + BillingRoleAssignmentsInner client = this.inner(); + return client.addByBillingAccountAsync(billingAccountName, parameters) + .map(new Func1() { + @Override + public BillingRoleAssignmentListResult call(BillingRoleAssignmentListResultInner inner) { + return new BillingRoleAssignmentListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable addByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, BillingRoleAssignmentPayload parameters) { + BillingRoleAssignmentsInner client = this.inner(); + return client.addByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters) + .map(new Func1() { + @Override + public BillingRoleAssignmentListResult call(BillingRoleAssignmentListResultInner inner) { + return new BillingRoleAssignmentListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable addByBillingProfileAsync(String billingAccountName, String billingProfileName, BillingRoleAssignmentPayload parameters) { + BillingRoleAssignmentsInner client = this.inner(); + return client.addByBillingProfileAsync(billingAccountName, billingProfileName, parameters) + .map(new Func1() { + @Override + public BillingRoleAssignmentListResult call(BillingRoleAssignmentListResultInner inner) { + return new BillingRoleAssignmentListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleAssignmentsInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleAssignmentsInner.java new file mode 100644 index 000000000000..e2271d494601 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleAssignmentsInner.java @@ -0,0 +1,1171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleAssignmentPayload; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BillingRoleAssignments. + */ +public class BillingRoleAssignmentsInner { + /** The Retrofit service to perform REST calls. */ + private BillingRoleAssignmentsService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of BillingRoleAssignmentsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BillingRoleAssignmentsInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(BillingRoleAssignmentsService.class); + this.client = client; + } + + /** + * The interface defining all the services for BillingRoleAssignments to be + * used by Retrofit to perform actually REST calls. + */ + interface BillingRoleAssignmentsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleAssignments getByBillingAccount" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}") + Observable> getByBillingAccount(@Path("billingAccountName") String billingAccountName, @Path("billingRoleAssignmentName") String billingRoleAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleAssignments deleteByBillingAccount" }) + @HTTP(path = "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}", method = "DELETE", hasBody = true) + Observable> deleteByBillingAccount(@Path("billingAccountName") String billingAccountName, @Path("billingRoleAssignmentName") String billingRoleAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleAssignments getByInvoiceSection" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}") + Observable> getByInvoiceSection(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Path("billingRoleAssignmentName") String billingRoleAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleAssignments deleteByInvoiceSection" }) + @HTTP(path = "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}", method = "DELETE", hasBody = true) + Observable> deleteByInvoiceSection(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Path("billingRoleAssignmentName") String billingRoleAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleAssignments getByBillingProfile" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}") + Observable> getByBillingProfile(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("billingRoleAssignmentName") String billingRoleAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleAssignments deleteByBillingProfile" }) + @HTTP(path = "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}", method = "DELETE", hasBody = true) + Observable> deleteByBillingProfile(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("billingRoleAssignmentName") String billingRoleAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleAssignments listByBillingAccount" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments") + Observable> listByBillingAccount(@Path("billingAccountName") String billingAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleAssignments addByBillingAccount" }) + @POST("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/createBillingRoleAssignment") + Observable> addByBillingAccount(@Path("billingAccountName") String billingAccountName, @Query("api-version") String apiVersion, @Body BillingRoleAssignmentPayload parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleAssignments listByInvoiceSection" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments") + Observable> listByInvoiceSection(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleAssignments addByInvoiceSection" }) + @POST("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/createBillingRoleAssignment") + Observable> addByInvoiceSection(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Query("api-version") String apiVersion, @Body BillingRoleAssignmentPayload parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleAssignments listByBillingProfile" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments") + Observable> listByBillingProfile(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleAssignments addByBillingProfile" }) + @POST("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/createBillingRoleAssignment") + Observable> addByBillingProfile(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Query("api-version") String apiVersion, @Body BillingRoleAssignmentPayload parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the role assignment for the caller. + * + * @param billingAccountName billing Account Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingRoleAssignmentInner object if successful. + */ + public BillingRoleAssignmentInner getByBillingAccount(String billingAccountName, String billingRoleAssignmentName) { + return getByBillingAccountWithServiceResponseAsync(billingAccountName, billingRoleAssignmentName).toBlocking().single().body(); + } + + /** + * Get the role assignment for the caller. + * + * @param billingAccountName billing Account Id. + * @param billingRoleAssignmentName role assignment id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByBillingAccountAsync(String billingAccountName, String billingRoleAssignmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByBillingAccountWithServiceResponseAsync(billingAccountName, billingRoleAssignmentName), serviceCallback); + } + + /** + * Get the role assignment for the caller. + * + * @param billingAccountName billing Account Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentInner object + */ + public Observable getByBillingAccountAsync(String billingAccountName, String billingRoleAssignmentName) { + return getByBillingAccountWithServiceResponseAsync(billingAccountName, billingRoleAssignmentName).map(new Func1, BillingRoleAssignmentInner>() { + @Override + public BillingRoleAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the role assignment for the caller. + * + * @param billingAccountName billing Account Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentInner object + */ + public Observable> getByBillingAccountWithServiceResponseAsync(String billingAccountName, String billingRoleAssignmentName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingRoleAssignmentName == null) { + throw new IllegalArgumentException("Parameter billingRoleAssignmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByBillingAccount(billingAccountName, billingRoleAssignmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByBillingAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByBillingAccountDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Delete the role assignment on this billing account. + * + * @param billingAccountName billing Account Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingRoleAssignmentInner object if successful. + */ + public BillingRoleAssignmentInner deleteByBillingAccount(String billingAccountName, String billingRoleAssignmentName) { + return deleteByBillingAccountWithServiceResponseAsync(billingAccountName, billingRoleAssignmentName).toBlocking().single().body(); + } + + /** + * Delete the role assignment on this billing account. + * + * @param billingAccountName billing Account Id. + * @param billingRoleAssignmentName role assignment id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteByBillingAccountAsync(String billingAccountName, String billingRoleAssignmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteByBillingAccountWithServiceResponseAsync(billingAccountName, billingRoleAssignmentName), serviceCallback); + } + + /** + * Delete the role assignment on this billing account. + * + * @param billingAccountName billing Account Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentInner object + */ + public Observable deleteByBillingAccountAsync(String billingAccountName, String billingRoleAssignmentName) { + return deleteByBillingAccountWithServiceResponseAsync(billingAccountName, billingRoleAssignmentName).map(new Func1, BillingRoleAssignmentInner>() { + @Override + public BillingRoleAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete the role assignment on this billing account. + * + * @param billingAccountName billing Account Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentInner object + */ + public Observable> deleteByBillingAccountWithServiceResponseAsync(String billingAccountName, String billingRoleAssignmentName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingRoleAssignmentName == null) { + throw new IllegalArgumentException("Parameter billingRoleAssignmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.deleteByBillingAccount(billingAccountName, billingRoleAssignmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteByBillingAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteByBillingAccountDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get the role assignment for the caller on the invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingRoleAssignmentInner object if successful. + */ + public BillingRoleAssignmentInner getByInvoiceSection(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingRoleAssignmentName) { + return getByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName).toBlocking().single().body(); + } + + /** + * Get the role assignment for the caller on the invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingRoleAssignmentName role assignment id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingRoleAssignmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName), serviceCallback); + } + + /** + * Get the role assignment for the caller on the invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentInner object + */ + public Observable getByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingRoleAssignmentName) { + return getByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName).map(new Func1, BillingRoleAssignmentInner>() { + @Override + public BillingRoleAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the role assignment for the caller on the invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentInner object + */ + public Observable> getByInvoiceSectionWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingRoleAssignmentName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (billingRoleAssignmentName == null) { + throw new IllegalArgumentException("Parameter billingRoleAssignmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByInvoiceSectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByInvoiceSectionDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Delete the role assignment on the invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingRoleAssignmentInner object if successful. + */ + public BillingRoleAssignmentInner deleteByInvoiceSection(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingRoleAssignmentName) { + return deleteByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName).toBlocking().single().body(); + } + + /** + * Delete the role assignment on the invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingRoleAssignmentName role assignment id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingRoleAssignmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName), serviceCallback); + } + + /** + * Delete the role assignment on the invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentInner object + */ + public Observable deleteByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingRoleAssignmentName) { + return deleteByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName).map(new Func1, BillingRoleAssignmentInner>() { + @Override + public BillingRoleAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete the role assignment on the invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentInner object + */ + public Observable> deleteByInvoiceSectionWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingRoleAssignmentName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (billingRoleAssignmentName == null) { + throw new IllegalArgumentException("Parameter billingRoleAssignmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.deleteByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteByInvoiceSectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteByInvoiceSectionDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get the role assignment for the caller on the Billing Profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingRoleAssignmentInner object if successful. + */ + public BillingRoleAssignmentInner getByBillingProfile(String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { + return getByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, billingRoleAssignmentName).toBlocking().single().body(); + } + + /** + * Get the role assignment for the caller on the Billing Profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param billingRoleAssignmentName role assignment id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByBillingProfileAsync(String billingAccountName, String billingProfileName, String billingRoleAssignmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, billingRoleAssignmentName), serviceCallback); + } + + /** + * Get the role assignment for the caller on the Billing Profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentInner object + */ + public Observable getByBillingProfileAsync(String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { + return getByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, billingRoleAssignmentName).map(new Func1, BillingRoleAssignmentInner>() { + @Override + public BillingRoleAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the role assignment for the caller on the Billing Profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentInner object + */ + public Observable> getByBillingProfileWithServiceResponseAsync(String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (billingRoleAssignmentName == null) { + throw new IllegalArgumentException("Parameter billingRoleAssignmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByBillingProfile(billingAccountName, billingProfileName, billingRoleAssignmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByBillingProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByBillingProfileDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Delete the role assignment on this Billing Profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingRoleAssignmentInner object if successful. + */ + public BillingRoleAssignmentInner deleteByBillingProfile(String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { + return deleteByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, billingRoleAssignmentName).toBlocking().single().body(); + } + + /** + * Delete the role assignment on this Billing Profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param billingRoleAssignmentName role assignment id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteByBillingProfileAsync(String billingAccountName, String billingProfileName, String billingRoleAssignmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, billingRoleAssignmentName), serviceCallback); + } + + /** + * Delete the role assignment on this Billing Profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentInner object + */ + public Observable deleteByBillingProfileAsync(String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { + return deleteByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, billingRoleAssignmentName).map(new Func1, BillingRoleAssignmentInner>() { + @Override + public BillingRoleAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete the role assignment on this Billing Profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param billingRoleAssignmentName role assignment id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentInner object + */ + public Observable> deleteByBillingProfileWithServiceResponseAsync(String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (billingRoleAssignmentName == null) { + throw new IllegalArgumentException("Parameter billingRoleAssignmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.deleteByBillingProfile(billingAccountName, billingProfileName, billingRoleAssignmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteByBillingProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteByBillingProfileDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get the role assignments on the Billing Account. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingRoleAssignmentListResultInner object if successful. + */ + public BillingRoleAssignmentListResultInner listByBillingAccount(String billingAccountName) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName).toBlocking().single().body(); + } + + /** + * Get the role assignments on the Billing Account. + * + * @param billingAccountName billing Account Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByBillingAccountAsync(String billingAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingAccountWithServiceResponseAsync(billingAccountName), serviceCallback); + } + + /** + * Get the role assignments on the Billing Account. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentListResultInner object + */ + public Observable listByBillingAccountAsync(String billingAccountName) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName).map(new Func1, BillingRoleAssignmentListResultInner>() { + @Override + public BillingRoleAssignmentListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the role assignments on the Billing Account. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentListResultInner object + */ + public Observable> listByBillingAccountWithServiceResponseAsync(String billingAccountName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByBillingAccount(billingAccountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByBillingAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByBillingAccountDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * The operation to add a role assignment to a billing account. + * + * @param billingAccountName billing Account Id. + * @param parameters Parameters supplied to add a role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingRoleAssignmentListResultInner object if successful. + */ + public BillingRoleAssignmentListResultInner addByBillingAccount(String billingAccountName, BillingRoleAssignmentPayload parameters) { + return addByBillingAccountWithServiceResponseAsync(billingAccountName, parameters).toBlocking().single().body(); + } + + /** + * The operation to add a role assignment to a billing account. + * + * @param billingAccountName billing Account Id. + * @param parameters Parameters supplied to add a role assignment. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture addByBillingAccountAsync(String billingAccountName, BillingRoleAssignmentPayload parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(addByBillingAccountWithServiceResponseAsync(billingAccountName, parameters), serviceCallback); + } + + /** + * The operation to add a role assignment to a billing account. + * + * @param billingAccountName billing Account Id. + * @param parameters Parameters supplied to add a role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentListResultInner object + */ + public Observable addByBillingAccountAsync(String billingAccountName, BillingRoleAssignmentPayload parameters) { + return addByBillingAccountWithServiceResponseAsync(billingAccountName, parameters).map(new Func1, BillingRoleAssignmentListResultInner>() { + @Override + public BillingRoleAssignmentListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to add a role assignment to a billing account. + * + * @param billingAccountName billing Account Id. + * @param parameters Parameters supplied to add a role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentListResultInner object + */ + public Observable> addByBillingAccountWithServiceResponseAsync(String billingAccountName, BillingRoleAssignmentPayload parameters) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.addByBillingAccount(billingAccountName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = addByBillingAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse addByBillingAccountDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get the role assignments on the invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingRoleAssignmentListResultInner object if successful. + */ + public BillingRoleAssignmentListResultInner listByInvoiceSection(String billingAccountName, String billingProfileName, String invoiceSectionName) { + return listByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName).toBlocking().single().body(); + } + + /** + * Get the role assignments on the invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName), serviceCallback); + } + + /** + * Get the role assignments on the invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentListResultInner object + */ + public Observable listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + return listByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName).map(new Func1, BillingRoleAssignmentListResultInner>() { + @Override + public BillingRoleAssignmentListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the role assignments on the invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentListResultInner object + */ + public Observable> listByInvoiceSectionWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByInvoiceSectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByInvoiceSectionDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * The operation to add a role assignment to a invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param parameters Parameters supplied to add a role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingRoleAssignmentListResultInner object if successful. + */ + public BillingRoleAssignmentListResultInner addByInvoiceSection(String billingAccountName, String billingProfileName, String invoiceSectionName, BillingRoleAssignmentPayload parameters) { + return addByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters).toBlocking().single().body(); + } + + /** + * The operation to add a role assignment to a invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param parameters Parameters supplied to add a role assignment. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture addByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, BillingRoleAssignmentPayload parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(addByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters), serviceCallback); + } + + /** + * The operation to add a role assignment to a invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param parameters Parameters supplied to add a role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentListResultInner object + */ + public Observable addByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, BillingRoleAssignmentPayload parameters) { + return addByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters).map(new Func1, BillingRoleAssignmentListResultInner>() { + @Override + public BillingRoleAssignmentListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to add a role assignment to a invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param parameters Parameters supplied to add a role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentListResultInner object + */ + public Observable> addByInvoiceSectionWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, BillingRoleAssignmentPayload parameters) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.addByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = addByInvoiceSectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse addByInvoiceSectionDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get the role assignments on the Billing Profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingRoleAssignmentListResultInner object if successful. + */ + public BillingRoleAssignmentListResultInner listByBillingProfile(String billingAccountName, String billingProfileName) { + return listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName).toBlocking().single().body(); + } + + /** + * Get the role assignments on the Billing Profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByBillingProfileAsync(String billingAccountName, String billingProfileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName), serviceCallback); + } + + /** + * Get the role assignments on the Billing Profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentListResultInner object + */ + public Observable listByBillingProfileAsync(String billingAccountName, String billingProfileName) { + return listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName).map(new Func1, BillingRoleAssignmentListResultInner>() { + @Override + public BillingRoleAssignmentListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the role assignments on the Billing Profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentListResultInner object + */ + public Observable> listByBillingProfileWithServiceResponseAsync(String billingAccountName, String billingProfileName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByBillingProfile(billingAccountName, billingProfileName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByBillingProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByBillingProfileDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * The operation to add a role assignment to a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Parameters supplied to add a role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingRoleAssignmentListResultInner object if successful. + */ + public BillingRoleAssignmentListResultInner addByBillingProfile(String billingAccountName, String billingProfileName, BillingRoleAssignmentPayload parameters) { + return addByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, parameters).toBlocking().single().body(); + } + + /** + * The operation to add a role assignment to a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Parameters supplied to add a role assignment. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture addByBillingProfileAsync(String billingAccountName, String billingProfileName, BillingRoleAssignmentPayload parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(addByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, parameters), serviceCallback); + } + + /** + * The operation to add a role assignment to a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Parameters supplied to add a role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentListResultInner object + */ + public Observable addByBillingProfileAsync(String billingAccountName, String billingProfileName, BillingRoleAssignmentPayload parameters) { + return addByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, parameters).map(new Func1, BillingRoleAssignmentListResultInner>() { + @Override + public BillingRoleAssignmentListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to add a role assignment to a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Parameters supplied to add a role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleAssignmentListResultInner object + */ + public Observable> addByBillingProfileWithServiceResponseAsync(String billingAccountName, String billingProfileName, BillingRoleAssignmentPayload parameters) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.addByBillingProfile(billingAccountName, billingProfileName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = addByBillingProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse addByBillingProfileDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleDefinitionImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleDefinitionImpl.java new file mode 100644 index 000000000000..2d5f56760b75 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleDefinitionImpl.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleDefinition; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingPermissionsProperties; + +class BillingRoleDefinitionImpl extends IndexableRefreshableWrapperImpl implements BillingRoleDefinition { + private final BillingManager manager; + private String billingAccountName; + private String billingRoleDefinitionName; + + BillingRoleDefinitionImpl(BillingRoleDefinitionInner inner, BillingManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.billingAccountName = IdParsingUtils.getValueFromIdByName(inner.id(), "billingAccounts"); + this.billingRoleDefinitionName = IdParsingUtils.getValueFromIdByName(inner.id(), "billingRoleDefinitions"); + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + BillingRoleDefinitionsInner client = this.manager().inner().billingRoleDefinitions(); + return client.getByBillingAccountAsync(this.billingAccountName, this.billingRoleDefinitionName); + } + + + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String roleName() { + return this.inner().roleName(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleDefinitionInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleDefinitionInner.java new file mode 100644 index 000000000000..55692c1e9aed --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleDefinitionInner.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingPermissionsProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Result of get role definition for a role. + */ +@JsonFlatten +public class BillingRoleDefinitionInner extends ProxyResource { + /** + * The role description. + */ + @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * The list of billingPermissions a caller has on a billing account. + */ + @JsonProperty(value = "properties.permissions.value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * The name of the role. + */ + @JsonProperty(value = "properties.roleName", access = JsonProperty.Access.WRITE_ONLY) + private String roleName; + + /** + * Get the role description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Get the list of billingPermissions a caller has on a billing account. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Get the name of the role. + * + * @return the roleName value + */ + public String roleName() { + return this.roleName; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleDefinitionListResultImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleDefinitionListResultImpl.java new file mode 100644 index 000000000000..4dcc931b939e --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleDefinitionListResultImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleDefinitionListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class BillingRoleDefinitionListResultImpl extends WrapperImpl implements BillingRoleDefinitionListResult { + private final BillingManager manager; + BillingRoleDefinitionListResultImpl(BillingRoleDefinitionListResultInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleDefinitionListResultInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleDefinitionListResultInner.java new file mode 100644 index 000000000000..acf7253bca07 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleDefinitionListResultInner.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * list the role definitions. + */ +public class BillingRoleDefinitionListResultInner { + /** + * The list of role definitions. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the list of role definitions. + * + * @return the value value + */ + public List value() { + return this.value; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleDefinitionsImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleDefinitionsImpl.java new file mode 100644 index 000000000000..cc143812c8dc --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleDefinitionsImpl.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleDefinitions; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleDefinition; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleDefinitionListResult; + +class BillingRoleDefinitionsImpl extends WrapperImpl implements BillingRoleDefinitions { + private final BillingManager manager; + + BillingRoleDefinitionsImpl(BillingManager manager) { + super(manager.inner().billingRoleDefinitions()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + private BillingRoleDefinitionImpl wrapModel(BillingRoleDefinitionInner inner) { + return new BillingRoleDefinitionImpl(inner, manager()); + } + + @Override + public Observable getByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingRoleDefinitionName) { + BillingRoleDefinitionsInner client = this.inner(); + return client.getByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName) + .map(new Func1() { + @Override + public BillingRoleDefinition call(BillingRoleDefinitionInner inner) { + return new BillingRoleDefinitionImpl(inner, manager()); + } + }); + } + + @Override + public Observable getByBillingProfileAsync(String billingAccountName, String billingProfileName, String billingRoleDefinitionName) { + BillingRoleDefinitionsInner client = this.inner(); + return client.getByBillingProfileAsync(billingAccountName, billingProfileName, billingRoleDefinitionName) + .map(new Func1() { + @Override + public BillingRoleDefinition call(BillingRoleDefinitionInner inner) { + return new BillingRoleDefinitionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByBillingAccountAsync(String billingAccountName) { + BillingRoleDefinitionsInner client = this.inner(); + return client.listByBillingAccountAsync(billingAccountName) + .map(new Func1() { + @Override + public BillingRoleDefinitionListResult call(BillingRoleDefinitionListResultInner inner) { + return new BillingRoleDefinitionListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + BillingRoleDefinitionsInner client = this.inner(); + return client.listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName) + .map(new Func1() { + @Override + public BillingRoleDefinitionListResult call(BillingRoleDefinitionListResultInner inner) { + return new BillingRoleDefinitionListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByBillingProfileAsync(String billingAccountName, String billingProfileName) { + BillingRoleDefinitionsInner client = this.inner(); + return client.listByBillingProfileAsync(billingAccountName, billingProfileName) + .map(new Func1() { + @Override + public BillingRoleDefinitionListResult call(BillingRoleDefinitionListResultInner inner) { + return new BillingRoleDefinitionListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getByBillingAccountAsync(String billingAccountName, String billingRoleDefinitionName) { + BillingRoleDefinitionsInner client = this.inner(); + return client.getByBillingAccountAsync(billingAccountName, billingRoleDefinitionName) + .map(new Func1() { + @Override + public BillingRoleDefinition call(BillingRoleDefinitionInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleDefinitionsInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleDefinitionsInner.java new file mode 100644 index 000000000000..dbd395ff008a --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingRoleDefinitionsInner.java @@ -0,0 +1,599 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BillingRoleDefinitions. + */ +public class BillingRoleDefinitionsInner { + /** The Retrofit service to perform REST calls. */ + private BillingRoleDefinitionsService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of BillingRoleDefinitionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BillingRoleDefinitionsInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(BillingRoleDefinitionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for BillingRoleDefinitions to be + * used by Retrofit to perform actually REST calls. + */ + interface BillingRoleDefinitionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleDefinitions getByBillingAccount" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/{billingRoleDefinitionName}") + Observable> getByBillingAccount(@Path("billingAccountName") String billingAccountName, @Path("billingRoleDefinitionName") String billingRoleDefinitionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleDefinitions getByInvoiceSection" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions/{billingRoleDefinitionName}") + Observable> getByInvoiceSection(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Path("billingRoleDefinitionName") String billingRoleDefinitionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleDefinitions getByBillingProfile" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions/{billingRoleDefinitionName}") + Observable> getByBillingProfile(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("billingRoleDefinitionName") String billingRoleDefinitionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleDefinitions listByBillingAccount" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions") + Observable> listByBillingAccount(@Path("billingAccountName") String billingAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleDefinitions listByInvoiceSection" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions") + Observable> listByInvoiceSection(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingRoleDefinitions listByBillingProfile" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions") + Observable> listByBillingProfile(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the role definition for a role. + * + * @param billingAccountName billing Account Id. + * @param billingRoleDefinitionName role definition id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingRoleDefinitionInner object if successful. + */ + public BillingRoleDefinitionInner getByBillingAccount(String billingAccountName, String billingRoleDefinitionName) { + return getByBillingAccountWithServiceResponseAsync(billingAccountName, billingRoleDefinitionName).toBlocking().single().body(); + } + + /** + * Gets the role definition for a role. + * + * @param billingAccountName billing Account Id. + * @param billingRoleDefinitionName role definition id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByBillingAccountAsync(String billingAccountName, String billingRoleDefinitionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByBillingAccountWithServiceResponseAsync(billingAccountName, billingRoleDefinitionName), serviceCallback); + } + + /** + * Gets the role definition for a role. + * + * @param billingAccountName billing Account Id. + * @param billingRoleDefinitionName role definition id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleDefinitionInner object + */ + public Observable getByBillingAccountAsync(String billingAccountName, String billingRoleDefinitionName) { + return getByBillingAccountWithServiceResponseAsync(billingAccountName, billingRoleDefinitionName).map(new Func1, BillingRoleDefinitionInner>() { + @Override + public BillingRoleDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the role definition for a role. + * + * @param billingAccountName billing Account Id. + * @param billingRoleDefinitionName role definition id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleDefinitionInner object + */ + public Observable> getByBillingAccountWithServiceResponseAsync(String billingAccountName, String billingRoleDefinitionName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingRoleDefinitionName == null) { + throw new IllegalArgumentException("Parameter billingRoleDefinitionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByBillingAccount(billingAccountName, billingRoleDefinitionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByBillingAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByBillingAccountDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the role definition for a role. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingRoleDefinitionName role definition id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingRoleDefinitionInner object if successful. + */ + public BillingRoleDefinitionInner getByInvoiceSection(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingRoleDefinitionName) { + return getByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName).toBlocking().single().body(); + } + + /** + * Gets the role definition for a role. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingRoleDefinitionName role definition id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingRoleDefinitionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName), serviceCallback); + } + + /** + * Gets the role definition for a role. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingRoleDefinitionName role definition id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleDefinitionInner object + */ + public Observable getByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingRoleDefinitionName) { + return getByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName).map(new Func1, BillingRoleDefinitionInner>() { + @Override + public BillingRoleDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the role definition for a role. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingRoleDefinitionName role definition id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleDefinitionInner object + */ + public Observable> getByInvoiceSectionWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingRoleDefinitionName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (billingRoleDefinitionName == null) { + throw new IllegalArgumentException("Parameter billingRoleDefinitionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByInvoiceSectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByInvoiceSectionDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the role definition for a role. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param billingRoleDefinitionName role definition id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingRoleDefinitionInner object if successful. + */ + public BillingRoleDefinitionInner getByBillingProfile(String billingAccountName, String billingProfileName, String billingRoleDefinitionName) { + return getByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, billingRoleDefinitionName).toBlocking().single().body(); + } + + /** + * Gets the role definition for a role. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param billingRoleDefinitionName role definition id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByBillingProfileAsync(String billingAccountName, String billingProfileName, String billingRoleDefinitionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, billingRoleDefinitionName), serviceCallback); + } + + /** + * Gets the role definition for a role. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param billingRoleDefinitionName role definition id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleDefinitionInner object + */ + public Observable getByBillingProfileAsync(String billingAccountName, String billingProfileName, String billingRoleDefinitionName) { + return getByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, billingRoleDefinitionName).map(new Func1, BillingRoleDefinitionInner>() { + @Override + public BillingRoleDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the role definition for a role. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param billingRoleDefinitionName role definition id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleDefinitionInner object + */ + public Observable> getByBillingProfileWithServiceResponseAsync(String billingAccountName, String billingProfileName, String billingRoleDefinitionName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (billingRoleDefinitionName == null) { + throw new IllegalArgumentException("Parameter billingRoleDefinitionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByBillingProfile(billingAccountName, billingProfileName, billingRoleDefinitionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByBillingProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByBillingProfileDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the role definition for a billing account. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingRoleDefinitionListResultInner object if successful. + */ + public BillingRoleDefinitionListResultInner listByBillingAccount(String billingAccountName) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName).toBlocking().single().body(); + } + + /** + * Lists the role definition for a billing account. + * + * @param billingAccountName billing Account Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByBillingAccountAsync(String billingAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingAccountWithServiceResponseAsync(billingAccountName), serviceCallback); + } + + /** + * Lists the role definition for a billing account. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleDefinitionListResultInner object + */ + public Observable listByBillingAccountAsync(String billingAccountName) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName).map(new Func1, BillingRoleDefinitionListResultInner>() { + @Override + public BillingRoleDefinitionListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the role definition for a billing account. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleDefinitionListResultInner object + */ + public Observable> listByBillingAccountWithServiceResponseAsync(String billingAccountName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByBillingAccount(billingAccountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByBillingAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByBillingAccountDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the role definition for an invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingRoleDefinitionListResultInner object if successful. + */ + public BillingRoleDefinitionListResultInner listByInvoiceSection(String billingAccountName, String billingProfileName, String invoiceSectionName) { + return listByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName).toBlocking().single().body(); + } + + /** + * Lists the role definition for an invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName), serviceCallback); + } + + /** + * Lists the role definition for an invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleDefinitionListResultInner object + */ + public Observable listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + return listByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName).map(new Func1, BillingRoleDefinitionListResultInner>() { + @Override + public BillingRoleDefinitionListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the role definition for an invoice Section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleDefinitionListResultInner object + */ + public Observable> listByInvoiceSectionWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByInvoiceSectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByInvoiceSectionDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the role definition for a Billing Profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingRoleDefinitionListResultInner object if successful. + */ + public BillingRoleDefinitionListResultInner listByBillingProfile(String billingAccountName, String billingProfileName) { + return listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName).toBlocking().single().body(); + } + + /** + * Lists the role definition for a Billing Profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByBillingProfileAsync(String billingAccountName, String billingProfileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName), serviceCallback); + } + + /** + * Lists the role definition for a Billing Profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleDefinitionListResultInner object + */ + public Observable listByBillingProfileAsync(String billingAccountName, String billingProfileName) { + return listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName).map(new Func1, BillingRoleDefinitionListResultInner>() { + @Override + public BillingRoleDefinitionListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the role definition for a Billing Profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingRoleDefinitionListResultInner object + */ + public Observable> listByBillingProfileWithServiceResponseAsync(String billingAccountName, String billingProfileName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByBillingProfile(billingAccountName, billingProfileName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByBillingProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByBillingProfileDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingSubscriptionImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingSubscriptionImpl.java new file mode 100644 index 000000000000..b4c6470444bf --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingSubscriptionImpl.java @@ -0,0 +1,132 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingSubscription; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Amount; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Reseller; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingSubscriptionStatusType; +import java.util.UUID; + +class BillingSubscriptionImpl extends IndexableRefreshableWrapperImpl implements BillingSubscription { + private final BillingManager manager; + private String billingAccountName; + private String customerName; + private String billingSubscriptionName; + + BillingSubscriptionImpl(BillingSubscriptionInner inner, BillingManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.billingAccountName = IdParsingUtils.getValueFromIdByName(inner.id(), "billingAccounts"); + this.customerName = IdParsingUtils.getValueFromIdByName(inner.id(), "customers"); + this.billingSubscriptionName = IdParsingUtils.getValueFromIdByName(inner.id(), "billingSubscriptions"); + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + BillingSubscriptionsInner client = this.manager().inner().billingSubscriptions(); + return client.getByCustomerAsync(this.billingAccountName, this.customerName, this.billingSubscriptionName); + } + + + + @Override + public String billingProfileDisplayName() { + return this.inner().billingProfileDisplayName(); + } + + @Override + public String billingProfileId() { + return this.inner().billingProfileId(); + } + + @Override + public String customerDisplayName() { + return this.inner().customerDisplayName(); + } + + @Override + public String customerId() { + return this.inner().customerId(); + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String invoiceSectionDisplayName() { + return this.inner().invoiceSectionDisplayName(); + } + + @Override + public String invoiceSectionId() { + return this.inner().invoiceSectionId(); + } + + @Override + public Amount lastMonthCharges() { + return this.inner().lastMonthCharges(); + } + + @Override + public Amount monthToDateCharges() { + return this.inner().monthToDateCharges(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Reseller reseller() { + return this.inner().reseller(); + } + + @Override + public String skuDescription() { + return this.inner().skuDescription(); + } + + @Override + public String skuId() { + return this.inner().skuId(); + } + + @Override + public BillingSubscriptionStatusType subscriptionBillingStatus() { + return this.inner().subscriptionBillingStatus(); + } + + @Override + public UUID subscriptionId() { + return this.inner().subscriptionId(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingSubscriptionInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingSubscriptionInner.java new file mode 100644 index 000000000000..98e9e1819800 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingSubscriptionInner.java @@ -0,0 +1,257 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import java.util.UUID; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingSubscriptionStatusType; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Amount; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Reseller; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A billing Subscription resource. + */ +@JsonFlatten +public class BillingSubscriptionInner extends ProxyResource { + /** + * display name. + */ + @JsonProperty(value = "properties.displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /** + * Subscription Id. + */ + @JsonProperty(value = "properties.subscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private UUID subscriptionId; + + /** + * Subscription billing status. Possible values include: 'Active', + * 'Inactive', 'Abandoned', 'Deleted', 'Warning'. + */ + @JsonProperty(value = "properties.subscriptionBillingStatus") + private BillingSubscriptionStatusType subscriptionBillingStatus; + + /** + * Last month charges. + */ + @JsonProperty(value = "properties.lastMonthCharges", access = JsonProperty.Access.WRITE_ONLY) + private Amount lastMonthCharges; + + /** + * Month to date charges. + */ + @JsonProperty(value = "properties.monthToDateCharges", access = JsonProperty.Access.WRITE_ONLY) + private Amount monthToDateCharges; + + /** + * Billing Profile id to which this product belongs. + */ + @JsonProperty(value = "properties.billingProfileId", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileId; + + /** + * Billing Profile display name to which this product belongs. + */ + @JsonProperty(value = "properties.billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileDisplayName; + + /** + * Customer id to which this product belongs. + */ + @JsonProperty(value = "properties.customerId", access = JsonProperty.Access.WRITE_ONLY) + private String customerId; + + /** + * Display name of customer to which this product belongs. + */ + @JsonProperty(value = "properties.customerDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String customerDisplayName; + + /** + * Invoice section id to which this product belongs. + */ + @JsonProperty(value = "properties.invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionId; + + /** + * Invoice section display name to which this product belongs. + */ + @JsonProperty(value = "properties.invoiceSectionDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionDisplayName; + + /** + * Reseller for this subscription. + */ + @JsonProperty(value = "properties.reseller", access = JsonProperty.Access.WRITE_ONLY) + private Reseller reseller; + + /** + * The sku id. + */ + @JsonProperty(value = "properties.skuId") + private String skuId; + + /** + * The sku description. + */ + @JsonProperty(value = "properties.skuDescription", access = JsonProperty.Access.WRITE_ONLY) + private String skuDescription; + + /** + * Get display name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Get subscription Id. + * + * @return the subscriptionId value + */ + public UUID subscriptionId() { + return this.subscriptionId; + } + + /** + * Get subscription billing status. Possible values include: 'Active', 'Inactive', 'Abandoned', 'Deleted', 'Warning'. + * + * @return the subscriptionBillingStatus value + */ + public BillingSubscriptionStatusType subscriptionBillingStatus() { + return this.subscriptionBillingStatus; + } + + /** + * Set subscription billing status. Possible values include: 'Active', 'Inactive', 'Abandoned', 'Deleted', 'Warning'. + * + * @param subscriptionBillingStatus the subscriptionBillingStatus value to set + * @return the BillingSubscriptionInner object itself. + */ + public BillingSubscriptionInner withSubscriptionBillingStatus(BillingSubscriptionStatusType subscriptionBillingStatus) { + this.subscriptionBillingStatus = subscriptionBillingStatus; + return this; + } + + /** + * Get last month charges. + * + * @return the lastMonthCharges value + */ + public Amount lastMonthCharges() { + return this.lastMonthCharges; + } + + /** + * Get month to date charges. + * + * @return the monthToDateCharges value + */ + public Amount monthToDateCharges() { + return this.monthToDateCharges; + } + + /** + * Get billing Profile id to which this product belongs. + * + * @return the billingProfileId value + */ + public String billingProfileId() { + return this.billingProfileId; + } + + /** + * Get billing Profile display name to which this product belongs. + * + * @return the billingProfileDisplayName value + */ + public String billingProfileDisplayName() { + return this.billingProfileDisplayName; + } + + /** + * Get customer id to which this product belongs. + * + * @return the customerId value + */ + public String customerId() { + return this.customerId; + } + + /** + * Get display name of customer to which this product belongs. + * + * @return the customerDisplayName value + */ + public String customerDisplayName() { + return this.customerDisplayName; + } + + /** + * Get invoice section id to which this product belongs. + * + * @return the invoiceSectionId value + */ + public String invoiceSectionId() { + return this.invoiceSectionId; + } + + /** + * Get invoice section display name to which this product belongs. + * + * @return the invoiceSectionDisplayName value + */ + public String invoiceSectionDisplayName() { + return this.invoiceSectionDisplayName; + } + + /** + * Get reseller for this subscription. + * + * @return the reseller value + */ + public Reseller reseller() { + return this.reseller; + } + + /** + * Get the sku id. + * + * @return the skuId value + */ + public String skuId() { + return this.skuId; + } + + /** + * Set the sku id. + * + * @param skuId the skuId value to set + * @return the BillingSubscriptionInner object itself. + */ + public BillingSubscriptionInner withSkuId(String skuId) { + this.skuId = skuId; + return this; + } + + /** + * Get the sku description. + * + * @return the skuDescription value + */ + public String skuDescription() { + return this.skuDescription; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingSubscriptionsImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingSubscriptionsImpl.java new file mode 100644 index 000000000000..b1bbc834b40c --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingSubscriptionsImpl.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingSubscriptions; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingSubscription; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingSubscriptionsListResult; +import com.microsoft.azure.management.billing.v2019_10_01_preview.TransferBillingSubscriptionResult; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ValidateSubscriptionTransferEligibilityResult; +import com.microsoft.azure.management.billing.v2019_10_01_preview.TransferBillingSubscriptionRequestProperties; + +class BillingSubscriptionsImpl extends WrapperImpl implements BillingSubscriptions { + private final BillingManager manager; + + BillingSubscriptionsImpl(BillingManager manager) { + super(manager.inner().billingSubscriptions()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + private BillingSubscriptionImpl wrapModel(BillingSubscriptionInner inner) { + return new BillingSubscriptionImpl(inner, manager()); + } + + @Override + public Observable listByBillingAccountAsync(final String billingAccountName) { + BillingSubscriptionsInner client = this.inner(); + return client.listByBillingAccountAsync(billingAccountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public BillingSubscription call(BillingSubscriptionInner inner) { + return new BillingSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByBillingProfileAsync(String billingAccountName, String billingProfileName) { + BillingSubscriptionsInner client = this.inner(); + return client.listByBillingProfileAsync(billingAccountName, billingProfileName) + .map(new Func1() { + @Override + public BillingSubscriptionsListResult call(BillingSubscriptionsListResultInner inner) { + return new BillingSubscriptionsListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + BillingSubscriptionsInner client = this.inner(); + return client.listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName) + .map(new Func1() { + @Override + public BillingSubscriptionsListResult call(BillingSubscriptionsListResultInner inner) { + return new BillingSubscriptionsListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingSubscriptionName) { + BillingSubscriptionsInner client = this.inner(); + return client.getAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName) + .map(new Func1() { + @Override + public BillingSubscription call(BillingSubscriptionInner inner) { + return new BillingSubscriptionImpl(inner, manager()); + } + }); + } + + @Override + public Observable transferAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) { + BillingSubscriptionsInner client = this.inner(); + return client.transferAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters) + .map(new Func1() { + @Override + public TransferBillingSubscriptionResult call(TransferBillingSubscriptionResultInner inner) { + return new TransferBillingSubscriptionResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable validateTransferAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) { + BillingSubscriptionsInner client = this.inner(); + return client.validateTransferAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters) + .map(new Func1() { + @Override + public ValidateSubscriptionTransferEligibilityResult call(ValidateSubscriptionTransferEligibilityResultInner inner) { + return new ValidateSubscriptionTransferEligibilityResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByCustomerAsync(final String billingAccountName, final String customerName) { + BillingSubscriptionsInner client = this.inner(); + return client.listByCustomerAsync(billingAccountName, customerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public BillingSubscription call(BillingSubscriptionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getByCustomerAsync(String billingAccountName, String customerName, String billingSubscriptionName) { + BillingSubscriptionsInner client = this.inner(); + return client.getByCustomerAsync(billingAccountName, customerName, billingSubscriptionName) + .map(new Func1() { + @Override + public BillingSubscription call(BillingSubscriptionInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingSubscriptionsInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingSubscriptionsInner.java new file mode 100644 index 000000000000..9caf28458688 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingSubscriptionsInner.java @@ -0,0 +1,1216 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingSubscriptionsTransferHeaders; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.azure.management.billing.v2019_10_01_preview.TransferBillingSubscriptionRequestProperties; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BillingSubscriptions. + */ +public class BillingSubscriptionsInner { + /** The Retrofit service to perform REST calls. */ + private BillingSubscriptionsService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of BillingSubscriptionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BillingSubscriptionsInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(BillingSubscriptionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for BillingSubscriptions to be + * used by Retrofit to perform actually REST calls. + */ + interface BillingSubscriptionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingSubscriptions listByCustomer" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/billingSubscriptions") + Observable> listByCustomer(@Path("billingAccountName") String billingAccountName, @Path("customerName") String customerName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingSubscriptions getByCustomer" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/billingSubscriptions/{billingSubscriptionName}") + Observable> getByCustomer(@Path("billingAccountName") String billingAccountName, @Path("customerName") String customerName, @Path("billingSubscriptionName") String billingSubscriptionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingSubscriptions listByBillingAccount" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions") + Observable> listByBillingAccount(@Path("billingAccountName") String billingAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingSubscriptions listByBillingProfile" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingSubscriptions") + Observable> listByBillingProfile(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingSubscriptions listByInvoiceSection" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingSubscriptions") + Observable> listByInvoiceSection(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingSubscriptions get" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}") + Observable> get(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Path("billingSubscriptionName") String billingSubscriptionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingSubscriptions transfer" }) + @POST("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}/transfer") + Observable> transfer(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Path("billingSubscriptionName") String billingSubscriptionName, @Body TransferBillingSubscriptionRequestProperties parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingSubscriptions beginTransfer" }) + @POST("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}/transfer") + Observable> beginTransfer(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Path("billingSubscriptionName") String billingSubscriptionName, @Body TransferBillingSubscriptionRequestProperties parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingSubscriptions validateTransfer" }) + @POST("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}/validateTransferEligibility") + Observable> validateTransfer(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Path("billingSubscriptionName") String billingSubscriptionName, @Body TransferBillingSubscriptionRequestProperties parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingSubscriptions listByCustomerNext" }) + @GET + Observable> listByCustomerNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.BillingSubscriptions listByBillingAccountNext" }) + @GET + Observable> listByBillingAccountNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists billing subscription by customer id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BillingSubscriptionInner> object if successful. + */ + public PagedList listByCustomer(final String billingAccountName, final String customerName) { + ServiceResponse> response = listByCustomerSinglePageAsync(billingAccountName, customerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByCustomerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists billing subscription by customer id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByCustomerAsync(final String billingAccountName, final String customerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByCustomerSinglePageAsync(billingAccountName, customerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByCustomerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists billing subscription by customer id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BillingSubscriptionInner> object + */ + public Observable> listByCustomerAsync(final String billingAccountName, final String customerName) { + return listByCustomerWithServiceResponseAsync(billingAccountName, customerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists billing subscription by customer id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BillingSubscriptionInner> object + */ + public Observable>> listByCustomerWithServiceResponseAsync(final String billingAccountName, final String customerName) { + return listByCustomerSinglePageAsync(billingAccountName, customerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByCustomerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists billing subscription by customer id. + * + ServiceResponse> * @param billingAccountName billing Account Id. + ServiceResponse> * @param customerName Customer name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BillingSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByCustomerSinglePageAsync(final String billingAccountName, final String customerName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (customerName == null) { + throw new IllegalArgumentException("Parameter customerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByCustomer(billingAccountName, customerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByCustomerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByCustomerDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get a single billing subscription by id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param billingSubscriptionName Billing Subscription Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingSubscriptionInner object if successful. + */ + public BillingSubscriptionInner getByCustomer(String billingAccountName, String customerName, String billingSubscriptionName) { + return getByCustomerWithServiceResponseAsync(billingAccountName, customerName, billingSubscriptionName).toBlocking().single().body(); + } + + /** + * Get a single billing subscription by id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param billingSubscriptionName Billing Subscription Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByCustomerAsync(String billingAccountName, String customerName, String billingSubscriptionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByCustomerWithServiceResponseAsync(billingAccountName, customerName, billingSubscriptionName), serviceCallback); + } + + /** + * Get a single billing subscription by id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param billingSubscriptionName Billing Subscription Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingSubscriptionInner object + */ + public Observable getByCustomerAsync(String billingAccountName, String customerName, String billingSubscriptionName) { + return getByCustomerWithServiceResponseAsync(billingAccountName, customerName, billingSubscriptionName).map(new Func1, BillingSubscriptionInner>() { + @Override + public BillingSubscriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a single billing subscription by id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param billingSubscriptionName Billing Subscription Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingSubscriptionInner object + */ + public Observable> getByCustomerWithServiceResponseAsync(String billingAccountName, String customerName, String billingSubscriptionName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (customerName == null) { + throw new IllegalArgumentException("Parameter customerName is required and cannot be null."); + } + if (billingSubscriptionName == null) { + throw new IllegalArgumentException("Parameter billingSubscriptionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByCustomer(billingAccountName, customerName, billingSubscriptionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByCustomerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByCustomerDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists billing subscriptions by billing account name. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BillingSubscriptionInner> object if successful. + */ + public PagedList listByBillingAccount(final String billingAccountName) { + ServiceResponse> response = listByBillingAccountSinglePageAsync(billingAccountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists billing subscriptions by billing account name. + * + * @param billingAccountName billing Account Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByBillingAccountAsync(final String billingAccountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBillingAccountSinglePageAsync(billingAccountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists billing subscriptions by billing account name. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BillingSubscriptionInner> object + */ + public Observable> listByBillingAccountAsync(final String billingAccountName) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists billing subscriptions by billing account name. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BillingSubscriptionInner> object + */ + public Observable>> listByBillingAccountWithServiceResponseAsync(final String billingAccountName) { + return listByBillingAccountSinglePageAsync(billingAccountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByBillingAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists billing subscriptions by billing account name. + * + ServiceResponse> * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BillingSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBillingAccountSinglePageAsync(final String billingAccountName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByBillingAccount(billingAccountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBillingAccountDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByBillingAccountDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists billing subscriptions by billing profile name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingSubscriptionsListResultInner object if successful. + */ + public BillingSubscriptionsListResultInner listByBillingProfile(String billingAccountName, String billingProfileName) { + return listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName).toBlocking().single().body(); + } + + /** + * Lists billing subscriptions by billing profile name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByBillingProfileAsync(String billingAccountName, String billingProfileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName), serviceCallback); + } + + /** + * Lists billing subscriptions by billing profile name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingSubscriptionsListResultInner object + */ + public Observable listByBillingProfileAsync(String billingAccountName, String billingProfileName) { + return listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName).map(new Func1, BillingSubscriptionsListResultInner>() { + @Override + public BillingSubscriptionsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists billing subscriptions by billing profile name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingSubscriptionsListResultInner object + */ + public Observable> listByBillingProfileWithServiceResponseAsync(String billingAccountName, String billingProfileName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByBillingProfile(billingAccountName, billingProfileName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByBillingProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByBillingProfileDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists billing subscription by invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingSubscriptionsListResultInner object if successful. + */ + public BillingSubscriptionsListResultInner listByInvoiceSection(String billingAccountName, String billingProfileName, String invoiceSectionName) { + return listByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName).toBlocking().single().body(); + } + + /** + * Lists billing subscription by invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName), serviceCallback); + } + + /** + * Lists billing subscription by invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingSubscriptionsListResultInner object + */ + public Observable listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + return listByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName).map(new Func1, BillingSubscriptionsListResultInner>() { + @Override + public BillingSubscriptionsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists billing subscription by invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingSubscriptionsListResultInner object + */ + public Observable> listByInvoiceSectionWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByInvoiceSectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByInvoiceSectionDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get a single billing subscription by name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingSubscriptionName Billing Subscription Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingSubscriptionInner object if successful. + */ + public BillingSubscriptionInner get(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingSubscriptionName) { + return getWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName).toBlocking().single().body(); + } + + /** + * Get a single billing subscription by name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingSubscriptionName Billing Subscription Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingSubscriptionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName), serviceCallback); + } + + /** + * Get a single billing subscription by name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingSubscriptionName Billing Subscription Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingSubscriptionInner object + */ + public Observable getAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingSubscriptionName) { + return getWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName).map(new Func1, BillingSubscriptionInner>() { + @Override + public BillingSubscriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a single billing subscription by name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingSubscriptionName Billing Subscription Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingSubscriptionInner object + */ + public Observable> getWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingSubscriptionName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (billingSubscriptionName == null) { + throw new IllegalArgumentException("Parameter billingSubscriptionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Transfers the subscription from one invoice section to another within a billing account. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingSubscriptionName Billing Subscription Id. + * @param parameters Request parameters supplied to the Transfer Billing Subscription operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TransferBillingSubscriptionResultInner object if successful. + */ + public TransferBillingSubscriptionResultInner transfer(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) { + return transferWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters).toBlocking().last().body(); + } + + /** + * Transfers the subscription from one invoice section to another within a billing account. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingSubscriptionName Billing Subscription Id. + * @param parameters Request parameters supplied to the Transfer Billing Subscription operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture transferAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(transferWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters), serviceCallback); + } + + /** + * Transfers the subscription from one invoice section to another within a billing account. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingSubscriptionName Billing Subscription Id. + * @param parameters Request parameters supplied to the Transfer Billing Subscription operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable transferAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) { + return transferWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters).map(new Func1, TransferBillingSubscriptionResultInner>() { + @Override + public TransferBillingSubscriptionResultInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Transfers the subscription from one invoice section to another within a billing account. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingSubscriptionName Billing Subscription Id. + * @param parameters Request parameters supplied to the Transfer Billing Subscription operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> transferWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (billingSubscriptionName == null) { + throw new IllegalArgumentException("Parameter billingSubscriptionName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.transfer(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), BillingSubscriptionsTransferHeaders.class); + } + + /** + * Transfers the subscription from one invoice section to another within a billing account. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingSubscriptionName Billing Subscription Id. + * @param parameters Request parameters supplied to the Transfer Billing Subscription operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TransferBillingSubscriptionResultInner object if successful. + */ + public TransferBillingSubscriptionResultInner beginTransfer(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) { + return beginTransferWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters).toBlocking().single().body(); + } + + /** + * Transfers the subscription from one invoice section to another within a billing account. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingSubscriptionName Billing Subscription Id. + * @param parameters Request parameters supplied to the Transfer Billing Subscription operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginTransferAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginTransferWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters), serviceCallback); + } + + /** + * Transfers the subscription from one invoice section to another within a billing account. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingSubscriptionName Billing Subscription Id. + * @param parameters Request parameters supplied to the Transfer Billing Subscription operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransferBillingSubscriptionResultInner object + */ + public Observable beginTransferAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) { + return beginTransferWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters).map(new Func1, TransferBillingSubscriptionResultInner>() { + @Override + public TransferBillingSubscriptionResultInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Transfers the subscription from one invoice section to another within a billing account. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingSubscriptionName Billing Subscription Id. + * @param parameters Request parameters supplied to the Transfer Billing Subscription operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransferBillingSubscriptionResultInner object + */ + public Observable> beginTransferWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (billingSubscriptionName == null) { + throw new IllegalArgumentException("Parameter billingSubscriptionName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginTransfer(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginTransferDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginTransferDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .buildWithHeaders(response, BillingSubscriptionsTransferHeaders.class); + } + + /** + * Validates the transfer of billing subscriptions across invoice sections. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingSubscriptionName Billing Subscription Id. + * @param parameters Parameters supplied to the Transfer Billing Subscription operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ValidateSubscriptionTransferEligibilityResultInner object if successful. + */ + public ValidateSubscriptionTransferEligibilityResultInner validateTransfer(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) { + return validateTransferWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters).toBlocking().single().body(); + } + + /** + * Validates the transfer of billing subscriptions across invoice sections. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingSubscriptionName Billing Subscription Id. + * @param parameters Parameters supplied to the Transfer Billing Subscription operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture validateTransferAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(validateTransferWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters), serviceCallback); + } + + /** + * Validates the transfer of billing subscriptions across invoice sections. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingSubscriptionName Billing Subscription Id. + * @param parameters Parameters supplied to the Transfer Billing Subscription operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ValidateSubscriptionTransferEligibilityResultInner object + */ + public Observable validateTransferAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) { + return validateTransferWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters).map(new Func1, ValidateSubscriptionTransferEligibilityResultInner>() { + @Override + public ValidateSubscriptionTransferEligibilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Validates the transfer of billing subscriptions across invoice sections. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param billingSubscriptionName Billing Subscription Id. + * @param parameters Parameters supplied to the Transfer Billing Subscription operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ValidateSubscriptionTransferEligibilityResultInner object + */ + public Observable> validateTransferWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (billingSubscriptionName == null) { + throw new IllegalArgumentException("Parameter billingSubscriptionName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.validateTransfer(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = validateTransferDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse validateTransferDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists billing subscription by customer id. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BillingSubscriptionInner> object if successful. + */ + public PagedList listByCustomerNext(final String nextPageLink) { + ServiceResponse> response = listByCustomerNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByCustomerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists billing subscription by customer id. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByCustomerNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByCustomerNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByCustomerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists billing subscription by customer id. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BillingSubscriptionInner> object + */ + public Observable> listByCustomerNextAsync(final String nextPageLink) { + return listByCustomerNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists billing subscription by customer id. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BillingSubscriptionInner> object + */ + public Observable>> listByCustomerNextWithServiceResponseAsync(final String nextPageLink) { + return listByCustomerNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByCustomerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists billing subscription by customer id. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BillingSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByCustomerNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByCustomerNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByCustomerNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByCustomerNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists billing subscriptions by billing account name. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BillingSubscriptionInner> object if successful. + */ + public PagedList listByBillingAccountNext(final String nextPageLink) { + ServiceResponse> response = listByBillingAccountNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists billing subscriptions by billing account name. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByBillingAccountNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBillingAccountNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists billing subscriptions by billing account name. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BillingSubscriptionInner> object + */ + public Observable> listByBillingAccountNextAsync(final String nextPageLink) { + return listByBillingAccountNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists billing subscriptions by billing account name. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BillingSubscriptionInner> object + */ + public Observable>> listByBillingAccountNextWithServiceResponseAsync(final String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByBillingAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists billing subscriptions by billing account name. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BillingSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBillingAccountNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByBillingAccountNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBillingAccountNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByBillingAccountNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingSubscriptionsListResultImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingSubscriptionsListResultImpl.java new file mode 100644 index 000000000000..0a5c81fe0ccd --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingSubscriptionsListResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingSubscriptionsListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class BillingSubscriptionsListResultImpl extends WrapperImpl implements BillingSubscriptionsListResult { + private final BillingManager manager; + BillingSubscriptionsListResultImpl(BillingSubscriptionsListResultInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingSubscriptionsListResultInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingSubscriptionsListResultInner.java new file mode 100644 index 000000000000..b8fe5c80b99f --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/BillingSubscriptionsListResultInner.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of listing billing subscriptions. + */ +public class BillingSubscriptionsListResultInner { + /** + * The list of billing subscriptions. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the list of billing subscriptions. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Get the link (url) to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/CustomerBillingProfileBillingAccountTransferDetailsImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/CustomerBillingProfileBillingAccountTransferDetailsImpl.java new file mode 100644 index 000000000000..6e2a3e363289 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/CustomerBillingProfileBillingAccountTransferDetailsImpl.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.CustomerBillingProfileBillingAccountTransferDetails; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.DetailedTransferStatus; +import com.microsoft.azure.management.billing.v2019_10_01_preview.TransferStatus; + +class CustomerBillingProfileBillingAccountTransferDetailsImpl extends WrapperImpl implements CustomerBillingProfileBillingAccountTransferDetails { + private final BillingManager manager; + private String billingAccountName; + private String billingProfileName; + private String customerName; + private String transferName; + + CustomerBillingProfileBillingAccountTransferDetailsImpl(TransferDetailsInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + + + @Override + public String billingAccountId() { + return this.inner().billingAccountId(); + } + + @Override + public String billingProfileId() { + return this.inner().billingProfileId(); + } + + @Override + public String canceledBy() { + return this.inner().canceledBy(); + } + + @Override + public DateTime creationTime() { + return this.inner().creationTime(); + } + + @Override + public List detailedTransferStatus() { + return this.inner().detailedTransferStatus(); + } + + @Override + public DateTime expirationTime() { + return this.inner().expirationTime(); + } + + @Override + public String initiatorCustomerType() { + return this.inner().initiatorCustomerType(); + } + + @Override + public String initiatorEmailId() { + return this.inner().initiatorEmailId(); + } + + @Override + public String invoiceSectionId() { + return this.inner().invoiceSectionId(); + } + + @Override + public DateTime lastModifiedTime() { + return this.inner().lastModifiedTime(); + } + + @Override + public String recipientEmailId() { + return this.inner().recipientEmailId(); + } + + @Override + public String resellerId() { + return this.inner().resellerId(); + } + + @Override + public String resellerName() { + return this.inner().resellerName(); + } + + @Override + public TransferStatus transferStatus() { + return this.inner().transferStatus(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/CustomerBillingProfileBillingAccountTransferDetailsModelImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/CustomerBillingProfileBillingAccountTransferDetailsModelImpl.java new file mode 100644 index 000000000000..23a52d08d2aa --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/CustomerBillingProfileBillingAccountTransferDetailsModelImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.CustomerBillingProfileBillingAccountTransferDetailsModel; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.DetailedTransferStatus; +import com.microsoft.azure.management.billing.v2019_10_01_preview.TransferStatus; + +class CustomerBillingProfileBillingAccountTransferDetailsModelImpl extends WrapperImpl implements CustomerBillingProfileBillingAccountTransferDetailsModel { + private final BillingManager manager; + + CustomerBillingProfileBillingAccountTransferDetailsModelImpl(TransferDetailsInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + + + @Override + public String billingAccountId() { + return this.inner().billingAccountId(); + } + + @Override + public String billingProfileId() { + return this.inner().billingProfileId(); + } + + @Override + public String canceledBy() { + return this.inner().canceledBy(); + } + + @Override + public DateTime creationTime() { + return this.inner().creationTime(); + } + + @Override + public List detailedTransferStatus() { + return this.inner().detailedTransferStatus(); + } + + @Override + public DateTime expirationTime() { + return this.inner().expirationTime(); + } + + @Override + public String initiatorCustomerType() { + return this.inner().initiatorCustomerType(); + } + + @Override + public String initiatorEmailId() { + return this.inner().initiatorEmailId(); + } + + @Override + public String invoiceSectionId() { + return this.inner().invoiceSectionId(); + } + + @Override + public DateTime lastModifiedTime() { + return this.inner().lastModifiedTime(); + } + + @Override + public String recipientEmailId() { + return this.inner().recipientEmailId(); + } + + @Override + public String resellerId() { + return this.inner().resellerId(); + } + + @Override + public String resellerName() { + return this.inner().resellerName(); + } + + @Override + public TransferStatus transferStatus() { + return this.inner().transferStatus(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/CustomerImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/CustomerImpl.java new file mode 100644 index 000000000000..dc3a4e36889b --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/CustomerImpl.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.Customer; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.AzurePlan; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Reseller; + +class CustomerImpl extends WrapperImpl implements Customer { + private final BillingManager manager; + + CustomerImpl(CustomerInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public List enabledAzurePlans() { + return this.inner().enabledAzurePlans(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List resellers() { + return this.inner().resellers(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/CustomerInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/CustomerInner.java new file mode 100644 index 000000000000..74428bdab8fa --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/CustomerInner.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.AzurePlan; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Reseller; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A partner's customer. + */ +@JsonFlatten +public class CustomerInner extends ProxyResource { + /** + * The name of the customer. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * Information about the product. + */ + @JsonProperty(value = "properties.enabledAzurePlans") + private List enabledAzurePlans; + + /** + * The resellers which are allowed to provide service to this customer. + */ + @JsonProperty(value = "properties.resellers") + private List resellers; + + /** + * Get the name of the customer. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the name of the customer. + * + * @param displayName the displayName value to set + * @return the CustomerInner object itself. + */ + public CustomerInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get information about the product. + * + * @return the enabledAzurePlans value + */ + public List enabledAzurePlans() { + return this.enabledAzurePlans; + } + + /** + * Set information about the product. + * + * @param enabledAzurePlans the enabledAzurePlans value to set + * @return the CustomerInner object itself. + */ + public CustomerInner withEnabledAzurePlans(List enabledAzurePlans) { + this.enabledAzurePlans = enabledAzurePlans; + return this; + } + + /** + * Get the resellers which are allowed to provide service to this customer. + * + * @return the resellers value + */ + public List resellers() { + return this.resellers; + } + + /** + * Set the resellers which are allowed to provide service to this customer. + * + * @param resellers the resellers value to set + * @return the CustomerInner object itself. + */ + public CustomerInner withResellers(List resellers) { + this.resellers = resellers; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/CustomersImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/CustomersImpl.java new file mode 100644 index 000000000000..c6a3e3cba33b --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/CustomersImpl.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Customers; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Customer; + +class CustomersImpl extends WrapperImpl implements Customers { + private final BillingManager manager; + + CustomersImpl(BillingManager manager) { + super(manager.inner().customers()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + private CustomerImpl wrapModel(CustomerInner inner) { + return new CustomerImpl(inner, manager()); + } + + @Override + public Observable listByBillingAccountAsync(final String billingAccountName) { + CustomersInner client = this.inner(); + return client.listByBillingAccountAsync(billingAccountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Customer call(CustomerInner inner) { + return new CustomerImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String billingAccountName, String customerName) { + CustomersInner client = this.inner(); + return client.getAsync(billingAccountName, customerName) + .map(new Func1() { + @Override + public Customer call(CustomerInner inner) { + return new CustomerImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByBillingProfileAsync(final String billingAccountName, final String billingProfileName) { + CustomersInner client = this.inner(); + return client.listByBillingProfileAsync(billingAccountName, billingProfileName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Customer call(CustomerInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/CustomersInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/CustomersInner.java new file mode 100644 index 000000000000..adb91f535f1b --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/CustomersInner.java @@ -0,0 +1,942 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Customers. + */ +public class CustomersInner { + /** The Retrofit service to perform REST calls. */ + private CustomersService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of CustomersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CustomersInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(CustomersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Customers to be + * used by Retrofit to perform actually REST calls. + */ + interface CustomersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Customers listByBillingProfile" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers") + Observable> listByBillingProfile(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$skiptoken") String skiptoken, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Customers listByBillingAccount" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers") + Observable> listByBillingAccount(@Path("billingAccountName") String billingAccountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$skiptoken") String skiptoken, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Customers get" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}") + Observable> get(@Path("billingAccountName") String billingAccountName, @Path("customerName") String customerName, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Customers listByBillingProfileNext" }) + @GET + Observable> listByBillingProfileNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Customers listByBillingAccountNext" }) + @GET + Observable> listByBillingAccountNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists customers by billing profile which the current user can work with on-behalf of a partner. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CustomerInner> object if successful. + */ + public PagedList listByBillingProfile(final String billingAccountName, final String billingProfileName) { + ServiceResponse> response = listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBillingProfileNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists customers by billing profile which the current user can work with on-behalf of a partner. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByBillingProfileAsync(final String billingAccountName, final String billingProfileName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBillingProfileNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists customers by billing profile which the current user can work with on-behalf of a partner. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CustomerInner> object + */ + public Observable> listByBillingProfileAsync(final String billingAccountName, final String billingProfileName) { + return listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists customers by billing profile which the current user can work with on-behalf of a partner. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CustomerInner> object + */ + public Observable>> listByBillingProfileWithServiceResponseAsync(final String billingAccountName, final String billingProfileName) { + return listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByBillingProfileNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists customers by billing profile which the current user can work with on-behalf of a partner. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CustomerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBillingProfileSinglePageAsync(final String billingAccountName, final String billingProfileName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final String skiptoken = null; + return service.listByBillingProfile(billingAccountName, billingProfileName, this.client.apiVersion(), filter, skiptoken, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBillingProfileDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists customers by billing profile which the current user can work with on-behalf of a partner. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param filter May be used to filter the list of customers. + * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CustomerInner> object if successful. + */ + public PagedList listByBillingProfile(final String billingAccountName, final String billingProfileName, final String filter, final String skiptoken) { + ServiceResponse> response = listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, filter, skiptoken).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBillingProfileNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists customers by billing profile which the current user can work with on-behalf of a partner. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param filter May be used to filter the list of customers. + * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByBillingProfileAsync(final String billingAccountName, final String billingProfileName, final String filter, final String skiptoken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, filter, skiptoken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBillingProfileNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists customers by billing profile which the current user can work with on-behalf of a partner. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param filter May be used to filter the list of customers. + * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CustomerInner> object + */ + public Observable> listByBillingProfileAsync(final String billingAccountName, final String billingProfileName, final String filter, final String skiptoken) { + return listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, filter, skiptoken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists customers by billing profile which the current user can work with on-behalf of a partner. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param filter May be used to filter the list of customers. + * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CustomerInner> object + */ + public Observable>> listByBillingProfileWithServiceResponseAsync(final String billingAccountName, final String billingProfileName, final String filter, final String skiptoken) { + return listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, filter, skiptoken) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByBillingProfileNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists customers by billing profile which the current user can work with on-behalf of a partner. + * + ServiceResponse> * @param billingAccountName billing Account Id. + ServiceResponse> * @param billingProfileName Billing Profile Id. + ServiceResponse> * @param filter May be used to filter the list of customers. + ServiceResponse> * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CustomerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBillingProfileSinglePageAsync(final String billingAccountName, final String billingProfileName, final String filter, final String skiptoken) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByBillingProfile(billingAccountName, billingProfileName, this.client.apiVersion(), filter, skiptoken, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBillingProfileDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByBillingProfileDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists customers which the current user can work with on-behalf of a partner. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CustomerInner> object if successful. + */ + public PagedList listByBillingAccount(final String billingAccountName) { + ServiceResponse> response = listByBillingAccountSinglePageAsync(billingAccountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists customers which the current user can work with on-behalf of a partner. + * + * @param billingAccountName billing Account Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByBillingAccountAsync(final String billingAccountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBillingAccountSinglePageAsync(billingAccountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists customers which the current user can work with on-behalf of a partner. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CustomerInner> object + */ + public Observable> listByBillingAccountAsync(final String billingAccountName) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists customers which the current user can work with on-behalf of a partner. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CustomerInner> object + */ + public Observable>> listByBillingAccountWithServiceResponseAsync(final String billingAccountName) { + return listByBillingAccountSinglePageAsync(billingAccountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByBillingAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists customers which the current user can work with on-behalf of a partner. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CustomerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBillingAccountSinglePageAsync(final String billingAccountName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final String skiptoken = null; + return service.listByBillingAccount(billingAccountName, this.client.apiVersion(), filter, skiptoken, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBillingAccountDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists customers which the current user can work with on-behalf of a partner. + * + * @param billingAccountName billing Account Id. + * @param filter May be used to filter the list of customers. + * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CustomerInner> object if successful. + */ + public PagedList listByBillingAccount(final String billingAccountName, final String filter, final String skiptoken) { + ServiceResponse> response = listByBillingAccountSinglePageAsync(billingAccountName, filter, skiptoken).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists customers which the current user can work with on-behalf of a partner. + * + * @param billingAccountName billing Account Id. + * @param filter May be used to filter the list of customers. + * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByBillingAccountAsync(final String billingAccountName, final String filter, final String skiptoken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBillingAccountSinglePageAsync(billingAccountName, filter, skiptoken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists customers which the current user can work with on-behalf of a partner. + * + * @param billingAccountName billing Account Id. + * @param filter May be used to filter the list of customers. + * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CustomerInner> object + */ + public Observable> listByBillingAccountAsync(final String billingAccountName, final String filter, final String skiptoken) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName, filter, skiptoken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists customers which the current user can work with on-behalf of a partner. + * + * @param billingAccountName billing Account Id. + * @param filter May be used to filter the list of customers. + * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CustomerInner> object + */ + public Observable>> listByBillingAccountWithServiceResponseAsync(final String billingAccountName, final String filter, final String skiptoken) { + return listByBillingAccountSinglePageAsync(billingAccountName, filter, skiptoken) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByBillingAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists customers which the current user can work with on-behalf of a partner. + * + ServiceResponse> * @param billingAccountName billing Account Id. + ServiceResponse> * @param filter May be used to filter the list of customers. + ServiceResponse> * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CustomerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBillingAccountSinglePageAsync(final String billingAccountName, final String filter, final String skiptoken) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByBillingAccount(billingAccountName, this.client.apiVersion(), filter, skiptoken, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBillingAccountDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByBillingAccountDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets a customer by its id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CustomerInner object if successful. + */ + public CustomerInner get(String billingAccountName, String customerName) { + return getWithServiceResponseAsync(billingAccountName, customerName).toBlocking().single().body(); + } + + /** + * Gets a customer by its id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String billingAccountName, String customerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(billingAccountName, customerName), serviceCallback); + } + + /** + * Gets a customer by its id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomerInner object + */ + public Observable getAsync(String billingAccountName, String customerName) { + return getWithServiceResponseAsync(billingAccountName, customerName).map(new Func1, CustomerInner>() { + @Override + public CustomerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a customer by its id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomerInner object + */ + public Observable> getWithServiceResponseAsync(String billingAccountName, String customerName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (customerName == null) { + throw new IllegalArgumentException("Parameter customerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + return service.get(billingAccountName, customerName, this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets a customer by its id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param expand May be used to expand enabledAzurePlans, resellers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CustomerInner object if successful. + */ + public CustomerInner get(String billingAccountName, String customerName, String expand) { + return getWithServiceResponseAsync(billingAccountName, customerName, expand).toBlocking().single().body(); + } + + /** + * Gets a customer by its id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param expand May be used to expand enabledAzurePlans, resellers. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String billingAccountName, String customerName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(billingAccountName, customerName, expand), serviceCallback); + } + + /** + * Gets a customer by its id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param expand May be used to expand enabledAzurePlans, resellers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomerInner object + */ + public Observable getAsync(String billingAccountName, String customerName, String expand) { + return getWithServiceResponseAsync(billingAccountName, customerName, expand).map(new Func1, CustomerInner>() { + @Override + public CustomerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a customer by its id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param expand May be used to expand enabledAzurePlans, resellers. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CustomerInner object + */ + public Observable> getWithServiceResponseAsync(String billingAccountName, String customerName, String expand) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (customerName == null) { + throw new IllegalArgumentException("Parameter customerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(billingAccountName, customerName, this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists customers by billing profile which the current user can work with on-behalf of a partner. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CustomerInner> object if successful. + */ + public PagedList listByBillingProfileNext(final String nextPageLink) { + ServiceResponse> response = listByBillingProfileNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBillingProfileNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists customers by billing profile which the current user can work with on-behalf of a partner. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByBillingProfileNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBillingProfileNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBillingProfileNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists customers by billing profile which the current user can work with on-behalf of a partner. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CustomerInner> object + */ + public Observable> listByBillingProfileNextAsync(final String nextPageLink) { + return listByBillingProfileNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists customers by billing profile which the current user can work with on-behalf of a partner. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CustomerInner> object + */ + public Observable>> listByBillingProfileNextWithServiceResponseAsync(final String nextPageLink) { + return listByBillingProfileNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByBillingProfileNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists customers by billing profile which the current user can work with on-behalf of a partner. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CustomerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBillingProfileNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByBillingProfileNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBillingProfileNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByBillingProfileNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists customers which the current user can work with on-behalf of a partner. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CustomerInner> object if successful. + */ + public PagedList listByBillingAccountNext(final String nextPageLink) { + ServiceResponse> response = listByBillingAccountNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists customers which the current user can work with on-behalf of a partner. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByBillingAccountNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBillingAccountNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists customers which the current user can work with on-behalf of a partner. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CustomerInner> object + */ + public Observable> listByBillingAccountNextAsync(final String nextPageLink) { + return listByBillingAccountNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists customers which the current user can work with on-behalf of a partner. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CustomerInner> object + */ + public Observable>> listByBillingAccountNextWithServiceResponseAsync(final String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByBillingAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists customers which the current user can work with on-behalf of a partner. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CustomerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBillingAccountNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByBillingAccountNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBillingAccountNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByBillingAccountNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentImpl.java new file mode 100644 index 000000000000..a9dd3611e52d --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.Department; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.ArrayList; +import com.microsoft.azure.management.billing.v2019_10_01_preview.EnrollmentAccount; +import java.util.List; + +class DepartmentImpl extends IndexableRefreshableWrapperImpl implements Department { + private final BillingManager manager; + private String billingAccountName; + private String departmentName; + + DepartmentImpl(DepartmentInner inner, BillingManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.billingAccountName = IdParsingUtils.getValueFromIdByName(inner.id(), "billingAccounts"); + this.departmentName = IdParsingUtils.getValueFromIdByName(inner.id(), "departments"); + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + DepartmentsInner client = this.manager().inner().departments(); + return client.getAsync(this.billingAccountName, this.departmentName); + } + + + + @Override + public String costCenter() { + return this.inner().costCenter(); + } + + @Override + public String departmentName() { + return this.inner().departmentName(); + } + + @Override + public List enrollmentAccounts() { + List lst = new ArrayList(); + if (this.inner().enrollmentAccounts() != null) { + for (EnrollmentAccountInner inner : this.inner().enrollmentAccounts()) { + lst.add( new EnrollmentAccountImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String status() { + return this.inner().status(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentInner.java new file mode 100644 index 000000000000..27109358b536 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentInner.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A department resource. + */ +@JsonFlatten +public class DepartmentInner extends ProxyResource { + /** + * The name for department. + */ + @JsonProperty(value = "properties.departmentName") + private String departmentName; + + /** + * The cost center name. + */ + @JsonProperty(value = "properties.costCenter") + private String costCenter; + + /** + * The status for department. + */ + @JsonProperty(value = "properties.status") + private String status; + + /** + * Associated enrollment accounts. By default this is not populated, unless + * it's specified in $expand. + */ + @JsonProperty(value = "properties.enrollmentAccounts") + private List enrollmentAccounts; + + /** + * Get the name for department. + * + * @return the departmentName value + */ + public String departmentName() { + return this.departmentName; + } + + /** + * Set the name for department. + * + * @param departmentName the departmentName value to set + * @return the DepartmentInner object itself. + */ + public DepartmentInner withDepartmentName(String departmentName) { + this.departmentName = departmentName; + return this; + } + + /** + * Get the cost center name. + * + * @return the costCenter value + */ + public String costCenter() { + return this.costCenter; + } + + /** + * Set the cost center name. + * + * @param costCenter the costCenter value to set + * @return the DepartmentInner object itself. + */ + public DepartmentInner withCostCenter(String costCenter) { + this.costCenter = costCenter; + return this; + } + + /** + * Get the status for department. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the status for department. + * + * @param status the status value to set + * @return the DepartmentInner object itself. + */ + public DepartmentInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get associated enrollment accounts. By default this is not populated, unless it's specified in $expand. + * + * @return the enrollmentAccounts value + */ + public List enrollmentAccounts() { + return this.enrollmentAccounts; + } + + /** + * Set associated enrollment accounts. By default this is not populated, unless it's specified in $expand. + * + * @param enrollmentAccounts the enrollmentAccounts value to set + * @return the DepartmentInner object itself. + */ + public DepartmentInner withEnrollmentAccounts(List enrollmentAccounts) { + this.enrollmentAccounts = enrollmentAccounts; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentListResultImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentListResultImpl.java new file mode 100644 index 000000000000..cc0841791018 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentListResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.DepartmentListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class DepartmentListResultImpl extends WrapperImpl implements DepartmentListResult { + private final BillingManager manager; + DepartmentListResultImpl(DepartmentListResultInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentListResultInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentListResultInner.java new file mode 100644 index 000000000000..eb72c5ed570f --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentListResultInner.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of listing departments. + */ +public class DepartmentListResultInner { + /** + * The list of departments. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the list of departments. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Get the link (url) to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentsImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentsImpl.java new file mode 100644 index 000000000000..e4f534ea3c37 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentsImpl.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Departments; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.billing.v2019_10_01_preview.DepartmentListResult; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Department; + +class DepartmentsImpl extends WrapperImpl implements Departments { + private final BillingManager manager; + + DepartmentsImpl(BillingManager manager) { + super(manager.inner().departments()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + private DepartmentImpl wrapModel(DepartmentInner inner) { + return new DepartmentImpl(inner, manager()); + } + + @Override + public Observable listByBillingAccountNameAsync(String billingAccountName) { + DepartmentsInner client = this.inner(); + return client.listByBillingAccountNameAsync(billingAccountName) + .map(new Func1() { + @Override + public DepartmentListResult call(DepartmentListResultInner inner) { + return new DepartmentListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String billingAccountName, String departmentName) { + DepartmentsInner client = this.inner(); + return client.getAsync(billingAccountName, departmentName) + .map(new Func1() { + @Override + public Department call(DepartmentInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentsInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentsInner.java new file mode 100644 index 000000000000..ecc73c61fd1a --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentsInner.java @@ -0,0 +1,388 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Departments. + */ +public class DepartmentsInner { + /** The Retrofit service to perform REST calls. */ + private DepartmentsService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of DepartmentsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DepartmentsInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(DepartmentsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Departments to be + * used by Retrofit to perform actually REST calls. + */ + interface DepartmentsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Departments listByBillingAccountName" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments") + Observable> listByBillingAccountName(@Path("billingAccountName") String billingAccountName, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Departments get" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/{departmentName}") + Observable> get(@Path("billingAccountName") String billingAccountName, @Path("departmentName") String departmentName, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all departments for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DepartmentListResultInner object if successful. + */ + public DepartmentListResultInner listByBillingAccountName(String billingAccountName) { + return listByBillingAccountNameWithServiceResponseAsync(billingAccountName).toBlocking().single().body(); + } + + /** + * Lists all departments for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByBillingAccountNameAsync(String billingAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingAccountNameWithServiceResponseAsync(billingAccountName), serviceCallback); + } + + /** + * Lists all departments for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DepartmentListResultInner object + */ + public Observable listByBillingAccountNameAsync(String billingAccountName) { + return listByBillingAccountNameWithServiceResponseAsync(billingAccountName).map(new Func1, DepartmentListResultInner>() { + @Override + public DepartmentListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all departments for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DepartmentListResultInner object + */ + public Observable> listByBillingAccountNameWithServiceResponseAsync(String billingAccountName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + final String filter = null; + return service.listByBillingAccountName(billingAccountName, this.client.apiVersion(), expand, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByBillingAccountNameDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists all departments for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @param expand May be used to expand the enrollmentAccounts. + * @param filter The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DepartmentListResultInner object if successful. + */ + public DepartmentListResultInner listByBillingAccountName(String billingAccountName, String expand, String filter) { + return listByBillingAccountNameWithServiceResponseAsync(billingAccountName, expand, filter).toBlocking().single().body(); + } + + /** + * Lists all departments for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @param expand May be used to expand the enrollmentAccounts. + * @param filter The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByBillingAccountNameAsync(String billingAccountName, String expand, String filter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingAccountNameWithServiceResponseAsync(billingAccountName, expand, filter), serviceCallback); + } + + /** + * Lists all departments for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @param expand May be used to expand the enrollmentAccounts. + * @param filter The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DepartmentListResultInner object + */ + public Observable listByBillingAccountNameAsync(String billingAccountName, String expand, String filter) { + return listByBillingAccountNameWithServiceResponseAsync(billingAccountName, expand, filter).map(new Func1, DepartmentListResultInner>() { + @Override + public DepartmentListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all departments for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @param expand May be used to expand the enrollmentAccounts. + * @param filter The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DepartmentListResultInner object + */ + public Observable> listByBillingAccountNameWithServiceResponseAsync(String billingAccountName, String expand, String filter) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByBillingAccountName(billingAccountName, this.client.apiVersion(), expand, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByBillingAccountNameDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByBillingAccountNameDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get the department by id. + * + * @param billingAccountName billing Account Id. + * @param departmentName Department Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DepartmentInner object if successful. + */ + public DepartmentInner get(String billingAccountName, String departmentName) { + return getWithServiceResponseAsync(billingAccountName, departmentName).toBlocking().single().body(); + } + + /** + * Get the department by id. + * + * @param billingAccountName billing Account Id. + * @param departmentName Department Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String billingAccountName, String departmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(billingAccountName, departmentName), serviceCallback); + } + + /** + * Get the department by id. + * + * @param billingAccountName billing Account Id. + * @param departmentName Department Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DepartmentInner object + */ + public Observable getAsync(String billingAccountName, String departmentName) { + return getWithServiceResponseAsync(billingAccountName, departmentName).map(new Func1, DepartmentInner>() { + @Override + public DepartmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the department by id. + * + * @param billingAccountName billing Account Id. + * @param departmentName Department Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DepartmentInner object + */ + public Observable> getWithServiceResponseAsync(String billingAccountName, String departmentName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (departmentName == null) { + throw new IllegalArgumentException("Parameter departmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + final String filter = null; + return service.get(billingAccountName, departmentName, this.client.apiVersion(), expand, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the department by id. + * + * @param billingAccountName billing Account Id. + * @param departmentName Department Id. + * @param expand May be used to expand the enrollmentAccounts. + * @param filter The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DepartmentInner object if successful. + */ + public DepartmentInner get(String billingAccountName, String departmentName, String expand, String filter) { + return getWithServiceResponseAsync(billingAccountName, departmentName, expand, filter).toBlocking().single().body(); + } + + /** + * Get the department by id. + * + * @param billingAccountName billing Account Id. + * @param departmentName Department Id. + * @param expand May be used to expand the enrollmentAccounts. + * @param filter The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String billingAccountName, String departmentName, String expand, String filter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(billingAccountName, departmentName, expand, filter), serviceCallback); + } + + /** + * Get the department by id. + * + * @param billingAccountName billing Account Id. + * @param departmentName Department Id. + * @param expand May be used to expand the enrollmentAccounts. + * @param filter The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DepartmentInner object + */ + public Observable getAsync(String billingAccountName, String departmentName, String expand, String filter) { + return getWithServiceResponseAsync(billingAccountName, departmentName, expand, filter).map(new Func1, DepartmentInner>() { + @Override + public DepartmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the department by id. + * + * @param billingAccountName billing Account Id. + * @param departmentName Department Id. + * @param expand May be used to expand the enrollmentAccounts. + * @param filter The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DepartmentInner object + */ + public Observable> getWithServiceResponseAsync(String billingAccountName, String departmentName, String expand, String filter) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (departmentName == null) { + throw new IllegalArgumentException("Parameter departmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(billingAccountName, departmentName, this.client.apiVersion(), expand, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DownloadUrlImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DownloadUrlImpl.java new file mode 100644 index 000000000000..0fac0e81f156 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DownloadUrlImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.DownloadUrl; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; + +class DownloadUrlImpl extends WrapperImpl implements DownloadUrl { + private final BillingManager manager; + DownloadUrlImpl(DownloadUrlInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public DateTime expiryTime() { + return this.inner().expiryTime(); + } + + @Override + public String url() { + return this.inner().url(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DownloadUrlInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DownloadUrlInner.java new file mode 100644 index 000000000000..d821654b7269 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DownloadUrlInner.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A secure URL that can be used to download a an entity until the URL expires. + */ +public class DownloadUrlInner { + /** + * The time in UTC at which this download URL will expire. + */ + @JsonProperty(value = "expiryTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime expiryTime; + + /** + * The URL to the PDF file. + */ + @JsonProperty(value = "url", access = JsonProperty.Access.WRITE_ONLY) + private String url; + + /** + * Get the time in UTC at which this download URL will expire. + * + * @return the expiryTime value + */ + public DateTime expiryTime() { + return this.expiryTime; + } + + /** + * Get the URL to the PDF file. + * + * @return the url value + */ + public String url() { + return this.url; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountImpl.java new file mode 100644 index 000000000000..75e3ba45bc1b --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountImpl.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.EnrollmentAccount; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Department; +import org.joda.time.DateTime; + +class EnrollmentAccountImpl extends IndexableRefreshableWrapperImpl implements EnrollmentAccount { + private final BillingManager manager; + private String billingAccountName; + private String enrollmentAccountName; + + EnrollmentAccountImpl(EnrollmentAccountInner inner, BillingManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.billingAccountName = IdParsingUtils.getValueFromIdByName(inner.id(), "billingAccounts"); + this.enrollmentAccountName = IdParsingUtils.getValueFromIdByName(inner.id(), "enrollmentAccounts"); + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + EnrollmentAccountsInner client = this.manager().inner().enrollmentAccounts(); + return client.getByEnrollmentAccountIdAsync(this.billingAccountName, this.enrollmentAccountName); + } + + + + @Override + public String accountName() { + return this.inner().accountName(); + } + + @Override + public String accountOwner() { + return this.inner().accountOwner(); + } + + @Override + public String costCenter() { + return this.inner().costCenter(); + } + + @Override + public Department department() { + DepartmentInner inner = this.inner().department(); + if (inner != null) { + return new DepartmentImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public DateTime endDate() { + return this.inner().endDate(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public DateTime startDate() { + return this.inner().startDate(); + } + + @Override + public String status() { + return this.inner().status(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountInner.java new file mode 100644 index 000000000000..290e856c4fa9 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountInner.java @@ -0,0 +1,204 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * An account resource. + */ +@JsonFlatten +public class EnrollmentAccountInner extends ProxyResource { + /** + * The account name. + */ + @JsonProperty(value = "properties.accountName") + private String accountName; + + /** + * The cost center name. + */ + @JsonProperty(value = "properties.costCenter") + private String costCenter; + + /** + * The account owner. + */ + @JsonProperty(value = "properties.accountOwner") + private String accountOwner; + + /** + * The status for account. + */ + @JsonProperty(value = "properties.status") + private String status; + + /** + * Account Start Date. + */ + @JsonProperty(value = "properties.startDate") + private DateTime startDate; + + /** + * Account End Date. + */ + @JsonProperty(value = "properties.endDate") + private DateTime endDate; + + /** + * Associated department. By default this is not populated, unless it's + * specified in $expand. + */ + @JsonProperty(value = "properties.department") + private DepartmentInner department; + + /** + * Get the account name. + * + * @return the accountName value + */ + public String accountName() { + return this.accountName; + } + + /** + * Set the account name. + * + * @param accountName the accountName value to set + * @return the EnrollmentAccountInner object itself. + */ + public EnrollmentAccountInner withAccountName(String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Get the cost center name. + * + * @return the costCenter value + */ + public String costCenter() { + return this.costCenter; + } + + /** + * Set the cost center name. + * + * @param costCenter the costCenter value to set + * @return the EnrollmentAccountInner object itself. + */ + public EnrollmentAccountInner withCostCenter(String costCenter) { + this.costCenter = costCenter; + return this; + } + + /** + * Get the account owner. + * + * @return the accountOwner value + */ + public String accountOwner() { + return this.accountOwner; + } + + /** + * Set the account owner. + * + * @param accountOwner the accountOwner value to set + * @return the EnrollmentAccountInner object itself. + */ + public EnrollmentAccountInner withAccountOwner(String accountOwner) { + this.accountOwner = accountOwner; + return this; + } + + /** + * Get the status for account. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the status for account. + * + * @param status the status value to set + * @return the EnrollmentAccountInner object itself. + */ + public EnrollmentAccountInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get account Start Date. + * + * @return the startDate value + */ + public DateTime startDate() { + return this.startDate; + } + + /** + * Set account Start Date. + * + * @param startDate the startDate value to set + * @return the EnrollmentAccountInner object itself. + */ + public EnrollmentAccountInner withStartDate(DateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get account End Date. + * + * @return the endDate value + */ + public DateTime endDate() { + return this.endDate; + } + + /** + * Set account End Date. + * + * @param endDate the endDate value to set + * @return the EnrollmentAccountInner object itself. + */ + public EnrollmentAccountInner withEndDate(DateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Get associated department. By default this is not populated, unless it's specified in $expand. + * + * @return the department value + */ + public DepartmentInner department() { + return this.department; + } + + /** + * Set associated department. By default this is not populated, unless it's specified in $expand. + * + * @param department the department value to set + * @return the EnrollmentAccountInner object itself. + */ + public EnrollmentAccountInner withDepartment(DepartmentInner department) { + this.department = department; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountListResultImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountListResultImpl.java new file mode 100644 index 000000000000..04f772ea0518 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountListResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.EnrollmentAccountListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class EnrollmentAccountListResultImpl extends WrapperImpl implements EnrollmentAccountListResult { + private final BillingManager manager; + EnrollmentAccountListResultImpl(EnrollmentAccountListResultInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountListResultInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountListResultInner.java new file mode 100644 index 000000000000..564e23b213f7 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountListResultInner.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of listing enrollment accounts. + */ +public class EnrollmentAccountListResultInner { + /** + * The list of enrollment accounts. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the list of enrollment accounts. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Get the link (url) to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountsImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountsImpl.java new file mode 100644 index 000000000000..937bbde483b6 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountsImpl.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.EnrollmentAccounts; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.billing.v2019_10_01_preview.EnrollmentAccountListResult; +import com.microsoft.azure.management.billing.v2019_10_01_preview.EnrollmentAccount; + +class EnrollmentAccountsImpl extends WrapperImpl implements EnrollmentAccounts { + private final BillingManager manager; + + EnrollmentAccountsImpl(BillingManager manager) { + super(manager.inner().enrollmentAccounts()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + private EnrollmentAccountImpl wrapModel(EnrollmentAccountInner inner) { + return new EnrollmentAccountImpl(inner, manager()); + } + + @Override + public Observable listByBillingAccountNameAsync(String billingAccountName) { + EnrollmentAccountsInner client = this.inner(); + return client.listByBillingAccountNameAsync(billingAccountName) + .map(new Func1() { + @Override + public EnrollmentAccountListResult call(EnrollmentAccountListResultInner inner) { + return new EnrollmentAccountListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getByEnrollmentAccountIdAsync(String billingAccountName, String enrollmentAccountName) { + EnrollmentAccountsInner client = this.inner(); + return client.getByEnrollmentAccountIdAsync(billingAccountName, enrollmentAccountName) + .map(new Func1() { + @Override + public EnrollmentAccount call(EnrollmentAccountInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountsInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountsInner.java new file mode 100644 index 000000000000..37e09e04fe11 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountsInner.java @@ -0,0 +1,388 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in EnrollmentAccounts. + */ +public class EnrollmentAccountsInner { + /** The Retrofit service to perform REST calls. */ + private EnrollmentAccountsService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of EnrollmentAccountsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public EnrollmentAccountsInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(EnrollmentAccountsService.class); + this.client = client; + } + + /** + * The interface defining all the services for EnrollmentAccounts to be + * used by Retrofit to perform actually REST calls. + */ + interface EnrollmentAccountsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.EnrollmentAccounts listByBillingAccountName" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts") + Observable> listByBillingAccountName(@Path("billingAccountName") String billingAccountName, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.EnrollmentAccounts getByEnrollmentAccountId" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}") + Observable> getByEnrollmentAccountId(@Path("billingAccountName") String billingAccountName, @Path("enrollmentAccountName") String enrollmentAccountName, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all Enrollment Accounts for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EnrollmentAccountListResultInner object if successful. + */ + public EnrollmentAccountListResultInner listByBillingAccountName(String billingAccountName) { + return listByBillingAccountNameWithServiceResponseAsync(billingAccountName).toBlocking().single().body(); + } + + /** + * Lists all Enrollment Accounts for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByBillingAccountNameAsync(String billingAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingAccountNameWithServiceResponseAsync(billingAccountName), serviceCallback); + } + + /** + * Lists all Enrollment Accounts for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EnrollmentAccountListResultInner object + */ + public Observable listByBillingAccountNameAsync(String billingAccountName) { + return listByBillingAccountNameWithServiceResponseAsync(billingAccountName).map(new Func1, EnrollmentAccountListResultInner>() { + @Override + public EnrollmentAccountListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all Enrollment Accounts for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EnrollmentAccountListResultInner object + */ + public Observable> listByBillingAccountNameWithServiceResponseAsync(String billingAccountName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + final String filter = null; + return service.listByBillingAccountName(billingAccountName, this.client.apiVersion(), expand, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByBillingAccountNameDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists all Enrollment Accounts for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @param expand May be used to expand the department. + * @param filter The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EnrollmentAccountListResultInner object if successful. + */ + public EnrollmentAccountListResultInner listByBillingAccountName(String billingAccountName, String expand, String filter) { + return listByBillingAccountNameWithServiceResponseAsync(billingAccountName, expand, filter).toBlocking().single().body(); + } + + /** + * Lists all Enrollment Accounts for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @param expand May be used to expand the department. + * @param filter The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByBillingAccountNameAsync(String billingAccountName, String expand, String filter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingAccountNameWithServiceResponseAsync(billingAccountName, expand, filter), serviceCallback); + } + + /** + * Lists all Enrollment Accounts for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @param expand May be used to expand the department. + * @param filter The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EnrollmentAccountListResultInner object + */ + public Observable listByBillingAccountNameAsync(String billingAccountName, String expand, String filter) { + return listByBillingAccountNameWithServiceResponseAsync(billingAccountName, expand, filter).map(new Func1, EnrollmentAccountListResultInner>() { + @Override + public EnrollmentAccountListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all Enrollment Accounts for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @param expand May be used to expand the department. + * @param filter The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EnrollmentAccountListResultInner object + */ + public Observable> listByBillingAccountNameWithServiceResponseAsync(String billingAccountName, String expand, String filter) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByBillingAccountName(billingAccountName, this.client.apiVersion(), expand, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByBillingAccountNameDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByBillingAccountNameDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get the enrollment account by id. + * + * @param billingAccountName billing Account Id. + * @param enrollmentAccountName Enrollment Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EnrollmentAccountInner object if successful. + */ + public EnrollmentAccountInner getByEnrollmentAccountId(String billingAccountName, String enrollmentAccountName) { + return getByEnrollmentAccountIdWithServiceResponseAsync(billingAccountName, enrollmentAccountName).toBlocking().single().body(); + } + + /** + * Get the enrollment account by id. + * + * @param billingAccountName billing Account Id. + * @param enrollmentAccountName Enrollment Account Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByEnrollmentAccountIdAsync(String billingAccountName, String enrollmentAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByEnrollmentAccountIdWithServiceResponseAsync(billingAccountName, enrollmentAccountName), serviceCallback); + } + + /** + * Get the enrollment account by id. + * + * @param billingAccountName billing Account Id. + * @param enrollmentAccountName Enrollment Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EnrollmentAccountInner object + */ + public Observable getByEnrollmentAccountIdAsync(String billingAccountName, String enrollmentAccountName) { + return getByEnrollmentAccountIdWithServiceResponseAsync(billingAccountName, enrollmentAccountName).map(new Func1, EnrollmentAccountInner>() { + @Override + public EnrollmentAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the enrollment account by id. + * + * @param billingAccountName billing Account Id. + * @param enrollmentAccountName Enrollment Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EnrollmentAccountInner object + */ + public Observable> getByEnrollmentAccountIdWithServiceResponseAsync(String billingAccountName, String enrollmentAccountName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (enrollmentAccountName == null) { + throw new IllegalArgumentException("Parameter enrollmentAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + final String filter = null; + return service.getByEnrollmentAccountId(billingAccountName, enrollmentAccountName, this.client.apiVersion(), expand, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByEnrollmentAccountIdDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the enrollment account by id. + * + * @param billingAccountName billing Account Id. + * @param enrollmentAccountName Enrollment Account Id. + * @param expand May be used to expand the Department. + * @param filter The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EnrollmentAccountInner object if successful. + */ + public EnrollmentAccountInner getByEnrollmentAccountId(String billingAccountName, String enrollmentAccountName, String expand, String filter) { + return getByEnrollmentAccountIdWithServiceResponseAsync(billingAccountName, enrollmentAccountName, expand, filter).toBlocking().single().body(); + } + + /** + * Get the enrollment account by id. + * + * @param billingAccountName billing Account Id. + * @param enrollmentAccountName Enrollment Account Id. + * @param expand May be used to expand the Department. + * @param filter The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByEnrollmentAccountIdAsync(String billingAccountName, String enrollmentAccountName, String expand, String filter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByEnrollmentAccountIdWithServiceResponseAsync(billingAccountName, enrollmentAccountName, expand, filter), serviceCallback); + } + + /** + * Get the enrollment account by id. + * + * @param billingAccountName billing Account Id. + * @param enrollmentAccountName Enrollment Account Id. + * @param expand May be used to expand the Department. + * @param filter The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EnrollmentAccountInner object + */ + public Observable getByEnrollmentAccountIdAsync(String billingAccountName, String enrollmentAccountName, String expand, String filter) { + return getByEnrollmentAccountIdWithServiceResponseAsync(billingAccountName, enrollmentAccountName, expand, filter).map(new Func1, EnrollmentAccountInner>() { + @Override + public EnrollmentAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the enrollment account by id. + * + * @param billingAccountName billing Account Id. + * @param enrollmentAccountName Enrollment Account Id. + * @param expand May be used to expand the Department. + * @param filter The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EnrollmentAccountInner object + */ + public Observable> getByEnrollmentAccountIdWithServiceResponseAsync(String billingAccountName, String enrollmentAccountName, String expand, String filter) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (enrollmentAccountName == null) { + throw new IllegalArgumentException("Parameter enrollmentAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByEnrollmentAccountId(billingAccountName, enrollmentAccountName, this.client.apiVersion(), expand, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByEnrollmentAccountIdDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByEnrollmentAccountIdDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/IdParsingUtils.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..9c79128c4a05 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceImpl.java new file mode 100644 index 000000000000..80f6c425dd1d --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceImpl.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.Invoice; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Amount; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Document; +import org.joda.time.DateTime; +import com.microsoft.azure.management.billing.v2019_10_01_preview.PaymentProperties; +import com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceStatus; + +class InvoiceImpl extends WrapperImpl implements Invoice { + private final BillingManager manager; + InvoiceImpl(InvoiceInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public Amount amountDue() { + return this.inner().amountDue(); + } + + @Override + public Amount billedAmount() { + return this.inner().billedAmount(); + } + + @Override + public String billingProfileDisplayName() { + return this.inner().billingProfileDisplayName(); + } + + @Override + public String billingProfileId() { + return this.inner().billingProfileId(); + } + + @Override + public List documents() { + return this.inner().documents(); + } + + @Override + public DateTime dueDate() { + return this.inner().dueDate(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime invoiceDate() { + return this.inner().invoiceDate(); + } + + @Override + public DateTime invoicePeriodEndDate() { + return this.inner().invoicePeriodEndDate(); + } + + @Override + public DateTime invoicePeriodStartDate() { + return this.inner().invoicePeriodStartDate(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List payments() { + return this.inner().payments(); + } + + @Override + public String purchaseOrderNumber() { + return this.inner().purchaseOrderNumber(); + } + + @Override + public InvoiceStatus status() { + return this.inner().status(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceInner.java new file mode 100644 index 000000000000..acb990363999 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceInner.java @@ -0,0 +1,208 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceStatus; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Amount; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Document; +import com.microsoft.azure.management.billing.v2019_10_01_preview.PaymentProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * An invoice resource. + */ +@JsonFlatten +public class InvoiceInner extends ProxyResource { + /** + * The due date for invoice. + */ + @JsonProperty(value = "properties.dueDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime dueDate; + + /** + * The date when invoice was created. + */ + @JsonProperty(value = "properties.invoiceDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime invoiceDate; + + /** + * Invoice status. Possible values include: 'PastDue', 'Due', 'Paid', + * 'Void'. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private InvoiceStatus status; + + /** + * Amount due. + */ + @JsonProperty(value = "properties.amountDue", access = JsonProperty.Access.WRITE_ONLY) + private Amount amountDue; + + /** + * Amount billed. + */ + @JsonProperty(value = "properties.billedAmount", access = JsonProperty.Access.WRITE_ONLY) + private Amount billedAmount; + + /** + * The start date of the billing period. + */ + @JsonProperty(value = "properties.invoicePeriodStartDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime invoicePeriodStartDate; + + /** + * The end date of the billing period. + */ + @JsonProperty(value = "properties.invoicePeriodEndDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime invoicePeriodEndDate; + + /** + * The billing profile id this invoice belongs to. + */ + @JsonProperty(value = "properties.billingProfileId", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileId; + + /** + * The billing profile display name this invoice belongs to. + */ + @JsonProperty(value = "properties.billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileDisplayName; + + /** + * The purchase identifier for the invoice. + */ + @JsonProperty(value = "properties.purchaseOrderNumber", access = JsonProperty.Access.WRITE_ONLY) + private String purchaseOrderNumber; + + /** + * List of documents available to download including invoice and tax + * documents. + */ + @JsonProperty(value = "properties.documents", access = JsonProperty.Access.WRITE_ONLY) + private List documents; + + /** + * List of payments. + */ + @JsonProperty(value = "properties.payments", access = JsonProperty.Access.WRITE_ONLY) + private List payments; + + /** + * Get the due date for invoice. + * + * @return the dueDate value + */ + public DateTime dueDate() { + return this.dueDate; + } + + /** + * Get the date when invoice was created. + * + * @return the invoiceDate value + */ + public DateTime invoiceDate() { + return this.invoiceDate; + } + + /** + * Get invoice status. Possible values include: 'PastDue', 'Due', 'Paid', 'Void'. + * + * @return the status value + */ + public InvoiceStatus status() { + return this.status; + } + + /** + * Get amount due. + * + * @return the amountDue value + */ + public Amount amountDue() { + return this.amountDue; + } + + /** + * Get amount billed. + * + * @return the billedAmount value + */ + public Amount billedAmount() { + return this.billedAmount; + } + + /** + * Get the start date of the billing period. + * + * @return the invoicePeriodStartDate value + */ + public DateTime invoicePeriodStartDate() { + return this.invoicePeriodStartDate; + } + + /** + * Get the end date of the billing period. + * + * @return the invoicePeriodEndDate value + */ + public DateTime invoicePeriodEndDate() { + return this.invoicePeriodEndDate; + } + + /** + * Get the billing profile id this invoice belongs to. + * + * @return the billingProfileId value + */ + public String billingProfileId() { + return this.billingProfileId; + } + + /** + * Get the billing profile display name this invoice belongs to. + * + * @return the billingProfileDisplayName value + */ + public String billingProfileDisplayName() { + return this.billingProfileDisplayName; + } + + /** + * Get the purchase identifier for the invoice. + * + * @return the purchaseOrderNumber value + */ + public String purchaseOrderNumber() { + return this.purchaseOrderNumber; + } + + /** + * Get list of documents available to download including invoice and tax documents. + * + * @return the documents value + */ + public List documents() { + return this.documents; + } + + /** + * Get list of payments. + * + * @return the payments value + */ + public List payments() { + return this.payments; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceListResultImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceListResultImpl.java new file mode 100644 index 000000000000..e5add162c32c --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceListResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class InvoiceListResultImpl extends WrapperImpl implements InvoiceListResult { + private final BillingManager manager; + InvoiceListResultImpl(InvoiceListResultInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceListResultInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceListResultInner.java new file mode 100644 index 000000000000..f23585b59e82 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceListResultInner.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of listing invoices. + */ +public class InvoiceListResultInner { + /** + * The list of invoices. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the list of invoices. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Get the link (url) to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionBillingProfileBillingAccountTransferDetailsImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionBillingProfileBillingAccountTransferDetailsImpl.java new file mode 100644 index 000000000000..ac9123c37bdc --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionBillingProfileBillingAccountTransferDetailsImpl.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceSectionBillingProfileBillingAccountTransferDetails; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.DetailedTransferStatus; +import com.microsoft.azure.management.billing.v2019_10_01_preview.TransferStatus; + +class InvoiceSectionBillingProfileBillingAccountTransferDetailsImpl extends WrapperImpl implements InvoiceSectionBillingProfileBillingAccountTransferDetails { + private final BillingManager manager; + private String billingAccountName; + private String billingProfileName; + private String invoiceSectionName; + private String transferName; + + InvoiceSectionBillingProfileBillingAccountTransferDetailsImpl(TransferDetailsInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + + + @Override + public String billingAccountId() { + return this.inner().billingAccountId(); + } + + @Override + public String billingProfileId() { + return this.inner().billingProfileId(); + } + + @Override + public String canceledBy() { + return this.inner().canceledBy(); + } + + @Override + public DateTime creationTime() { + return this.inner().creationTime(); + } + + @Override + public List detailedTransferStatus() { + return this.inner().detailedTransferStatus(); + } + + @Override + public DateTime expirationTime() { + return this.inner().expirationTime(); + } + + @Override + public String initiatorCustomerType() { + return this.inner().initiatorCustomerType(); + } + + @Override + public String initiatorEmailId() { + return this.inner().initiatorEmailId(); + } + + @Override + public String invoiceSectionId() { + return this.inner().invoiceSectionId(); + } + + @Override + public DateTime lastModifiedTime() { + return this.inner().lastModifiedTime(); + } + + @Override + public String recipientEmailId() { + return this.inner().recipientEmailId(); + } + + @Override + public String resellerId() { + return this.inner().resellerId(); + } + + @Override + public String resellerName() { + return this.inner().resellerName(); + } + + @Override + public TransferStatus transferStatus() { + return this.inner().transferStatus(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionImpl.java new file mode 100644 index 000000000000..a75bb2c2bcb6 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionImpl.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceSection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; + +class InvoiceSectionImpl extends CreatableUpdatableImpl implements InvoiceSection, InvoiceSection.Definition, InvoiceSection.Update { + private final BillingManager manager; + private String billingAccountName; + private String billingProfileName; + private String invoiceSectionName; + private String cdisplayName; + private String udisplayName; + + InvoiceSectionImpl(String name, BillingManager manager) { + super(name, new InvoiceSectionInner()); + this.manager = manager; + // Set resource name + this.invoiceSectionName = name; + // + } + + InvoiceSectionImpl(InvoiceSectionInner inner, BillingManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.invoiceSectionName = inner.name(); + // set resource ancestor and positional variables + this.billingAccountName = IdParsingUtils.getValueFromIdByName(inner.id(), "billingAccounts"); + this.billingProfileName = IdParsingUtils.getValueFromIdByName(inner.id(), "billingProfiles"); + this.invoiceSectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "invoiceSections"); + // + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + InvoiceSectionsInner client = this.manager().inner().invoiceSections(); + return client.createAsync(this.billingAccountName, this.billingProfileName, this.invoiceSectionName, this.cdisplayName) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + InvoiceSectionsInner client = this.manager().inner().invoiceSections(); + return client.updateAsync(this.billingAccountName, this.billingProfileName, this.invoiceSectionName, this.udisplayName) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + InvoiceSectionsInner client = this.manager().inner().invoiceSections(); + return client.getAsync(this.billingAccountName, this.billingProfileName, this.invoiceSectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public InvoiceSectionImpl withExistingBillingProfile(String billingAccountName, String billingProfileName) { + this.billingAccountName = billingAccountName; + this.billingProfileName = billingProfileName; + return this; + } + + @Override + public InvoiceSectionImpl withDisplayName(String displayName) { + if (isInCreateMode()) { + this.cdisplayName = displayName; + } else { + this.udisplayName = displayName; + } + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionInner.java new file mode 100644 index 000000000000..dfe55157ffd6 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionInner.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * An InvoiceSection resource. + */ +@JsonFlatten +public class InvoiceSectionInner extends ProxyResource { + /** + * The name of the InvoiceSection. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * Get the name of the InvoiceSection. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the name of the InvoiceSection. + * + * @param displayName the displayName value to set + * @return the InvoiceSectionInner object itself. + */ + public InvoiceSectionInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionListResultImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionListResultImpl.java new file mode 100644 index 000000000000..0c429bfbd735 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionListResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceSectionListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class InvoiceSectionListResultImpl extends WrapperImpl implements InvoiceSectionListResult { + private final BillingManager manager; + InvoiceSectionListResultImpl(InvoiceSectionListResultInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionListResultInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionListResultInner.java new file mode 100644 index 000000000000..c7ded29169da --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionListResultInner.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of listing invoice sections. + */ +public class InvoiceSectionListResultInner { + /** + * The list of invoice sections. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the list of invoice sections. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Get the link (url) to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionWithCreateSubPermissionImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionWithCreateSubPermissionImpl.java new file mode 100644 index 000000000000..84a6ef80ac9d --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionWithCreateSubPermissionImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceSectionWithCreateSubPermission; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.AzurePlan; + +class InvoiceSectionWithCreateSubPermissionImpl extends WrapperImpl implements InvoiceSectionWithCreateSubPermission { + private final BillingManager manager; + InvoiceSectionWithCreateSubPermissionImpl(InvoiceSectionWithCreateSubPermissionInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public String billingProfileDisplayName() { + return this.inner().billingProfileDisplayName(); + } + + @Override + public String billingProfileId() { + return this.inner().billingProfileId(); + } + + @Override + public List enabledAzurePlans() { + return this.inner().enabledAzurePlans(); + } + + @Override + public String invoiceSectionDisplayName() { + return this.inner().invoiceSectionDisplayName(); + } + + @Override + public String invoiceSectionId() { + return this.inner().invoiceSectionId(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionWithCreateSubPermissionInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionWithCreateSubPermissionInner.java new file mode 100644 index 000000000000..005b7acd2fda --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionWithCreateSubPermissionInner.java @@ -0,0 +1,105 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.AzurePlan; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Invoice section properties with create subscription permission. + */ +public class InvoiceSectionWithCreateSubPermissionInner { + /** + * Invoice Section Id. + */ + @JsonProperty(value = "invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionId; + + /** + * Invoice Section display name. + */ + @JsonProperty(value = "invoiceSectionDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionDisplayName; + + /** + * Billing profile Id. + */ + @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileId; + + /** + * Billing profile display name. + */ + @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileDisplayName; + + /** + * Enabled azure plans for the associated billing profile. + */ + @JsonProperty(value = "enabledAzurePlans") + private List enabledAzurePlans; + + /** + * Get invoice Section Id. + * + * @return the invoiceSectionId value + */ + public String invoiceSectionId() { + return this.invoiceSectionId; + } + + /** + * Get invoice Section display name. + * + * @return the invoiceSectionDisplayName value + */ + public String invoiceSectionDisplayName() { + return this.invoiceSectionDisplayName; + } + + /** + * Get billing profile Id. + * + * @return the billingProfileId value + */ + public String billingProfileId() { + return this.billingProfileId; + } + + /** + * Get billing profile display name. + * + * @return the billingProfileDisplayName value + */ + public String billingProfileDisplayName() { + return this.billingProfileDisplayName; + } + + /** + * Get enabled azure plans for the associated billing profile. + * + * @return the enabledAzurePlans value + */ + public List enabledAzurePlans() { + return this.enabledAzurePlans; + } + + /** + * Set enabled azure plans for the associated billing profile. + * + * @param enabledAzurePlans the enabledAzurePlans value to set + * @return the InvoiceSectionWithCreateSubPermissionInner object itself. + */ + public InvoiceSectionWithCreateSubPermissionInner withEnabledAzurePlans(List enabledAzurePlans) { + this.enabledAzurePlans = enabledAzurePlans; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionsImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionsImpl.java new file mode 100644 index 000000000000..74414e640b04 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionsImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceSections; +import rx.Observable; +import rx.functions.Func1; +import rx.Completable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceSectionListResult; +import com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceSection; + +class InvoiceSectionsImpl extends WrapperImpl implements InvoiceSections { + private final BillingManager manager; + + InvoiceSectionsImpl(BillingManager manager) { + super(manager.inner().invoiceSections()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + @Override + public InvoiceSectionImpl define(String name) { + return wrapModel(name); + } + + private InvoiceSectionImpl wrapModel(InvoiceSectionInner inner) { + return new InvoiceSectionImpl(inner, manager()); + } + + private InvoiceSectionImpl wrapModel(String name) { + return new InvoiceSectionImpl(name, this.manager()); + } + + @Override + public Observable listByBillingProfileAsync(String billingAccountName, String billingProfileName) { + InvoiceSectionsInner client = this.inner(); + return client.listByBillingProfileAsync(billingAccountName, billingProfileName) + .map(new Func1() { + @Override + public InvoiceSectionListResult call(InvoiceSectionListResultInner inner) { + return new InvoiceSectionListResultImpl(inner, manager()); + } + }); + } + + @Override + public Completable elevateToBillingProfileAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + InvoiceSectionsInner client = this.inner(); + return client.elevateToBillingProfileAsync(billingAccountName, billingProfileName, invoiceSectionName).toCompletable(); + } + + @Override + public Observable getAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + InvoiceSectionsInner client = this.inner(); + return client.getAsync(billingAccountName, billingProfileName, invoiceSectionName) + .map(new Func1() { + @Override + public InvoiceSection call(InvoiceSectionInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionsInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionsInner.java new file mode 100644 index 000000000000..d8f5d9f0c10c --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoiceSectionsInner.java @@ -0,0 +1,1025 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceSectionCreationRequest; +import com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceSectionsCreateHeaders; +import com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceSectionsUpdateHeaders; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in InvoiceSections. + */ +public class InvoiceSectionsInner { + /** The Retrofit service to perform REST calls. */ + private InvoiceSectionsService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of InvoiceSectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public InvoiceSectionsInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(InvoiceSectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for InvoiceSections to be + * used by Retrofit to perform actually REST calls. + */ + interface InvoiceSectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceSections listByBillingProfile" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections") + Observable> listByBillingProfile(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceSections get" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}") + Observable> get(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceSections create" }) + @PUT("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}") + Observable> create(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body InvoiceSectionCreationRequest parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceSections beginCreate" }) + @PUT("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}") + Observable> beginCreate(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body InvoiceSectionCreationRequest parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceSections update" }) + @PATCH("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}") + Observable> update(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body InvoiceSectionInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceSections beginUpdate" }) + @PATCH("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}") + Observable> beginUpdate(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body InvoiceSectionInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceSections elevateToBillingProfile" }) + @POST("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/elevate") + Observable> elevateToBillingProfile(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all invoice sections for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InvoiceSectionListResultInner object if successful. + */ + public InvoiceSectionListResultInner listByBillingProfile(String billingAccountName, String billingProfileName) { + return listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName).toBlocking().single().body(); + } + + /** + * Lists all invoice sections for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByBillingProfileAsync(String billingAccountName, String billingProfileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName), serviceCallback); + } + + /** + * Lists all invoice sections for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InvoiceSectionListResultInner object + */ + public Observable listByBillingProfileAsync(String billingAccountName, String billingProfileName) { + return listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName).map(new Func1, InvoiceSectionListResultInner>() { + @Override + public InvoiceSectionListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all invoice sections for a user which he has access to. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InvoiceSectionListResultInner object + */ + public Observable> listByBillingProfileWithServiceResponseAsync(String billingAccountName, String billingProfileName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByBillingProfile(billingAccountName, billingProfileName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByBillingProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByBillingProfileDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get the InvoiceSection by id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InvoiceSectionInner object if successful. + */ + public InvoiceSectionInner get(String billingAccountName, String billingProfileName, String invoiceSectionName) { + return getWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName).toBlocking().single().body(); + } + + /** + * Get the InvoiceSection by id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName), serviceCallback); + } + + /** + * Get the InvoiceSection by id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InvoiceSectionInner object + */ + public Observable getAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + return getWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName).map(new Func1, InvoiceSectionInner>() { + @Override + public InvoiceSectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the InvoiceSection by id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InvoiceSectionInner object + */ + public Observable> getWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(billingAccountName, billingProfileName, invoiceSectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * The operation to create an invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InvoiceSectionInner object if successful. + */ + public InvoiceSectionInner create(String billingAccountName, String billingProfileName, String invoiceSectionName) { + return createWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName).toBlocking().last().body(); + } + + /** + * The operation to create an invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(createWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName), serviceCallback); + } + + /** + * The operation to create an invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + return createWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName).map(new Func1, InvoiceSectionInner>() { + @Override + public InvoiceSectionInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * The operation to create an invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String displayName = null; + InvoiceSectionCreationRequest parameters = new InvoiceSectionCreationRequest(); + parameters.withDisplayName(null); + Observable> observable = service.create(billingAccountName, billingProfileName, invoiceSectionName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), InvoiceSectionsCreateHeaders.class); + } + /** + * The operation to create an invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param displayName The name of the InvoiceSection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InvoiceSectionInner object if successful. + */ + public InvoiceSectionInner create(String billingAccountName, String billingProfileName, String invoiceSectionName, String displayName) { + return createWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, displayName).toBlocking().last().body(); + } + + /** + * The operation to create an invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param displayName The name of the InvoiceSection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String displayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(createWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, displayName), serviceCallback); + } + + /** + * The operation to create an invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param displayName The name of the InvoiceSection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String displayName) { + return createWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, displayName).map(new Func1, InvoiceSectionInner>() { + @Override + public InvoiceSectionInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * The operation to create an invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param displayName The name of the InvoiceSection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String displayName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + InvoiceSectionCreationRequest parameters = new InvoiceSectionCreationRequest(); + parameters.withDisplayName(displayName); + Observable> observable = service.create(billingAccountName, billingProfileName, invoiceSectionName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), InvoiceSectionsCreateHeaders.class); + } + + /** + * The operation to create an invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InvoiceSectionInner object if successful. + */ + public InvoiceSectionInner beginCreate(String billingAccountName, String billingProfileName, String invoiceSectionName) { + return beginCreateWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName).toBlocking().single().body(); + } + + /** + * The operation to create an invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginCreateWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName), serviceCallback); + } + + /** + * The operation to create an invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InvoiceSectionInner object + */ + public Observable beginCreateAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + return beginCreateWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName).map(new Func1, InvoiceSectionInner>() { + @Override + public InvoiceSectionInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * The operation to create an invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InvoiceSectionInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String displayName = null; + InvoiceSectionCreationRequest parameters = new InvoiceSectionCreationRequest(); + parameters.withDisplayName(null); + return service.beginCreate(billingAccountName, billingProfileName, invoiceSectionName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The operation to create an invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param displayName The name of the InvoiceSection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InvoiceSectionInner object if successful. + */ + public InvoiceSectionInner beginCreate(String billingAccountName, String billingProfileName, String invoiceSectionName, String displayName) { + return beginCreateWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, displayName).toBlocking().single().body(); + } + + /** + * The operation to create an invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param displayName The name of the InvoiceSection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String displayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginCreateWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, displayName), serviceCallback); + } + + /** + * The operation to create an invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param displayName The name of the InvoiceSection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InvoiceSectionInner object + */ + public Observable beginCreateAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String displayName) { + return beginCreateWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, displayName).map(new Func1, InvoiceSectionInner>() { + @Override + public InvoiceSectionInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * The operation to create an invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param displayName The name of the InvoiceSection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InvoiceSectionInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String displayName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + InvoiceSectionCreationRequest parameters = new InvoiceSectionCreationRequest(); + parameters.withDisplayName(displayName); + return service.beginCreate(billingAccountName, billingProfileName, invoiceSectionName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .buildWithHeaders(response, InvoiceSectionsCreateHeaders.class); + } + + /** + * The operation to update a InvoiceSection. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InvoiceSectionInner object if successful. + */ + public InvoiceSectionInner update(String billingAccountName, String billingProfileName, String invoiceSectionName) { + return updateWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName).toBlocking().last().body(); + } + + /** + * The operation to update a InvoiceSection. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(updateWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName), serviceCallback); + } + + /** + * The operation to update a InvoiceSection. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + return updateWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName).map(new Func1, InvoiceSectionInner>() { + @Override + public InvoiceSectionInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * The operation to update a InvoiceSection. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String displayName = null; + InvoiceSectionInner parameters = new InvoiceSectionInner(); + parameters.withDisplayName(null); + Observable> observable = service.update(billingAccountName, billingProfileName, invoiceSectionName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), InvoiceSectionsUpdateHeaders.class); + } + /** + * The operation to update a InvoiceSection. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param displayName The name of the InvoiceSection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InvoiceSectionInner object if successful. + */ + public InvoiceSectionInner update(String billingAccountName, String billingProfileName, String invoiceSectionName, String displayName) { + return updateWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, displayName).toBlocking().last().body(); + } + + /** + * The operation to update a InvoiceSection. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param displayName The name of the InvoiceSection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String displayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(updateWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, displayName), serviceCallback); + } + + /** + * The operation to update a InvoiceSection. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param displayName The name of the InvoiceSection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String displayName) { + return updateWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, displayName).map(new Func1, InvoiceSectionInner>() { + @Override + public InvoiceSectionInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * The operation to update a InvoiceSection. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param displayName The name of the InvoiceSection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String displayName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + InvoiceSectionInner parameters = new InvoiceSectionInner(); + parameters.withDisplayName(displayName); + Observable> observable = service.update(billingAccountName, billingProfileName, invoiceSectionName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), InvoiceSectionsUpdateHeaders.class); + } + + /** + * The operation to update a InvoiceSection. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InvoiceSectionInner object if successful. + */ + public InvoiceSectionInner beginUpdate(String billingAccountName, String billingProfileName, String invoiceSectionName) { + return beginUpdateWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName).toBlocking().single().body(); + } + + /** + * The operation to update a InvoiceSection. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginUpdateWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName), serviceCallback); + } + + /** + * The operation to update a InvoiceSection. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InvoiceSectionInner object + */ + public Observable beginUpdateAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + return beginUpdateWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName).map(new Func1, InvoiceSectionInner>() { + @Override + public InvoiceSectionInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * The operation to update a InvoiceSection. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InvoiceSectionInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String displayName = null; + InvoiceSectionInner parameters = new InvoiceSectionInner(); + parameters.withDisplayName(null); + return service.beginUpdate(billingAccountName, billingProfileName, invoiceSectionName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The operation to update a InvoiceSection. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param displayName The name of the InvoiceSection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InvoiceSectionInner object if successful. + */ + public InvoiceSectionInner beginUpdate(String billingAccountName, String billingProfileName, String invoiceSectionName, String displayName) { + return beginUpdateWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, displayName).toBlocking().single().body(); + } + + /** + * The operation to update a InvoiceSection. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param displayName The name of the InvoiceSection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String displayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginUpdateWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, displayName), serviceCallback); + } + + /** + * The operation to update a InvoiceSection. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param displayName The name of the InvoiceSection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InvoiceSectionInner object + */ + public Observable beginUpdateAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String displayName) { + return beginUpdateWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, displayName).map(new Func1, InvoiceSectionInner>() { + @Override + public InvoiceSectionInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * The operation to update a InvoiceSection. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param displayName The name of the InvoiceSection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InvoiceSectionInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String displayName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + InvoiceSectionInner parameters = new InvoiceSectionInner(); + parameters.withDisplayName(displayName); + return service.beginUpdate(billingAccountName, billingProfileName, invoiceSectionName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .buildWithHeaders(response, InvoiceSectionsUpdateHeaders.class); + } + + /** + * Elevates the caller's access to match their billing profile access. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void elevateToBillingProfile(String billingAccountName, String billingProfileName, String invoiceSectionName) { + elevateToBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName).toBlocking().single().body(); + } + + /** + * Elevates the caller's access to match their billing profile access. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture elevateToBillingProfileAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(elevateToBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName), serviceCallback); + } + + /** + * Elevates the caller's access to match their billing profile access. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable elevateToBillingProfileAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + return elevateToBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Elevates the caller's access to match their billing profile access. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> elevateToBillingProfileWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + return service.elevateToBillingProfile(billingAccountName, billingProfileName, invoiceSectionName, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = elevateToBillingProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse elevateToBillingProfileDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoicesImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoicesImpl.java new file mode 100644 index 000000000000..e7bd32ca16bb --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoicesImpl.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Invoices; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceListResult; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Invoice; + +class InvoicesImpl extends WrapperImpl implements Invoices { + private final BillingManager manager; + + InvoicesImpl(BillingManager manager) { + super(manager.inner().invoices()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + @Override + public Observable listByBillingAccountAsync(String billingAccountName, String periodStartDate, String periodEndDate) { + InvoicesInner client = this.inner(); + return client.listByBillingAccountAsync(billingAccountName, periodStartDate, periodEndDate) + .map(new Func1() { + @Override + public InvoiceListResult call(InvoiceListResultInner inner) { + return new InvoiceListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByBillingProfileAsync(String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate) { + InvoicesInner client = this.inner(); + return client.listByBillingProfileAsync(billingAccountName, billingProfileName, periodStartDate, periodEndDate) + .map(new Func1() { + @Override + public InvoiceListResult call(InvoiceListResultInner inner) { + return new InvoiceListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String billingAccountName, String billingProfileName, String invoiceName) { + InvoicesInner client = this.inner(); + return client.getAsync(billingAccountName, billingProfileName, invoiceName) + .map(new Func1() { + @Override + public Invoice call(InvoiceInner inner) { + return new InvoiceImpl(inner, manager()); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoicesInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoicesInner.java new file mode 100644 index 000000000000..e78372b2bab4 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/InvoicesInner.java @@ -0,0 +1,345 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Invoices. + */ +public class InvoicesInner { + /** The Retrofit service to perform REST calls. */ + private InvoicesService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of InvoicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public InvoicesInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(InvoicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Invoices to be + * used by Retrofit to perform actually REST calls. + */ + interface InvoicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Invoices listByBillingAccount" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices") + Observable> listByBillingAccount(@Path("billingAccountName") String billingAccountName, @Query("api-version") String apiVersion, @Query("periodStartDate") String periodStartDate, @Query("periodEndDate") String periodEndDate, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Invoices listByBillingProfile" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices") + Observable> listByBillingProfile(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Query("api-version") String apiVersion, @Query("periodStartDate") String periodStartDate, @Query("periodEndDate") String periodEndDate, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Invoices get" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}") + Observable> get(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceName") String invoiceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List of invoices for a billing account. + * + * @param billingAccountName billing Account Id. + * @param periodStartDate Invoice period start date. + * @param periodEndDate Invoice period end date. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InvoiceListResultInner object if successful. + */ + public InvoiceListResultInner listByBillingAccount(String billingAccountName, String periodStartDate, String periodEndDate) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName, periodStartDate, periodEndDate).toBlocking().single().body(); + } + + /** + * List of invoices for a billing account. + * + * @param billingAccountName billing Account Id. + * @param periodStartDate Invoice period start date. + * @param periodEndDate Invoice period end date. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByBillingAccountAsync(String billingAccountName, String periodStartDate, String periodEndDate, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingAccountWithServiceResponseAsync(billingAccountName, periodStartDate, periodEndDate), serviceCallback); + } + + /** + * List of invoices for a billing account. + * + * @param billingAccountName billing Account Id. + * @param periodStartDate Invoice period start date. + * @param periodEndDate Invoice period end date. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InvoiceListResultInner object + */ + public Observable listByBillingAccountAsync(String billingAccountName, String periodStartDate, String periodEndDate) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName, periodStartDate, periodEndDate).map(new Func1, InvoiceListResultInner>() { + @Override + public InvoiceListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List of invoices for a billing account. + * + * @param billingAccountName billing Account Id. + * @param periodStartDate Invoice period start date. + * @param periodEndDate Invoice period end date. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InvoiceListResultInner object + */ + public Observable> listByBillingAccountWithServiceResponseAsync(String billingAccountName, String periodStartDate, String periodEndDate) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (periodStartDate == null) { + throw new IllegalArgumentException("Parameter periodStartDate is required and cannot be null."); + } + if (periodEndDate == null) { + throw new IllegalArgumentException("Parameter periodEndDate is required and cannot be null."); + } + return service.listByBillingAccount(billingAccountName, this.client.apiVersion(), periodStartDate, periodEndDate, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByBillingAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByBillingAccountDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * List of invoices for a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param periodStartDate Invoice period start date. + * @param periodEndDate Invoice period end date. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InvoiceListResultInner object if successful. + */ + public InvoiceListResultInner listByBillingProfile(String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate) { + return listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, periodStartDate, periodEndDate).toBlocking().single().body(); + } + + /** + * List of invoices for a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param periodStartDate Invoice period start date. + * @param periodEndDate Invoice period end date. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByBillingProfileAsync(String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, periodStartDate, periodEndDate), serviceCallback); + } + + /** + * List of invoices for a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param periodStartDate Invoice period start date. + * @param periodEndDate Invoice period end date. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InvoiceListResultInner object + */ + public Observable listByBillingProfileAsync(String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate) { + return listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, periodStartDate, periodEndDate).map(new Func1, InvoiceListResultInner>() { + @Override + public InvoiceListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List of invoices for a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param periodStartDate Invoice period start date. + * @param periodEndDate Invoice period end date. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InvoiceListResultInner object + */ + public Observable> listByBillingProfileWithServiceResponseAsync(String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (periodStartDate == null) { + throw new IllegalArgumentException("Parameter periodStartDate is required and cannot be null."); + } + if (periodEndDate == null) { + throw new IllegalArgumentException("Parameter periodEndDate is required and cannot be null."); + } + return service.listByBillingProfile(billingAccountName, billingProfileName, this.client.apiVersion(), periodStartDate, periodEndDate, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByBillingProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByBillingProfileDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get the invoice by name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InvoiceInner object if successful. + */ + public InvoiceInner get(String billingAccountName, String billingProfileName, String invoiceName) { + return getWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceName).toBlocking().single().body(); + } + + /** + * Get the invoice by name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceName Invoice Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String billingAccountName, String billingProfileName, String invoiceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceName), serviceCallback); + } + + /** + * Get the invoice by name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InvoiceInner object + */ + public Observable getAsync(String billingAccountName, String billingProfileName, String invoiceName) { + return getWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceName).map(new Func1, InvoiceInner>() { + @Override + public InvoiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the invoice by name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InvoiceInner object + */ + public Observable> getWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceName == null) { + throw new IllegalArgumentException("Parameter invoiceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(billingAccountName, billingProfileName, invoiceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/LineOfCreditImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/LineOfCreditImpl.java new file mode 100644 index 000000000000..0c7db38e5d3c --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/LineOfCreditImpl.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.LineOfCredit; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Amount; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Status; + +class LineOfCreditImpl extends WrapperImpl implements LineOfCredit { + private final BillingManager manager; + LineOfCreditImpl(LineOfCreditInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public Amount creditLimit() { + return this.inner().creditLimit(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + + @Override + public Amount remainingBalance() { + return this.inner().remainingBalance(); + } + + @Override + public Status status() { + return this.inner().status(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/LineOfCreditInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/LineOfCreditInner.java new file mode 100644 index 000000000000..a2709e58af4c --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/LineOfCreditInner.java @@ -0,0 +1,105 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.Amount; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Status; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Line of credit resource. + */ +@JsonFlatten +public class LineOfCreditInner extends ProxyResource { + /** + * The current credit limit. + */ + @JsonProperty(value = "properties.creditLimit") + private Amount creditLimit; + + /** + * The reason for the line of credit status when not approved. + */ + @JsonProperty(value = "properties.reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /** + * Remaining balance. + */ + @JsonProperty(value = "properties.remainingBalance", access = JsonProperty.Access.WRITE_ONLY) + private Amount remainingBalance; + + /** + * The line of credit status. Possible values include: 'Approved', + * 'Rejected'. + */ + @JsonProperty(value = "properties.status") + private Status status; + + /** + * Get the current credit limit. + * + * @return the creditLimit value + */ + public Amount creditLimit() { + return this.creditLimit; + } + + /** + * Set the current credit limit. + * + * @param creditLimit the creditLimit value to set + * @return the LineOfCreditInner object itself. + */ + public LineOfCreditInner withCreditLimit(Amount creditLimit) { + this.creditLimit = creditLimit; + return this; + } + + /** + * Get the reason for the line of credit status when not approved. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Get remaining balance. + * + * @return the remainingBalance value + */ + public Amount remainingBalance() { + return this.remainingBalance; + } + + /** + * Get the line of credit status. Possible values include: 'Approved', 'Rejected'. + * + * @return the status value + */ + public Status status() { + return this.status; + } + + /** + * Set the line of credit status. Possible values include: 'Approved', 'Rejected'. + * + * @param status the status value to set + * @return the LineOfCreditInner object itself. + */ + public LineOfCreditInner withStatus(Status status) { + this.status = status; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/LineOfCreditsImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/LineOfCreditsImpl.java new file mode 100644 index 000000000000..497df72fdcef --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/LineOfCreditsImpl.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.LineOfCredits; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.LineOfCredit; + +class LineOfCreditsImpl extends WrapperImpl implements LineOfCredits { + private final BillingManager manager; + + LineOfCreditsImpl(BillingManager manager) { + super(manager.inner().lineOfCredits()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + @Override + public Observable getAsync() { + LineOfCreditsInner client = this.inner(); + return client.getAsync() + .map(new Func1() { + @Override + public LineOfCredit call(LineOfCreditInner inner) { + return new LineOfCreditImpl(inner, manager()); + } + }); + } + + @Override + public Observable updateAsync(LineOfCreditInner parameters) { + LineOfCreditsInner client = this.inner(); + return client.updateAsync(parameters) + .map(new Func1() { + @Override + public LineOfCredit call(LineOfCreditInner inner) { + return new LineOfCreditImpl(inner, manager()); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/LineOfCreditsInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/LineOfCreditsInner.java new file mode 100644 index 000000000000..38a1572ed502 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/LineOfCreditsInner.java @@ -0,0 +1,289 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.azure.management.billing.v2019_10_01_preview.LineOfCreditsUpdateHeaders; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LineOfCredits. + */ +public class LineOfCreditsInner { + /** The Retrofit service to perform REST calls. */ + private LineOfCreditsService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of LineOfCreditsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LineOfCreditsInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(LineOfCreditsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LineOfCredits to be + * used by Retrofit to perform actually REST calls. + */ + interface LineOfCreditsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.LineOfCredits get" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingAccounts/default/lineOfCredit/default") + Observable> get(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.LineOfCredits update" }) + @PUT("subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingAccounts/default/lineOfCredit/default") + Observable> update(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body LineOfCreditInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.LineOfCredits beginUpdate" }) + @PUT("subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingAccounts/default/lineOfCredit/default") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body LineOfCreditInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the current line of credit. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LineOfCreditInner object if successful. + */ + public LineOfCreditInner get() { + return getWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get the current line of credit. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get the current line of credit. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LineOfCreditInner object + */ + public Observable getAsync() { + return getWithServiceResponseAsync().map(new Func1, LineOfCreditInner>() { + @Override + public LineOfCreditInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the current line of credit. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LineOfCreditInner object + */ + public Observable> getWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Increase the current line of credit. + * + * @param parameters Parameters supplied to the increase line of credit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LineOfCreditInner object if successful. + */ + public LineOfCreditInner update(LineOfCreditInner parameters) { + return updateWithServiceResponseAsync(parameters).toBlocking().last().body(); + } + + /** + * Increase the current line of credit. + * + * @param parameters Parameters supplied to the increase line of credit operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(LineOfCreditInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(updateWithServiceResponseAsync(parameters), serviceCallback); + } + + /** + * Increase the current line of credit. + * + * @param parameters Parameters supplied to the increase line of credit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(LineOfCreditInner parameters) { + return updateWithServiceResponseAsync(parameters).map(new Func1, LineOfCreditInner>() { + @Override + public LineOfCreditInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Increase the current line of credit. + * + * @param parameters Parameters supplied to the increase line of credit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(LineOfCreditInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LineOfCreditsUpdateHeaders.class); + } + + /** + * Increase the current line of credit. + * + * @param parameters Parameters supplied to the increase line of credit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LineOfCreditInner object if successful. + */ + public LineOfCreditInner beginUpdate(LineOfCreditInner parameters) { + return beginUpdateWithServiceResponseAsync(parameters).toBlocking().single().body(); + } + + /** + * Increase the current line of credit. + * + * @param parameters Parameters supplied to the increase line of credit operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(LineOfCreditInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginUpdateWithServiceResponseAsync(parameters), serviceCallback); + } + + /** + * Increase the current line of credit. + * + * @param parameters Parameters supplied to the increase line of credit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LineOfCreditInner object + */ + public Observable beginUpdateAsync(LineOfCreditInner parameters) { + return beginUpdateWithServiceResponseAsync(parameters).map(new Func1, LineOfCreditInner>() { + @Override + public LineOfCreditInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Increase the current line of credit. + * + * @param parameters Parameters supplied to the increase line of credit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LineOfCreditInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(LineOfCreditInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .buildWithHeaders(response, LineOfCreditsUpdateHeaders.class); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/OperationImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/OperationImpl.java new file mode 100644 index 000000000000..e1e89c027550 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final BillingManager manager; + OperationImpl(OperationInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/OperationInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/OperationInner.java new file mode 100644 index 000000000000..5eaac2cc136b --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/OperationInner.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A Billing REST API operation. + */ +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the object that represents the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the object that represents the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/OperationsImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/OperationsImpl.java new file mode 100644 index 000000000000..0b08e05a4144 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final BillingManager manager; + + OperationsImpl(BillingManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/OperationsInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/OperationsInner.java new file mode 100644 index 000000000000..cb3d718c3767 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Operations list" }) + @GET("providers/Microsoft.Billing/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available billing REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available billing REST API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available billing REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available billing REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available billing REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all of the available billing REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available billing REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available billing REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available billing REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available billing REST API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PageImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PageImpl.java new file mode 100644 index 000000000000..ef89fd210e8c --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PartnerTransfersImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PartnerTransfersImpl.java new file mode 100644 index 000000000000..401a2dba3345 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PartnerTransfersImpl.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.PartnerTransfers; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.billing.v2019_10_01_preview.CustomerBillingProfileBillingAccountTransferDetails; +import com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceSectionBillingProfileBillingAccountTransferDetails; +import com.microsoft.azure.management.billing.v2019_10_01_preview.InitiateTransferRequest; + +class PartnerTransfersImpl extends WrapperImpl implements PartnerTransfers { + private final BillingManager manager; + + PartnerTransfersImpl(BillingManager manager) { + super(manager.inner().partnerTransfers()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + private CustomerBillingProfileBillingAccountTransferDetailsImpl wrapModel(TransferDetailsInner inner) { + return new CustomerBillingProfileBillingAccountTransferDetailsImpl(inner, manager()); + } + + @Override + public Observable getAsync(String billingAccountName, String billingProfileName, String customerName, String transferName) { + PartnerTransfersInner client = this.inner(); + return client.getAsync(billingAccountName, billingProfileName, customerName, transferName) + .map(new Func1() { + @Override + public CustomerBillingProfileBillingAccountTransferDetails call(TransferDetailsInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable cancelAsync(String billingAccountName, String billingProfileName, String customerName, String transferName) { + PartnerTransfersInner client = this.inner(); + return client.cancelAsync(billingAccountName, billingProfileName, customerName, transferName).toCompletable(); + } + + @Override + public Observable initiateAsync(String billingAccountName, String billingProfileName, String customerName, InitiateTransferRequest parameters) { + PartnerTransfersInner client = this.inner(); + return client.initiateAsync(billingAccountName, billingProfileName, customerName, parameters) + .map(new Func1() { + @Override + public InvoiceSectionBillingProfileBillingAccountTransferDetails call(TransferDetailsInner inner) { + return new InvoiceSectionBillingProfileBillingAccountTransferDetailsImpl(inner, manager()); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PartnerTransfersInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PartnerTransfersInner.java new file mode 100644 index 000000000000..247527f33201 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PartnerTransfersInner.java @@ -0,0 +1,355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.azure.management.billing.v2019_10_01_preview.InitiateTransferRequest; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PartnerTransfers. + */ +public class PartnerTransfersInner { + /** The Retrofit service to perform REST calls. */ + private PartnerTransfersService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of PartnerTransfersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PartnerTransfersInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(PartnerTransfersService.class); + this.client = client; + } + + /** + * The interface defining all the services for PartnerTransfers to be + * used by Retrofit to perform actually REST calls. + */ + interface PartnerTransfersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.PartnerTransfers initiate" }) + @POST("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/initiateTransfer") + Observable> initiate(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("customerName") String customerName, @Body InitiateTransferRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.PartnerTransfers get" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/transfers/{transferName}") + Observable> get(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("customerName") String customerName, @Path("transferName") String transferName, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.PartnerTransfers cancel" }) + @HTTP(path = "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/transfers/{transferName}", method = "DELETE", hasBody = true) + Observable> cancel(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("customerName") String customerName, @Path("transferName") String transferName, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Initiates the request to transfer the legacy subscriptions or RIs. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param customerName Customer name. + * @param parameters Parameters supplied to initiate the transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TransferDetailsInner object if successful. + */ + public TransferDetailsInner initiate(String billingAccountName, String billingProfileName, String customerName, InitiateTransferRequest parameters) { + return initiateWithServiceResponseAsync(billingAccountName, billingProfileName, customerName, parameters).toBlocking().single().body(); + } + + /** + * Initiates the request to transfer the legacy subscriptions or RIs. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param customerName Customer name. + * @param parameters Parameters supplied to initiate the transfer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture initiateAsync(String billingAccountName, String billingProfileName, String customerName, InitiateTransferRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(initiateWithServiceResponseAsync(billingAccountName, billingProfileName, customerName, parameters), serviceCallback); + } + + /** + * Initiates the request to transfer the legacy subscriptions or RIs. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param customerName Customer name. + * @param parameters Parameters supplied to initiate the transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransferDetailsInner object + */ + public Observable initiateAsync(String billingAccountName, String billingProfileName, String customerName, InitiateTransferRequest parameters) { + return initiateWithServiceResponseAsync(billingAccountName, billingProfileName, customerName, parameters).map(new Func1, TransferDetailsInner>() { + @Override + public TransferDetailsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Initiates the request to transfer the legacy subscriptions or RIs. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param customerName Customer name. + * @param parameters Parameters supplied to initiate the transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransferDetailsInner object + */ + public Observable> initiateWithServiceResponseAsync(String billingAccountName, String billingProfileName, String customerName, InitiateTransferRequest parameters) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (customerName == null) { + throw new IllegalArgumentException("Parameter customerName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.initiate(billingAccountName, billingProfileName, customerName, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = initiateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse initiateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the transfer details for given transfer Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param customerName Customer name. + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TransferDetailsInner object if successful. + */ + public TransferDetailsInner get(String billingAccountName, String billingProfileName, String customerName, String transferName) { + return getWithServiceResponseAsync(billingAccountName, billingProfileName, customerName, transferName).toBlocking().single().body(); + } + + /** + * Gets the transfer details for given transfer Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param customerName Customer name. + * @param transferName Transfer Name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String billingAccountName, String billingProfileName, String customerName, String transferName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(billingAccountName, billingProfileName, customerName, transferName), serviceCallback); + } + + /** + * Gets the transfer details for given transfer Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param customerName Customer name. + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransferDetailsInner object + */ + public Observable getAsync(String billingAccountName, String billingProfileName, String customerName, String transferName) { + return getWithServiceResponseAsync(billingAccountName, billingProfileName, customerName, transferName).map(new Func1, TransferDetailsInner>() { + @Override + public TransferDetailsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the transfer details for given transfer Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param customerName Customer name. + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransferDetailsInner object + */ + public Observable> getWithServiceResponseAsync(String billingAccountName, String billingProfileName, String customerName, String transferName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (customerName == null) { + throw new IllegalArgumentException("Parameter customerName is required and cannot be null."); + } + if (transferName == null) { + throw new IllegalArgumentException("Parameter transferName is required and cannot be null."); + } + return service.get(billingAccountName, billingProfileName, customerName, transferName, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Cancels the transfer for given transfer Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param customerName Customer name. + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TransferDetailsInner object if successful. + */ + public TransferDetailsInner cancel(String billingAccountName, String billingProfileName, String customerName, String transferName) { + return cancelWithServiceResponseAsync(billingAccountName, billingProfileName, customerName, transferName).toBlocking().single().body(); + } + + /** + * Cancels the transfer for given transfer Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param customerName Customer name. + * @param transferName Transfer Name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture cancelAsync(String billingAccountName, String billingProfileName, String customerName, String transferName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(cancelWithServiceResponseAsync(billingAccountName, billingProfileName, customerName, transferName), serviceCallback); + } + + /** + * Cancels the transfer for given transfer Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param customerName Customer name. + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransferDetailsInner object + */ + public Observable cancelAsync(String billingAccountName, String billingProfileName, String customerName, String transferName) { + return cancelWithServiceResponseAsync(billingAccountName, billingProfileName, customerName, transferName).map(new Func1, TransferDetailsInner>() { + @Override + public TransferDetailsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancels the transfer for given transfer Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param customerName Customer name. + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransferDetailsInner object + */ + public Observable> cancelWithServiceResponseAsync(String billingAccountName, String billingProfileName, String customerName, String transferName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (customerName == null) { + throw new IllegalArgumentException("Parameter customerName is required and cannot be null."); + } + if (transferName == null) { + throw new IllegalArgumentException("Parameter transferName is required and cannot be null."); + } + return service.cancel(billingAccountName, billingProfileName, customerName, transferName, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = cancelDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse cancelDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PartnerTransfersTransfersImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PartnerTransfersTransfersImpl.java new file mode 100644 index 000000000000..6830a874aec5 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PartnerTransfersTransfersImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.PartnerTransfersTransfers; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.billing.v2019_10_01_preview.CustomerBillingProfileBillingAccountTransferDetailsModel; + +class PartnerTransfersTransfersImpl extends WrapperImpl implements PartnerTransfersTransfers { + private final BillingManager manager; + + PartnerTransfersTransfersImpl(BillingManager manager) { + super(manager.inner().partnerTransfersTransfers()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + private CustomerBillingProfileBillingAccountTransferDetailsModelImpl wrapModel(TransferDetailsInner inner) { + return new CustomerBillingProfileBillingAccountTransferDetailsModelImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String billingAccountName, final String billingProfileName, final String customerName) { + PartnerTransfersTransfersInner client = this.inner(); + return client.listAsync(billingAccountName, billingProfileName, customerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public CustomerBillingProfileBillingAccountTransferDetailsModel call(TransferDetailsInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PartnerTransfersTransfersInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PartnerTransfersTransfersInner.java new file mode 100644 index 000000000000..26845086ac3b --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PartnerTransfersTransfersInner.java @@ -0,0 +1,304 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PartnerTransfersTransfers. + */ +public class PartnerTransfersTransfersInner { + /** The Retrofit service to perform REST calls. */ + private PartnerTransfersTransfersService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of PartnerTransfersTransfersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PartnerTransfersTransfersInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(PartnerTransfersTransfersService.class); + this.client = client; + } + + /** + * The interface defining all the services for PartnerTransfersTransfers to be + * used by Retrofit to perform actually REST calls. + */ + interface PartnerTransfersTransfersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.PartnerTransfersTransfers list" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/transfers") + Observable> list(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("customerName") String customerName, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.PartnerTransfersTransfers listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all transfer's details initiated from given invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param customerName Customer name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TransferDetailsInner> object if successful. + */ + public PagedList list(final String billingAccountName, final String billingProfileName, final String customerName) { + ServiceResponse> response = listSinglePageAsync(billingAccountName, billingProfileName, customerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all transfer's details initiated from given invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param customerName Customer name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String billingAccountName, final String billingProfileName, final String customerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(billingAccountName, billingProfileName, customerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all transfer's details initiated from given invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param customerName Customer name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransferDetailsInner> object + */ + public Observable> listAsync(final String billingAccountName, final String billingProfileName, final String customerName) { + return listWithServiceResponseAsync(billingAccountName, billingProfileName, customerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all transfer's details initiated from given invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param customerName Customer name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransferDetailsInner> object + */ + public Observable>> listWithServiceResponseAsync(final String billingAccountName, final String billingProfileName, final String customerName) { + return listSinglePageAsync(billingAccountName, billingProfileName, customerName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all transfer's details initiated from given invoice section. + * + ServiceResponse> * @param billingAccountName billing Account Id. + ServiceResponse> * @param billingProfileName Billing Profile Id. + ServiceResponse> * @param customerName Customer name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TransferDetailsInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String billingAccountName, final String billingProfileName, final String customerName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (customerName == null) { + throw new IllegalArgumentException("Parameter customerName is required and cannot be null."); + } + return service.list(billingAccountName, billingProfileName, customerName, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all transfer's details initiated from given invoice section. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TransferDetailsInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all transfer's details initiated from given invoice section. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all transfer's details initiated from given invoice section. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransferDetailsInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all transfer's details initiated from given invoice section. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransferDetailsInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all transfer's details initiated from given invoice section. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TransferDetailsInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PaymentMethodImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PaymentMethodImpl.java new file mode 100644 index 000000000000..d8190a88580b --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PaymentMethodImpl.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.PaymentMethod; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.PaymentMethodType; + +class PaymentMethodImpl extends WrapperImpl implements PaymentMethod { + private final BillingManager manager; + + PaymentMethodImpl(PaymentMethodInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + + + @Override + public String currency() { + return this.inner().currency(); + } + + @Override + public String details() { + return this.inner().details(); + } + + @Override + public String expiration() { + return this.inner().expiration(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PaymentMethodType paymentMethodType() { + return this.inner().paymentMethodType(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PaymentMethodInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PaymentMethodInner.java new file mode 100644 index 000000000000..95ec6abf6e0d --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PaymentMethodInner.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.PaymentMethodType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A payment method resource. + */ +@JsonFlatten +public class PaymentMethodInner extends ProxyResource { + /** + * Payment method type. Possible values include: 'Credits', 'ChequeWire'. + */ + @JsonProperty(value = "properties.paymentMethodType") + private PaymentMethodType paymentMethodType; + + /** + * Details about the payment method. + */ + @JsonProperty(value = "properties.details", access = JsonProperty.Access.WRITE_ONLY) + private String details; + + /** + * Expiration month and year. + */ + @JsonProperty(value = "properties.expiration", access = JsonProperty.Access.WRITE_ONLY) + private String expiration; + + /** + * The currency associated with the payment method. + */ + @JsonProperty(value = "properties.currency", access = JsonProperty.Access.WRITE_ONLY) + private String currency; + + /** + * Get payment method type. Possible values include: 'Credits', 'ChequeWire'. + * + * @return the paymentMethodType value + */ + public PaymentMethodType paymentMethodType() { + return this.paymentMethodType; + } + + /** + * Set payment method type. Possible values include: 'Credits', 'ChequeWire'. + * + * @param paymentMethodType the paymentMethodType value to set + * @return the PaymentMethodInner object itself. + */ + public PaymentMethodInner withPaymentMethodType(PaymentMethodType paymentMethodType) { + this.paymentMethodType = paymentMethodType; + return this; + } + + /** + * Get details about the payment method. + * + * @return the details value + */ + public String details() { + return this.details; + } + + /** + * Get expiration month and year. + * + * @return the expiration value + */ + public String expiration() { + return this.expiration; + } + + /** + * Get the currency associated with the payment method. + * + * @return the currency value + */ + public String currency() { + return this.currency; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PaymentMethodsImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PaymentMethodsImpl.java new file mode 100644 index 000000000000..e3b087eca905 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PaymentMethodsImpl.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.PaymentMethods; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.billing.v2019_10_01_preview.PaymentMethod; + +class PaymentMethodsImpl extends WrapperImpl implements PaymentMethods { + private final BillingManager manager; + + PaymentMethodsImpl(BillingManager manager) { + super(manager.inner().paymentMethods()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + private PaymentMethodImpl wrapModel(PaymentMethodInner inner) { + return new PaymentMethodImpl(inner, manager()); + } + + @Override + public Observable listByBillingProfileAsync(final String billingAccountName, final String billingProfileName) { + PaymentMethodsInner client = this.inner(); + return client.listByBillingProfileAsync(billingAccountName, billingProfileName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PaymentMethod call(PaymentMethodInner inner) { + return new PaymentMethodImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByBillingAccountAsync(final String billingAccountName) { + PaymentMethodsInner client = this.inner(); + return client.listByBillingAccountAsync(billingAccountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PaymentMethod call(PaymentMethodInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PaymentMethodsInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PaymentMethodsInner.java new file mode 100644 index 000000000000..f75366a5fc02 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PaymentMethodsInner.java @@ -0,0 +1,531 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PaymentMethods. + */ +public class PaymentMethodsInner { + /** The Retrofit service to perform REST calls. */ + private PaymentMethodsService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of PaymentMethodsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PaymentMethodsInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(PaymentMethodsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PaymentMethods to be + * used by Retrofit to perform actually REST calls. + */ + interface PaymentMethodsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.PaymentMethods listByBillingAccount" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/paymentMethods") + Observable> listByBillingAccount(@Path("billingAccountName") String billingAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.PaymentMethods listByBillingProfile" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/paymentMethods") + Observable> listByBillingProfile(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.PaymentMethods listByBillingAccountNext" }) + @GET + Observable> listByBillingAccountNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.PaymentMethods listByBillingProfileNext" }) + @GET + Observable> listByBillingProfileNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists the Payment Methods by billing account Id. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PaymentMethodInner> object if successful. + */ + public PagedList listByBillingAccount(final String billingAccountName) { + ServiceResponse> response = listByBillingAccountSinglePageAsync(billingAccountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Payment Methods by billing account Id. + * + * @param billingAccountName billing Account Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByBillingAccountAsync(final String billingAccountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBillingAccountSinglePageAsync(billingAccountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Payment Methods by billing account Id. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PaymentMethodInner> object + */ + public Observable> listByBillingAccountAsync(final String billingAccountName) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Payment Methods by billing account Id. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PaymentMethodInner> object + */ + public Observable>> listByBillingAccountWithServiceResponseAsync(final String billingAccountName) { + return listByBillingAccountSinglePageAsync(billingAccountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByBillingAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Payment Methods by billing account Id. + * + ServiceResponse> * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PaymentMethodInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBillingAccountSinglePageAsync(final String billingAccountName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByBillingAccount(billingAccountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBillingAccountDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByBillingAccountDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the Payment Methods by billing profile Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PaymentMethodInner> object if successful. + */ + public PagedList listByBillingProfile(final String billingAccountName, final String billingProfileName) { + ServiceResponse> response = listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBillingProfileNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Payment Methods by billing profile Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByBillingProfileAsync(final String billingAccountName, final String billingProfileName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBillingProfileNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Payment Methods by billing profile Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PaymentMethodInner> object + */ + public Observable> listByBillingProfileAsync(final String billingAccountName, final String billingProfileName) { + return listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Payment Methods by billing profile Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PaymentMethodInner> object + */ + public Observable>> listByBillingProfileWithServiceResponseAsync(final String billingAccountName, final String billingProfileName) { + return listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByBillingProfileNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Payment Methods by billing profile Id. + * + ServiceResponse> * @param billingAccountName billing Account Id. + ServiceResponse> * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PaymentMethodInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBillingProfileSinglePageAsync(final String billingAccountName, final String billingProfileName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByBillingProfile(billingAccountName, billingProfileName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBillingProfileDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByBillingProfileDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the Payment Methods by billing account Id. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PaymentMethodInner> object if successful. + */ + public PagedList listByBillingAccountNext(final String nextPageLink) { + ServiceResponse> response = listByBillingAccountNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Payment Methods by billing account Id. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByBillingAccountNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBillingAccountNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Payment Methods by billing account Id. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PaymentMethodInner> object + */ + public Observable> listByBillingAccountNextAsync(final String nextPageLink) { + return listByBillingAccountNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Payment Methods by billing account Id. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PaymentMethodInner> object + */ + public Observable>> listByBillingAccountNextWithServiceResponseAsync(final String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByBillingAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Payment Methods by billing account Id. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PaymentMethodInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBillingAccountNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByBillingAccountNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBillingAccountNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByBillingAccountNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the Payment Methods by billing profile Id. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PaymentMethodInner> object if successful. + */ + public PagedList listByBillingProfileNext(final String nextPageLink) { + ServiceResponse> response = listByBillingProfileNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBillingProfileNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Payment Methods by billing profile Id. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByBillingProfileNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBillingProfileNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBillingProfileNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Payment Methods by billing profile Id. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PaymentMethodInner> object + */ + public Observable> listByBillingProfileNextAsync(final String nextPageLink) { + return listByBillingProfileNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Payment Methods by billing profile Id. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PaymentMethodInner> object + */ + public Observable>> listByBillingProfileNextWithServiceResponseAsync(final String nextPageLink) { + return listByBillingProfileNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByBillingProfileNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Payment Methods by billing profile Id. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PaymentMethodInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBillingProfileNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByBillingProfileNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBillingProfileNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByBillingProfileNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PoliciesImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PoliciesImpl.java new file mode 100644 index 000000000000..914b035fdadc --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PoliciesImpl.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Policies; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Policy; + +class PoliciesImpl extends WrapperImpl implements Policies { + private final BillingManager manager; + + PoliciesImpl(BillingManager manager) { + super(manager.inner().policies()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + @Override + public Observable getByBillingProfileAsync(String billingAccountName, String billingProfileName) { + PoliciesInner client = this.inner(); + return client.getByBillingProfileAsync(billingAccountName, billingProfileName) + .map(new Func1() { + @Override + public Policy call(PolicyInner inner) { + return new PolicyImpl(inner, manager()); + } + }); + } + + @Override + public Observable updateAsync(String billingAccountName, String billingProfileName, PolicyInner parameters) { + PoliciesInner client = this.inner(); + return client.updateAsync(billingAccountName, billingProfileName, parameters) + .map(new Func1() { + @Override + public Policy call(PolicyInner inner) { + return new PolicyImpl(inner, manager()); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PoliciesInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PoliciesInner.java new file mode 100644 index 000000000000..4eddfbce1611 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PoliciesInner.java @@ -0,0 +1,241 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Policies. + */ +public class PoliciesInner { + /** The Retrofit service to perform REST calls. */ + private PoliciesService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of PoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PoliciesInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(PoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Policies to be + * used by Retrofit to perform actually REST calls. + */ + interface PoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Policies getByBillingProfile" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default") + Observable> getByBillingProfile(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Policies update" }) + @PUT("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default") + Observable> update(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Query("api-version") String apiVersion, @Body PolicyInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * The policy for a given billing account name and billing profile name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PolicyInner object if successful. + */ + public PolicyInner getByBillingProfile(String billingAccountName, String billingProfileName) { + return getByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName).toBlocking().single().body(); + } + + /** + * The policy for a given billing account name and billing profile name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByBillingProfileAsync(String billingAccountName, String billingProfileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName), serviceCallback); + } + + /** + * The policy for a given billing account name and billing profile name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PolicyInner object + */ + public Observable getByBillingProfileAsync(String billingAccountName, String billingProfileName) { + return getByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName).map(new Func1, PolicyInner>() { + @Override + public PolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The policy for a given billing account name and billing profile name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PolicyInner object + */ + public Observable> getByBillingProfileWithServiceResponseAsync(String billingAccountName, String billingProfileName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByBillingProfile(billingAccountName, billingProfileName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByBillingProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByBillingProfileDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * The operation to update a policy. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Parameters supplied to the update policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PolicyInner object if successful. + */ + public PolicyInner update(String billingAccountName, String billingProfileName, PolicyInner parameters) { + return updateWithServiceResponseAsync(billingAccountName, billingProfileName, parameters).toBlocking().single().body(); + } + + /** + * The operation to update a policy. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Parameters supplied to the update policy operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String billingAccountName, String billingProfileName, PolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(billingAccountName, billingProfileName, parameters), serviceCallback); + } + + /** + * The operation to update a policy. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Parameters supplied to the update policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PolicyInner object + */ + public Observable updateAsync(String billingAccountName, String billingProfileName, PolicyInner parameters) { + return updateWithServiceResponseAsync(billingAccountName, billingProfileName, parameters).map(new Func1, PolicyInner>() { + @Override + public PolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to update a policy. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param parameters Parameters supplied to the update policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PolicyInner object + */ + public Observable> updateWithServiceResponseAsync(String billingAccountName, String billingProfileName, PolicyInner parameters) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(billingAccountName, billingProfileName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PolicyImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PolicyImpl.java new file mode 100644 index 000000000000..d911c56c5e0c --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PolicyImpl.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.Policy; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.MarketplacePurchasesPolicy; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ReservationPurchasesPolicy; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ViewChargesPolicy; + +class PolicyImpl extends WrapperImpl implements Policy { + private final BillingManager manager; + PolicyImpl(PolicyInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public MarketplacePurchasesPolicy marketplacePurchases() { + return this.inner().marketplacePurchases(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ReservationPurchasesPolicy reservationPurchases() { + return this.inner().reservationPurchases(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ViewChargesPolicy viewCharges() { + return this.inner().viewCharges(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PolicyInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PolicyInner.java new file mode 100644 index 000000000000..e980e87922ca --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PolicyInner.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.MarketplacePurchasesPolicy; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ReservationPurchasesPolicy; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ViewChargesPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The Policy. + */ +@JsonFlatten +public class PolicyInner extends ProxyResource { + /** + * The marketplace purchases are free, allowed or not allowed. Possible + * values include: 'AllAllowed', 'FreeAllowed', 'NotAllowed'. + */ + @JsonProperty(value = "properties.marketplacePurchases") + private MarketplacePurchasesPolicy marketplacePurchases; + + /** + * The reservation purchases allowed or not. Possible values include: + * 'Allowed', 'NotAllowed'. + */ + @JsonProperty(value = "properties.reservationPurchases") + private ReservationPurchasesPolicy reservationPurchases; + + /** + * Who can view charges. Possible values include: 'None', + * 'SubscriptionOwner'. + */ + @JsonProperty(value = "properties.viewCharges") + private ViewChargesPolicy viewCharges; + + /** + * Get the marketplace purchases are free, allowed or not allowed. Possible values include: 'AllAllowed', 'FreeAllowed', 'NotAllowed'. + * + * @return the marketplacePurchases value + */ + public MarketplacePurchasesPolicy marketplacePurchases() { + return this.marketplacePurchases; + } + + /** + * Set the marketplace purchases are free, allowed or not allowed. Possible values include: 'AllAllowed', 'FreeAllowed', 'NotAllowed'. + * + * @param marketplacePurchases the marketplacePurchases value to set + * @return the PolicyInner object itself. + */ + public PolicyInner withMarketplacePurchases(MarketplacePurchasesPolicy marketplacePurchases) { + this.marketplacePurchases = marketplacePurchases; + return this; + } + + /** + * Get the reservation purchases allowed or not. Possible values include: 'Allowed', 'NotAllowed'. + * + * @return the reservationPurchases value + */ + public ReservationPurchasesPolicy reservationPurchases() { + return this.reservationPurchases; + } + + /** + * Set the reservation purchases allowed or not. Possible values include: 'Allowed', 'NotAllowed'. + * + * @param reservationPurchases the reservationPurchases value to set + * @return the PolicyInner object itself. + */ + public PolicyInner withReservationPurchases(ReservationPurchasesPolicy reservationPurchases) { + this.reservationPurchases = reservationPurchases; + return this; + } + + /** + * Get who can view charges. Possible values include: 'None', 'SubscriptionOwner'. + * + * @return the viewCharges value + */ + public ViewChargesPolicy viewCharges() { + return this.viewCharges; + } + + /** + * Set who can view charges. Possible values include: 'None', 'SubscriptionOwner'. + * + * @param viewCharges the viewCharges value to set + * @return the PolicyInner object itself. + */ + public PolicyInner withViewCharges(ViewChargesPolicy viewCharges) { + this.viewCharges = viewCharges; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PriceSheetsImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PriceSheetsImpl.java new file mode 100644 index 000000000000..82ef1000fd76 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PriceSheetsImpl.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.PriceSheets; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.DownloadUrl; + +class PriceSheetsImpl extends WrapperImpl implements PriceSheets { + private final BillingManager manager; + + PriceSheetsImpl(BillingManager manager) { + super(manager.inner().priceSheets()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + @Override + public Observable downloadAsync(String billingAccountName, String billingProfileName, String invoiceName) { + PriceSheetsInner client = this.inner(); + return client.downloadAsync(billingAccountName, billingProfileName, invoiceName) + .map(new Func1() { + @Override + public DownloadUrl call(DownloadUrlInner inner) { + return new DownloadUrlImpl(inner, manager()); + } + }); + } + + @Override + public Observable downloadByBillingProfileAsync(String billingAccountName, String billingProfileName) { + PriceSheetsInner client = this.inner(); + return client.downloadByBillingProfileAsync(billingAccountName, billingProfileName) + .map(new Func1() { + @Override + public DownloadUrl call(DownloadUrlInner inner) { + return new DownloadUrlImpl(inner, manager()); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PriceSheetsInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PriceSheetsInner.java new file mode 100644 index 000000000000..420139d9acfd --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/PriceSheetsInner.java @@ -0,0 +1,392 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.azure.management.billing.v2019_10_01_preview.PriceSheetDownloadByBillingProfileHeaders; +import com.microsoft.azure.management.billing.v2019_10_01_preview.PriceSheetDownloadHeaders; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in PriceSheets. + */ +public class PriceSheetsInner { + /** The Retrofit service to perform REST calls. */ + private PriceSheetsService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of PriceSheetsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PriceSheetsInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(PriceSheetsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PriceSheets to be + * used by Retrofit to perform actually REST calls. + */ + interface PriceSheetsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.PriceSheets download" }) + @POST("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}/pricesheet/default/download") + Observable> download(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceName") String invoiceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.PriceSheets beginDownload" }) + @POST("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}/pricesheet/default/download") + Observable> beginDownload(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceName") String invoiceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.PriceSheets downloadByBillingProfile" }) + @POST("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/pricesheet/default/download") + Observable> downloadByBillingProfile(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.PriceSheets beginDownloadByBillingProfile" }) + @POST("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/pricesheet/default/download") + Observable> beginDownloadByBillingProfile(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Download price sheet for an invoice. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DownloadUrlInner object if successful. + */ + public DownloadUrlInner download(String billingAccountName, String billingProfileName, String invoiceName) { + return downloadWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceName).toBlocking().last().body(); + } + + /** + * Download price sheet for an invoice. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceName Invoice Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture downloadAsync(String billingAccountName, String billingProfileName, String invoiceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(downloadWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceName), serviceCallback); + } + + /** + * Download price sheet for an invoice. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable downloadAsync(String billingAccountName, String billingProfileName, String invoiceName) { + return downloadWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceName).map(new Func1, DownloadUrlInner>() { + @Override + public DownloadUrlInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Download price sheet for an invoice. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> downloadWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceName == null) { + throw new IllegalArgumentException("Parameter invoiceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.download(billingAccountName, billingProfileName, invoiceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType(), PriceSheetDownloadHeaders.class); + } + + /** + * Download price sheet for an invoice. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DownloadUrlInner object if successful. + */ + public DownloadUrlInner beginDownload(String billingAccountName, String billingProfileName, String invoiceName) { + return beginDownloadWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceName).toBlocking().single().body(); + } + + /** + * Download price sheet for an invoice. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceName Invoice Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDownloadAsync(String billingAccountName, String billingProfileName, String invoiceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDownloadWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceName), serviceCallback); + } + + /** + * Download price sheet for an invoice. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DownloadUrlInner object + */ + public Observable beginDownloadAsync(String billingAccountName, String billingProfileName, String invoiceName) { + return beginDownloadWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceName).map(new Func1, DownloadUrlInner>() { + @Override + public DownloadUrlInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Download price sheet for an invoice. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DownloadUrlInner object + */ + public Observable> beginDownloadWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceName == null) { + throw new IllegalArgumentException("Parameter invoiceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDownload(billingAccountName, billingProfileName, invoiceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDownloadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDownloadDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .buildWithHeaders(response, PriceSheetDownloadHeaders.class); + } + + /** + * Download price sheet for a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DownloadUrlInner object if successful. + */ + public DownloadUrlInner downloadByBillingProfile(String billingAccountName, String billingProfileName) { + return downloadByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName).toBlocking().last().body(); + } + + /** + * Download price sheet for a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture downloadByBillingProfileAsync(String billingAccountName, String billingProfileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(downloadByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName), serviceCallback); + } + + /** + * Download price sheet for a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable downloadByBillingProfileAsync(String billingAccountName, String billingProfileName) { + return downloadByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName).map(new Func1, DownloadUrlInner>() { + @Override + public DownloadUrlInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Download price sheet for a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> downloadByBillingProfileWithServiceResponseAsync(String billingAccountName, String billingProfileName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.downloadByBillingProfile(billingAccountName, billingProfileName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType(), PriceSheetDownloadByBillingProfileHeaders.class); + } + + /** + * Download price sheet for a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DownloadUrlInner object if successful. + */ + public DownloadUrlInner beginDownloadByBillingProfile(String billingAccountName, String billingProfileName) { + return beginDownloadByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName).toBlocking().single().body(); + } + + /** + * Download price sheet for a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDownloadByBillingProfileAsync(String billingAccountName, String billingProfileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDownloadByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName), serviceCallback); + } + + /** + * Download price sheet for a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DownloadUrlInner object + */ + public Observable beginDownloadByBillingProfileAsync(String billingAccountName, String billingProfileName) { + return beginDownloadByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName).map(new Func1, DownloadUrlInner>() { + @Override + public DownloadUrlInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Download price sheet for a billing profile. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DownloadUrlInner object + */ + public Observable> beginDownloadByBillingProfileWithServiceResponseAsync(String billingAccountName, String billingProfileName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDownloadByBillingProfile(billingAccountName, billingProfileName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDownloadByBillingProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDownloadByBillingProfileDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .buildWithHeaders(response, PriceSheetDownloadByBillingProfileHeaders.class); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ProductImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ProductImpl.java new file mode 100644 index 000000000000..48a053f4b762 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ProductImpl.java @@ -0,0 +1,168 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.Product; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingFrequency; +import org.joda.time.DateTime; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Amount; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Reseller; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ProductStatusType; + +class ProductImpl extends IndexableRefreshableWrapperImpl implements Product { + private final BillingManager manager; + private String billingAccountName; + private String customerName; + private String productName; + + ProductImpl(ProductInner inner, BillingManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.billingAccountName = IdParsingUtils.getValueFromIdByName(inner.id(), "billingAccounts"); + this.customerName = IdParsingUtils.getValueFromIdByName(inner.id(), "customers"); + this.productName = IdParsingUtils.getValueFromIdByName(inner.id(), "products"); + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + ProductsInner client = this.manager().inner().products(); + return client.getByCustomerAsync(this.billingAccountName, this.customerName, this.productName); + } + + + + @Override + public String availabilityId() { + return this.inner().availabilityId(); + } + + @Override + public BillingFrequency billingFrequency() { + return this.inner().billingFrequency(); + } + + @Override + public String billingProfileDisplayName() { + return this.inner().billingProfileDisplayName(); + } + + @Override + public String billingProfileId() { + return this.inner().billingProfileId(); + } + + @Override + public String customerDisplayName() { + return this.inner().customerDisplayName(); + } + + @Override + public String customerId() { + return this.inner().customerId(); + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public DateTime endDate() { + return this.inner().endDate(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String invoiceSectionDisplayName() { + return this.inner().invoiceSectionDisplayName(); + } + + @Override + public String invoiceSectionId() { + return this.inner().invoiceSectionId(); + } + + @Override + public Amount lastCharge() { + return this.inner().lastCharge(); + } + + @Override + public DateTime lastChargeDate() { + return this.inner().lastChargeDate(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String parentProductId() { + return this.inner().parentProductId(); + } + + @Override + public String productType() { + return this.inner().productType(); + } + + @Override + public String productTypeId() { + return this.inner().productTypeId(); + } + + @Override + public DateTime purchaseDate() { + return this.inner().purchaseDate(); + } + + @Override + public Double quantity() { + return this.inner().quantity(); + } + + @Override + public Reseller reseller() { + return this.inner().reseller(); + } + + @Override + public String skuDescription() { + return this.inner().skuDescription(); + } + + @Override + public String skuId() { + return this.inner().skuId(); + } + + @Override + public ProductStatusType status() { + return this.inner().status(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ProductInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ProductInner.java new file mode 100644 index 000000000000..0bc95e9df134 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ProductInner.java @@ -0,0 +1,364 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ProductStatusType; +import com.microsoft.azure.management.billing.v2019_10_01_preview.BillingFrequency; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Amount; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Reseller; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A product resource. + */ +@JsonFlatten +public class ProductInner extends ProxyResource { + /** + * The display name of the product. + */ + @JsonProperty(value = "properties.displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /** + * The date of purchase. + */ + @JsonProperty(value = "properties.purchaseDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime purchaseDate; + + /** + * The product type id. + */ + @JsonProperty(value = "properties.productTypeId", access = JsonProperty.Access.WRITE_ONLY) + private String productTypeId; + + /** + * The type of product. + */ + @JsonProperty(value = "properties.productType", access = JsonProperty.Access.WRITE_ONLY) + private String productType; + + /** + * Product status. Possible values include: 'Active', 'Inactive', + * 'PastDue', 'Expiring', 'Expired', 'Disabled', 'Cancelled', 'AutoRenew'. + */ + @JsonProperty(value = "properties.status") + private ProductStatusType status; + + /** + * end date. + */ + @JsonProperty(value = "properties.endDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endDate; + + /** + * Billing frequency. Possible values include: 'OneTime', 'Monthly', + * 'UsageBased'. + */ + @JsonProperty(value = "properties.billingFrequency") + private BillingFrequency billingFrequency; + + /** + * Last month charges. + */ + @JsonProperty(value = "properties.lastCharge", access = JsonProperty.Access.WRITE_ONLY) + private Amount lastCharge; + + /** + * The date of the last charge. + */ + @JsonProperty(value = "properties.lastChargeDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastChargeDate; + + /** + * The purchased product quantity. + */ + @JsonProperty(value = "properties.quantity", access = JsonProperty.Access.WRITE_ONLY) + private Double quantity; + + /** + * Sku Id. + */ + @JsonProperty(value = "properties.skuId", access = JsonProperty.Access.WRITE_ONLY) + private String skuId; + + /** + * Sku description. + */ + @JsonProperty(value = "properties.skuDescription", access = JsonProperty.Access.WRITE_ONLY) + private String skuDescription; + + /** + * Availability Id. + */ + @JsonProperty(value = "properties.availabilityId", access = JsonProperty.Access.WRITE_ONLY) + private String availabilityId; + + /** + * Parent Product Id. + */ + @JsonProperty(value = "properties.parentProductId", access = JsonProperty.Access.WRITE_ONLY) + private String parentProductId; + + /** + * Invoice section id to which this product belongs. + */ + @JsonProperty(value = "properties.invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionId; + + /** + * Invoice section display name to which this product belongs. + */ + @JsonProperty(value = "properties.invoiceSectionDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionDisplayName; + + /** + * Billing Profile id to which this product belongs. + */ + @JsonProperty(value = "properties.billingProfileId", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileId; + + /** + * Billing Profile display name to which this product belongs. + */ + @JsonProperty(value = "properties.billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileDisplayName; + + /** + * Customer id to which this product belongs. + */ + @JsonProperty(value = "properties.customerId", access = JsonProperty.Access.WRITE_ONLY) + private String customerId; + + /** + * Display name of customer to which this product belongs. + */ + @JsonProperty(value = "properties.customerDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String customerDisplayName; + + /** + * Reseller for this product. + */ + @JsonProperty(value = "properties.reseller", access = JsonProperty.Access.WRITE_ONLY) + private Reseller reseller; + + /** + * Get the display name of the product. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the date of purchase. + * + * @return the purchaseDate value + */ + public DateTime purchaseDate() { + return this.purchaseDate; + } + + /** + * Get the product type id. + * + * @return the productTypeId value + */ + public String productTypeId() { + return this.productTypeId; + } + + /** + * Get the type of product. + * + * @return the productType value + */ + public String productType() { + return this.productType; + } + + /** + * Get product status. Possible values include: 'Active', 'Inactive', 'PastDue', 'Expiring', 'Expired', 'Disabled', 'Cancelled', 'AutoRenew'. + * + * @return the status value + */ + public ProductStatusType status() { + return this.status; + } + + /** + * Set product status. Possible values include: 'Active', 'Inactive', 'PastDue', 'Expiring', 'Expired', 'Disabled', 'Cancelled', 'AutoRenew'. + * + * @param status the status value to set + * @return the ProductInner object itself. + */ + public ProductInner withStatus(ProductStatusType status) { + this.status = status; + return this; + } + + /** + * Get end date. + * + * @return the endDate value + */ + public DateTime endDate() { + return this.endDate; + } + + /** + * Get billing frequency. Possible values include: 'OneTime', 'Monthly', 'UsageBased'. + * + * @return the billingFrequency value + */ + public BillingFrequency billingFrequency() { + return this.billingFrequency; + } + + /** + * Set billing frequency. Possible values include: 'OneTime', 'Monthly', 'UsageBased'. + * + * @param billingFrequency the billingFrequency value to set + * @return the ProductInner object itself. + */ + public ProductInner withBillingFrequency(BillingFrequency billingFrequency) { + this.billingFrequency = billingFrequency; + return this; + } + + /** + * Get last month charges. + * + * @return the lastCharge value + */ + public Amount lastCharge() { + return this.lastCharge; + } + + /** + * Get the date of the last charge. + * + * @return the lastChargeDate value + */ + public DateTime lastChargeDate() { + return this.lastChargeDate; + } + + /** + * Get the purchased product quantity. + * + * @return the quantity value + */ + public Double quantity() { + return this.quantity; + } + + /** + * Get sku Id. + * + * @return the skuId value + */ + public String skuId() { + return this.skuId; + } + + /** + * Get sku description. + * + * @return the skuDescription value + */ + public String skuDescription() { + return this.skuDescription; + } + + /** + * Get availability Id. + * + * @return the availabilityId value + */ + public String availabilityId() { + return this.availabilityId; + } + + /** + * Get parent Product Id. + * + * @return the parentProductId value + */ + public String parentProductId() { + return this.parentProductId; + } + + /** + * Get invoice section id to which this product belongs. + * + * @return the invoiceSectionId value + */ + public String invoiceSectionId() { + return this.invoiceSectionId; + } + + /** + * Get invoice section display name to which this product belongs. + * + * @return the invoiceSectionDisplayName value + */ + public String invoiceSectionDisplayName() { + return this.invoiceSectionDisplayName; + } + + /** + * Get billing Profile id to which this product belongs. + * + * @return the billingProfileId value + */ + public String billingProfileId() { + return this.billingProfileId; + } + + /** + * Get billing Profile display name to which this product belongs. + * + * @return the billingProfileDisplayName value + */ + public String billingProfileDisplayName() { + return this.billingProfileDisplayName; + } + + /** + * Get customer id to which this product belongs. + * + * @return the customerId value + */ + public String customerId() { + return this.customerId; + } + + /** + * Get display name of customer to which this product belongs. + * + * @return the customerDisplayName value + */ + public String customerDisplayName() { + return this.customerDisplayName; + } + + /** + * Get reseller for this product. + * + * @return the reseller value + */ + public Reseller reseller() { + return this.reseller; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ProductsImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ProductsImpl.java new file mode 100644 index 000000000000..0875fcb08dc5 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ProductsImpl.java @@ -0,0 +1,141 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Products; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ProductsListResult; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Product; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ValidateProductTransferEligibilityResult; +import com.microsoft.azure.management.billing.v2019_10_01_preview.UpdateAutoRenewOperation; +import com.microsoft.azure.management.billing.v2019_10_01_preview.TransferProductRequestProperties; + +class ProductsImpl extends WrapperImpl implements Products { + private final BillingManager manager; + + ProductsImpl(BillingManager manager) { + super(manager.inner().products()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + private ProductImpl wrapModel(ProductInner inner) { + return new ProductImpl(inner, manager()); + } + + @Override + public Observable listByCustomerAsync(String billingAccountName, String customerName) { + ProductsInner client = this.inner(); + return client.listByCustomerAsync(billingAccountName, customerName) + .map(new Func1() { + @Override + public ProductsListResult call(ProductsListResultInner inner) { + return new ProductsListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByBillingAccountAsync(final String billingAccountName) { + ProductsInner client = this.inner(); + return client.listByBillingAccountAsync(billingAccountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Product call(ProductInner inner) { + return new ProductImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + ProductsInner client = this.inner(); + return client.listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName) + .map(new Func1() { + @Override + public ProductsListResult call(ProductsListResultInner inner) { + return new ProductsListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName) { + ProductsInner client = this.inner(); + return client.getAsync(billingAccountName, billingProfileName, invoiceSectionName, productName) + .map(new Func1() { + @Override + public Product call(ProductInner inner) { + return new ProductImpl(inner, manager()); + } + }); + } + + @Override + public Observable transferAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName, TransferProductRequestProperties parameters) { + ProductsInner client = this.inner(); + return client.transferAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, parameters) + .map(new Func1() { + @Override + public Product call(ProductInner inner) { + return new ProductImpl(inner, manager()); + } + }); + } + + @Override + public Observable validateTransferAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName, TransferProductRequestProperties parameters) { + ProductsInner client = this.inner(); + return client.validateTransferAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, parameters) + .map(new Func1() { + @Override + public ValidateProductTransferEligibilityResult call(ValidateProductTransferEligibilityResultInner inner) { + return new ValidateProductTransferEligibilityResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable updateAutoRenewByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName) { + ProductsInner client = this.inner(); + return client.updateAutoRenewByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, productName) + .map(new Func1() { + @Override + public UpdateAutoRenewOperation call(UpdateAutoRenewOperationInner inner) { + return new UpdateAutoRenewOperationImpl(inner, manager()); + } + }); + } + + @Override + public Observable getByCustomerAsync(String billingAccountName, String customerName, String productName) { + ProductsInner client = this.inner(); + return client.getByCustomerAsync(billingAccountName, customerName, productName) + .map(new Func1() { + @Override + public Product call(ProductInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ProductsInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ProductsInner.java new file mode 100644 index 000000000000..7042a367be0e --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ProductsInner.java @@ -0,0 +1,1373 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ProductsTransferHeaders; +import com.microsoft.azure.management.billing.v2019_10_01_preview.TransferProductRequestProperties; +import com.microsoft.azure.management.billing.v2019_10_01_preview.UpdateAutoRenew; +import com.microsoft.azure.management.billing.v2019_10_01_preview.UpdateAutoRenewRequest; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Products. + */ +public class ProductsInner { + /** The Retrofit service to perform REST calls. */ + private ProductsService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of ProductsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProductsInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(ProductsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Products to be + * used by Retrofit to perform actually REST calls. + */ + interface ProductsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Products listByCustomer" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/products") + Observable> listByCustomer(@Path("billingAccountName") String billingAccountName, @Path("customerName") String customerName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Products getByCustomer" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/products/{productName}") + Observable> getByCustomer(@Path("billingAccountName") String billingAccountName, @Path("customerName") String customerName, @Path("productName") String productName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Products listByBillingAccount" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products") + Observable> listByBillingAccount(@Path("billingAccountName") String billingAccountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Products listByInvoiceSection" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products") + Observable> listByInvoiceSection(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Products get" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products/{productName}") + Observable> get(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Path("productName") String productName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Products transfer" }) + @POST("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products/{productName}/transfer") + Observable> transfer(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Path("productName") String productName, @Query("api-version") String apiVersion, @Body TransferProductRequestProperties parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Products validateTransfer" }) + @POST("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products/{productName}/validateTransferEligibility") + Observable> validateTransfer(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Path("productName") String productName, @Body TransferProductRequestProperties parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Products updateAutoRenewByInvoiceSection" }) + @POST("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products/{productName}/updateAutoRenew") + Observable> updateAutoRenewByInvoiceSection(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Path("productName") String productName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body UpdateAutoRenewRequest body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Products listByBillingAccountNext" }) + @GET + Observable> listByBillingAccountNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists products by customer id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductsListResultInner object if successful. + */ + public ProductsListResultInner listByCustomer(String billingAccountName, String customerName) { + return listByCustomerWithServiceResponseAsync(billingAccountName, customerName).toBlocking().single().body(); + } + + /** + * Lists products by customer id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByCustomerAsync(String billingAccountName, String customerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByCustomerWithServiceResponseAsync(billingAccountName, customerName), serviceCallback); + } + + /** + * Lists products by customer id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductsListResultInner object + */ + public Observable listByCustomerAsync(String billingAccountName, String customerName) { + return listByCustomerWithServiceResponseAsync(billingAccountName, customerName).map(new Func1, ProductsListResultInner>() { + @Override + public ProductsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists products by customer id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductsListResultInner object + */ + public Observable> listByCustomerWithServiceResponseAsync(String billingAccountName, String customerName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (customerName == null) { + throw new IllegalArgumentException("Parameter customerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + return service.listByCustomer(billingAccountName, customerName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByCustomerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists products by customer id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductsListResultInner object if successful. + */ + public ProductsListResultInner listByCustomer(String billingAccountName, String customerName, String filter) { + return listByCustomerWithServiceResponseAsync(billingAccountName, customerName, filter).toBlocking().single().body(); + } + + /** + * Lists products by customer id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByCustomerAsync(String billingAccountName, String customerName, String filter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByCustomerWithServiceResponseAsync(billingAccountName, customerName, filter), serviceCallback); + } + + /** + * Lists products by customer id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductsListResultInner object + */ + public Observable listByCustomerAsync(String billingAccountName, String customerName, String filter) { + return listByCustomerWithServiceResponseAsync(billingAccountName, customerName, filter).map(new Func1, ProductsListResultInner>() { + @Override + public ProductsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists products by customer id. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductsListResultInner object + */ + public Observable> listByCustomerWithServiceResponseAsync(String billingAccountName, String customerName, String filter) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (customerName == null) { + throw new IllegalArgumentException("Parameter customerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByCustomer(billingAccountName, customerName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByCustomerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByCustomerDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get a customer's product by name. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param productName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner getByCustomer(String billingAccountName, String customerName, String productName) { + return getByCustomerWithServiceResponseAsync(billingAccountName, customerName, productName).toBlocking().single().body(); + } + + /** + * Get a customer's product by name. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param productName Invoice Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByCustomerAsync(String billingAccountName, String customerName, String productName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByCustomerWithServiceResponseAsync(billingAccountName, customerName, productName), serviceCallback); + } + + /** + * Get a customer's product by name. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param productName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable getByCustomerAsync(String billingAccountName, String customerName, String productName) { + return getByCustomerWithServiceResponseAsync(billingAccountName, customerName, productName).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a customer's product by name. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param productName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> getByCustomerWithServiceResponseAsync(String billingAccountName, String customerName, String productName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (customerName == null) { + throw new IllegalArgumentException("Parameter customerName is required and cannot be null."); + } + if (productName == null) { + throw new IllegalArgumentException("Parameter productName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByCustomer(billingAccountName, customerName, productName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByCustomerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByCustomerDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists products by billing account name. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList listByBillingAccount(final String billingAccountName) { + ServiceResponse> response = listByBillingAccountSinglePageAsync(billingAccountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists products by billing account name. + * + * @param billingAccountName billing Account Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByBillingAccountAsync(final String billingAccountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBillingAccountSinglePageAsync(billingAccountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists products by billing account name. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> listByBillingAccountAsync(final String billingAccountName) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists products by billing account name. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> listByBillingAccountWithServiceResponseAsync(final String billingAccountName) { + return listByBillingAccountSinglePageAsync(billingAccountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByBillingAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists products by billing account name. + * + * @param billingAccountName billing Account Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBillingAccountSinglePageAsync(final String billingAccountName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + return service.listByBillingAccount(billingAccountName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBillingAccountDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists products by billing account name. + * + * @param billingAccountName billing Account Id. + * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList listByBillingAccount(final String billingAccountName, final String filter) { + ServiceResponse> response = listByBillingAccountSinglePageAsync(billingAccountName, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists products by billing account name. + * + * @param billingAccountName billing Account Id. + * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByBillingAccountAsync(final String billingAccountName, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBillingAccountSinglePageAsync(billingAccountName, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists products by billing account name. + * + * @param billingAccountName billing Account Id. + * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> listByBillingAccountAsync(final String billingAccountName, final String filter) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists products by billing account name. + * + * @param billingAccountName billing Account Id. + * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> listByBillingAccountWithServiceResponseAsync(final String billingAccountName, final String filter) { + return listByBillingAccountSinglePageAsync(billingAccountName, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByBillingAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists products by billing account name. + * + ServiceResponse> * @param billingAccountName billing Account Id. + ServiceResponse> * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBillingAccountSinglePageAsync(final String billingAccountName, final String filter) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByBillingAccount(billingAccountName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBillingAccountDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByBillingAccountDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists products by invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductsListResultInner object if successful. + */ + public ProductsListResultInner listByInvoiceSection(String billingAccountName, String billingProfileName, String invoiceSectionName) { + return listByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName).toBlocking().single().body(); + } + + /** + * Lists products by invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName), serviceCallback); + } + + /** + * Lists products by invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductsListResultInner object + */ + public Observable listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + return listByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName).map(new Func1, ProductsListResultInner>() { + @Override + public ProductsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists products by invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductsListResultInner object + */ + public Observable> listByInvoiceSectionWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + return service.listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByInvoiceSectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists products by invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductsListResultInner object if successful. + */ + public ProductsListResultInner listByInvoiceSection(String billingAccountName, String billingProfileName, String invoiceSectionName, String filter) { + return listByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, filter).toBlocking().single().body(); + } + + /** + * Lists products by invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String filter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, filter), serviceCallback); + } + + /** + * Lists products by invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductsListResultInner object + */ + public Observable listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String filter) { + return listByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, filter).map(new Func1, ProductsListResultInner>() { + @Override + public ProductsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists products by invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductsListResultInner object + */ + public Observable> listByInvoiceSectionWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String filter) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByInvoiceSectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByInvoiceSectionDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get a single product by name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner get(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName) { + return getWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, productName).toBlocking().single().body(); + } + + /** + * Get a single product by name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, productName), serviceCallback); + } + + /** + * Get a single product by name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable getAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName) { + return getWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, productName).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a single product by name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> getWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (productName == null) { + throw new IllegalArgumentException("Parameter productName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(billingAccountName, billingProfileName, invoiceSectionName, productName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * The operation to transfer a Product to another invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @param parameters Parameters supplied to the Transfer Product operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner transfer(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName, TransferProductRequestProperties parameters) { + return transferWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, parameters).toBlocking().single().body(); + } + + /** + * The operation to transfer a Product to another invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @param parameters Parameters supplied to the Transfer Product operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture transferAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName, TransferProductRequestProperties parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(transferWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, parameters), serviceCallback); + } + + /** + * The operation to transfer a Product to another invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @param parameters Parameters supplied to the Transfer Product operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable transferAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName, TransferProductRequestProperties parameters) { + return transferWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, parameters).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * The operation to transfer a Product to another invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @param parameters Parameters supplied to the Transfer Product operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> transferWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName, TransferProductRequestProperties parameters) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (productName == null) { + throw new IllegalArgumentException("Parameter productName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.transfer(billingAccountName, billingProfileName, invoiceSectionName, productName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = transferDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders transferDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .buildWithHeaders(response, ProductsTransferHeaders.class); + } + + /** + * Validates the transfer of products across invoice sections. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @param parameters Parameters supplied to the Transfer Products operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ValidateProductTransferEligibilityResultInner object if successful. + */ + public ValidateProductTransferEligibilityResultInner validateTransfer(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName, TransferProductRequestProperties parameters) { + return validateTransferWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, parameters).toBlocking().single().body(); + } + + /** + * Validates the transfer of products across invoice sections. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @param parameters Parameters supplied to the Transfer Products operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture validateTransferAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName, TransferProductRequestProperties parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(validateTransferWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, parameters), serviceCallback); + } + + /** + * Validates the transfer of products across invoice sections. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @param parameters Parameters supplied to the Transfer Products operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ValidateProductTransferEligibilityResultInner object + */ + public Observable validateTransferAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName, TransferProductRequestProperties parameters) { + return validateTransferWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, parameters).map(new Func1, ValidateProductTransferEligibilityResultInner>() { + @Override + public ValidateProductTransferEligibilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Validates the transfer of products across invoice sections. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @param parameters Parameters supplied to the Transfer Products operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ValidateProductTransferEligibilityResultInner object + */ + public Observable> validateTransferWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName, TransferProductRequestProperties parameters) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (productName == null) { + throw new IllegalArgumentException("Parameter productName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.validateTransfer(billingAccountName, billingProfileName, invoiceSectionName, productName, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = validateTransferDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse validateTransferDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Cancel auto renew for product by product id and invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UpdateAutoRenewOperationInner object if successful. + */ + public UpdateAutoRenewOperationInner updateAutoRenewByInvoiceSection(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName) { + return updateAutoRenewByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, productName).toBlocking().single().body(); + } + + /** + * Cancel auto renew for product by product id and invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAutoRenewByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateAutoRenewByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, productName), serviceCallback); + } + + /** + * Cancel auto renew for product by product id and invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UpdateAutoRenewOperationInner object + */ + public Observable updateAutoRenewByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName) { + return updateAutoRenewByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, productName).map(new Func1, UpdateAutoRenewOperationInner>() { + @Override + public UpdateAutoRenewOperationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancel auto renew for product by product id and invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UpdateAutoRenewOperationInner object + */ + public Observable> updateAutoRenewByInvoiceSectionWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (productName == null) { + throw new IllegalArgumentException("Parameter productName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final UpdateAutoRenew autoRenew = null; + UpdateAutoRenewRequest body = new UpdateAutoRenewRequest(); + body.withAutoRenew(null); + return service.updateAutoRenewByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, productName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateAutoRenewByInvoiceSectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Cancel auto renew for product by product id and invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @param autoRenew Request parameters to update auto renew policy a product. Possible values include: 'true', 'false' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UpdateAutoRenewOperationInner object if successful. + */ + public UpdateAutoRenewOperationInner updateAutoRenewByInvoiceSection(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName, UpdateAutoRenew autoRenew) { + return updateAutoRenewByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, autoRenew).toBlocking().single().body(); + } + + /** + * Cancel auto renew for product by product id and invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @param autoRenew Request parameters to update auto renew policy a product. Possible values include: 'true', 'false' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAutoRenewByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName, UpdateAutoRenew autoRenew, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateAutoRenewByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, autoRenew), serviceCallback); + } + + /** + * Cancel auto renew for product by product id and invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @param autoRenew Request parameters to update auto renew policy a product. Possible values include: 'true', 'false' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UpdateAutoRenewOperationInner object + */ + public Observable updateAutoRenewByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName, UpdateAutoRenew autoRenew) { + return updateAutoRenewByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, autoRenew).map(new Func1, UpdateAutoRenewOperationInner>() { + @Override + public UpdateAutoRenewOperationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancel auto renew for product by product id and invoice section name. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param productName Invoice Id. + * @param autoRenew Request parameters to update auto renew policy a product. Possible values include: 'true', 'false' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UpdateAutoRenewOperationInner object + */ + public Observable> updateAutoRenewByInvoiceSectionWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String productName, UpdateAutoRenew autoRenew) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (productName == null) { + throw new IllegalArgumentException("Parameter productName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + UpdateAutoRenewRequest body = new UpdateAutoRenewRequest(); + body.withAutoRenew(autoRenew); + return service.updateAutoRenewByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, productName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateAutoRenewByInvoiceSectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateAutoRenewByInvoiceSectionDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists products by billing account name. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList listByBillingAccountNext(final String nextPageLink) { + ServiceResponse> response = listByBillingAccountNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists products by billing account name. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByBillingAccountNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBillingAccountNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists products by billing account name. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> listByBillingAccountNextAsync(final String nextPageLink) { + return listByBillingAccountNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists products by billing account name. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> listByBillingAccountNextWithServiceResponseAsync(final String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByBillingAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists products by billing account name. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBillingAccountNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByBillingAccountNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBillingAccountNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByBillingAccountNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ProductsListResultImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ProductsListResultImpl.java new file mode 100644 index 000000000000..73551f9b3cf5 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ProductsListResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.ProductsListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class ProductsListResultImpl extends WrapperImpl implements ProductsListResult { + private final BillingManager manager; + ProductsListResultImpl(ProductsListResultInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ProductsListResultInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ProductsListResultInner.java new file mode 100644 index 000000000000..15786c813898 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ProductsListResultInner.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of listing products. It contains a list of available products + * summaries in reverse chronological order by purchase date. + */ +public class ProductsListResultInner { + /** + * The list of products. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the list of products. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Get the link (url) to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/RecipientTransferDetailsImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/RecipientTransferDetailsImpl.java new file mode 100644 index 000000000000..4df6e6011576 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/RecipientTransferDetailsImpl.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.RecipientTransferDetails; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.EligibleProductType; +import org.joda.time.DateTime; +import com.microsoft.azure.management.billing.v2019_10_01_preview.DetailedTransferStatus; +import com.microsoft.azure.management.billing.v2019_10_01_preview.TransferStatus; + +class RecipientTransferDetailsImpl extends WrapperImpl implements RecipientTransferDetails { + private final BillingManager manager; + RecipientTransferDetailsImpl(RecipientTransferDetailsInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public List allowedProductType() { + return this.inner().allowedProductType(); + } + + @Override + public String canceledBy() { + return this.inner().canceledBy(); + } + + @Override + public DateTime creationTime() { + return this.inner().creationTime(); + } + + @Override + public List detailedTransferStatus() { + return this.inner().detailedTransferStatus(); + } + + @Override + public DateTime expirationTime() { + return this.inner().expirationTime(); + } + + @Override + public String initiatorCustomerType() { + return this.inner().initiatorCustomerType(); + } + + @Override + public String initiatorEmailId() { + return this.inner().initiatorEmailId(); + } + + @Override + public DateTime lastModifiedTime() { + return this.inner().lastModifiedTime(); + } + + @Override + public String recipientEmailId() { + return this.inner().recipientEmailId(); + } + + @Override + public String resellerId() { + return this.inner().resellerId(); + } + + @Override + public String resellerName() { + return this.inner().resellerName(); + } + + @Override + public TransferStatus transferStatus() { + return this.inner().transferStatus(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/RecipientTransferDetailsInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/RecipientTransferDetailsInner.java new file mode 100644 index 000000000000..b5ebb971d64c --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/RecipientTransferDetailsInner.java @@ -0,0 +1,206 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.EligibleProductType; +import com.microsoft.azure.management.billing.v2019_10_01_preview.TransferStatus; +import com.microsoft.azure.management.billing.v2019_10_01_preview.DetailedTransferStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Details of the transfer. + */ +@JsonFlatten +public class RecipientTransferDetailsInner { + /** + * Transfer creation time. + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationTime; + + /** + * Transfer expiration time. + */ + @JsonProperty(value = "properties.expirationTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime expirationTime; + + /** + * Type of subscriptions that can be transferred. + */ + @JsonProperty(value = "properties.allowedProductType", access = JsonProperty.Access.WRITE_ONLY) + private List allowedProductType; + + /** + * Overall transfer status. Possible values include: 'Pending', + * 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', 'Canceled', + * 'Declined'. + */ + @JsonProperty(value = "properties.transferStatus", access = JsonProperty.Access.WRITE_ONLY) + private TransferStatus transferStatus; + + /** + * Email Id of recipient of transfer. + */ + @JsonProperty(value = "properties.recipientEmailId", access = JsonProperty.Access.WRITE_ONLY) + private String recipientEmailId; + + /** + * Email Id of initiator of transfer. + */ + @JsonProperty(value = "properties.initiatorEmailId", access = JsonProperty.Access.WRITE_ONLY) + private String initiatorEmailId; + + /** + * Reseller Id for transfer. + */ + @JsonProperty(value = "properties.resellerId", access = JsonProperty.Access.WRITE_ONLY) + private String resellerId; + + /** + * Reseller name for transfer. + */ + @JsonProperty(value = "properties.resellerName", access = JsonProperty.Access.WRITE_ONLY) + private String resellerName; + + /** + * Customer type of the initiator. + */ + @JsonProperty(value = "properties.initiatorCustomerType", access = JsonProperty.Access.WRITE_ONLY) + private String initiatorCustomerType; + + /** + * Email Id who user canceled the transfer. + */ + @JsonProperty(value = "properties.canceledBy", access = JsonProperty.Access.WRITE_ONLY) + private String canceledBy; + + /** + * Transfer last modification time. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * Detailed transfer status. + */ + @JsonProperty(value = "properties.detailedTransferStatus", access = JsonProperty.Access.WRITE_ONLY) + private List detailedTransferStatus; + + /** + * Get transfer creation time. + * + * @return the creationTime value + */ + public DateTime creationTime() { + return this.creationTime; + } + + /** + * Get transfer expiration time. + * + * @return the expirationTime value + */ + public DateTime expirationTime() { + return this.expirationTime; + } + + /** + * Get type of subscriptions that can be transferred. + * + * @return the allowedProductType value + */ + public List allowedProductType() { + return this.allowedProductType; + } + + /** + * Get overall transfer status. Possible values include: 'Pending', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', 'Canceled', 'Declined'. + * + * @return the transferStatus value + */ + public TransferStatus transferStatus() { + return this.transferStatus; + } + + /** + * Get email Id of recipient of transfer. + * + * @return the recipientEmailId value + */ + public String recipientEmailId() { + return this.recipientEmailId; + } + + /** + * Get email Id of initiator of transfer. + * + * @return the initiatorEmailId value + */ + public String initiatorEmailId() { + return this.initiatorEmailId; + } + + /** + * Get reseller Id for transfer. + * + * @return the resellerId value + */ + public String resellerId() { + return this.resellerId; + } + + /** + * Get reseller name for transfer. + * + * @return the resellerName value + */ + public String resellerName() { + return this.resellerName; + } + + /** + * Get customer type of the initiator. + * + * @return the initiatorCustomerType value + */ + public String initiatorCustomerType() { + return this.initiatorCustomerType; + } + + /** + * Get email Id who user canceled the transfer. + * + * @return the canceledBy value + */ + public String canceledBy() { + return this.canceledBy; + } + + /** + * Get transfer last modification time. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get detailed transfer status. + * + * @return the detailedTransferStatus value + */ + public List detailedTransferStatus() { + return this.detailedTransferStatus; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/RecipientTransfersImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/RecipientTransfersImpl.java new file mode 100644 index 000000000000..c189864fb1a6 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/RecipientTransfersImpl.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.RecipientTransfers; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.billing.v2019_10_01_preview.RecipientTransferDetails; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ValidateTransferListResponse; + +class RecipientTransfersImpl extends WrapperImpl implements RecipientTransfers { + private final BillingManager manager; + + RecipientTransfersImpl(BillingManager manager) { + super(manager.inner().recipientTransfers()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + @Override + public Observable acceptAsync(String transferName) { + RecipientTransfersInner client = this.inner(); + return client.acceptAsync(transferName) + .map(new Func1() { + @Override + public RecipientTransferDetails call(RecipientTransferDetailsInner inner) { + return new RecipientTransferDetailsImpl(inner, manager()); + } + }); + } + + @Override + public Observable validateAsync(String transferName) { + RecipientTransfersInner client = this.inner(); + return client.validateAsync(transferName) + .map(new Func1() { + @Override + public ValidateTransferListResponse call(ValidateTransferListResponseInner inner) { + return new ValidateTransferListResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable declineAsync(String transferName) { + RecipientTransfersInner client = this.inner(); + return client.declineAsync(transferName) + .map(new Func1() { + @Override + public RecipientTransferDetails call(RecipientTransferDetailsInner inner) { + return new RecipientTransferDetailsImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String transferName) { + RecipientTransfersInner client = this.inner(); + return client.getAsync(transferName) + .map(new Func1() { + @Override + public RecipientTransferDetails call(RecipientTransferDetailsInner inner) { + return new RecipientTransferDetailsImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync() { + RecipientTransfersInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RecipientTransferDetails call(RecipientTransferDetailsInner inner) { + return new RecipientTransferDetailsImpl(inner, manager()); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/RecipientTransfersInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/RecipientTransfersInner.java new file mode 100644 index 000000000000..d09881ea19db --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/RecipientTransfersInner.java @@ -0,0 +1,746 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.billing.v2019_10_01_preview.AcceptTransferRequest; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ProductDetails; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in RecipientTransfers. + */ +public class RecipientTransfersInner { + /** The Retrofit service to perform REST calls. */ + private RecipientTransfersService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of RecipientTransfersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RecipientTransfersInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(RecipientTransfersService.class); + this.client = client; + } + + /** + * The interface defining all the services for RecipientTransfers to be + * used by Retrofit to perform actually REST calls. + */ + interface RecipientTransfersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.RecipientTransfers accept" }) + @POST("providers/Microsoft.Billing/transfers/{transferName}/acceptTransfer") + Observable> accept(@Path("transferName") String transferName, @Header("accept-language") String acceptLanguage, @Body AcceptTransferRequest parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.RecipientTransfers validate" }) + @POST("providers/Microsoft.Billing/transfers/{transferName}/validateTransfer") + Observable> validate(@Path("transferName") String transferName, @Header("accept-language") String acceptLanguage, @Body AcceptTransferRequest parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.RecipientTransfers decline" }) + @POST("providers/Microsoft.Billing/transfers/{transferName}/declineTransfer") + Observable> decline(@Path("transferName") String transferName, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.RecipientTransfers get" }) + @GET("providers/Microsoft.Billing/transfers/{transferName}") + Observable> get(@Path("transferName") String transferName, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.RecipientTransfers list" }) + @GET("providers/Microsoft.Billing/transfers") + Observable> list(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.RecipientTransfers listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Accepts the transfer with given transfer Id. + * + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RecipientTransferDetailsInner object if successful. + */ + public RecipientTransferDetailsInner accept(String transferName) { + return acceptWithServiceResponseAsync(transferName).toBlocking().single().body(); + } + + /** + * Accepts the transfer with given transfer Id. + * + * @param transferName Transfer Name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture acceptAsync(String transferName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(acceptWithServiceResponseAsync(transferName), serviceCallback); + } + + /** + * Accepts the transfer with given transfer Id. + * + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RecipientTransferDetailsInner object + */ + public Observable acceptAsync(String transferName) { + return acceptWithServiceResponseAsync(transferName).map(new Func1, RecipientTransferDetailsInner>() { + @Override + public RecipientTransferDetailsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Accepts the transfer with given transfer Id. + * + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RecipientTransferDetailsInner object + */ + public Observable> acceptWithServiceResponseAsync(String transferName) { + if (transferName == null) { + throw new IllegalArgumentException("Parameter transferName is required and cannot be null."); + } + final List productDetails = null; + AcceptTransferRequest parameters = new AcceptTransferRequest(); + parameters.withProductDetails(null); + return service.accept(transferName, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = acceptDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Accepts the transfer with given transfer Id. + * + * @param transferName Transfer Name. + * @param productDetails Request parameters to accept transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RecipientTransferDetailsInner object if successful. + */ + public RecipientTransferDetailsInner accept(String transferName, List productDetails) { + return acceptWithServiceResponseAsync(transferName, productDetails).toBlocking().single().body(); + } + + /** + * Accepts the transfer with given transfer Id. + * + * @param transferName Transfer Name. + * @param productDetails Request parameters to accept transfer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture acceptAsync(String transferName, List productDetails, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(acceptWithServiceResponseAsync(transferName, productDetails), serviceCallback); + } + + /** + * Accepts the transfer with given transfer Id. + * + * @param transferName Transfer Name. + * @param productDetails Request parameters to accept transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RecipientTransferDetailsInner object + */ + public Observable acceptAsync(String transferName, List productDetails) { + return acceptWithServiceResponseAsync(transferName, productDetails).map(new Func1, RecipientTransferDetailsInner>() { + @Override + public RecipientTransferDetailsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Accepts the transfer with given transfer Id. + * + * @param transferName Transfer Name. + * @param productDetails Request parameters to accept transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RecipientTransferDetailsInner object + */ + public Observable> acceptWithServiceResponseAsync(String transferName, List productDetails) { + if (transferName == null) { + throw new IllegalArgumentException("Parameter transferName is required and cannot be null."); + } + Validator.validate(productDetails); + AcceptTransferRequest parameters = new AcceptTransferRequest(); + parameters.withProductDetails(productDetails); + return service.accept(transferName, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = acceptDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse acceptDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Validates if the products can be transferred in the context of the given transfer name. + * + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ValidateTransferListResponseInner object if successful. + */ + public ValidateTransferListResponseInner validate(String transferName) { + return validateWithServiceResponseAsync(transferName).toBlocking().single().body(); + } + + /** + * Validates if the products can be transferred in the context of the given transfer name. + * + * @param transferName Transfer Name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture validateAsync(String transferName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(validateWithServiceResponseAsync(transferName), serviceCallback); + } + + /** + * Validates if the products can be transferred in the context of the given transfer name. + * + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ValidateTransferListResponseInner object + */ + public Observable validateAsync(String transferName) { + return validateWithServiceResponseAsync(transferName).map(new Func1, ValidateTransferListResponseInner>() { + @Override + public ValidateTransferListResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Validates if the products can be transferred in the context of the given transfer name. + * + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ValidateTransferListResponseInner object + */ + public Observable> validateWithServiceResponseAsync(String transferName) { + if (transferName == null) { + throw new IllegalArgumentException("Parameter transferName is required and cannot be null."); + } + final List productDetails = null; + AcceptTransferRequest parameters = new AcceptTransferRequest(); + parameters.withProductDetails(null); + return service.validate(transferName, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = validateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Validates if the products can be transferred in the context of the given transfer name. + * + * @param transferName Transfer Name. + * @param productDetails Request parameters to accept transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ValidateTransferListResponseInner object if successful. + */ + public ValidateTransferListResponseInner validate(String transferName, List productDetails) { + return validateWithServiceResponseAsync(transferName, productDetails).toBlocking().single().body(); + } + + /** + * Validates if the products can be transferred in the context of the given transfer name. + * + * @param transferName Transfer Name. + * @param productDetails Request parameters to accept transfer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture validateAsync(String transferName, List productDetails, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(validateWithServiceResponseAsync(transferName, productDetails), serviceCallback); + } + + /** + * Validates if the products can be transferred in the context of the given transfer name. + * + * @param transferName Transfer Name. + * @param productDetails Request parameters to accept transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ValidateTransferListResponseInner object + */ + public Observable validateAsync(String transferName, List productDetails) { + return validateWithServiceResponseAsync(transferName, productDetails).map(new Func1, ValidateTransferListResponseInner>() { + @Override + public ValidateTransferListResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Validates if the products can be transferred in the context of the given transfer name. + * + * @param transferName Transfer Name. + * @param productDetails Request parameters to accept transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ValidateTransferListResponseInner object + */ + public Observable> validateWithServiceResponseAsync(String transferName, List productDetails) { + if (transferName == null) { + throw new IllegalArgumentException("Parameter transferName is required and cannot be null."); + } + Validator.validate(productDetails); + AcceptTransferRequest parameters = new AcceptTransferRequest(); + parameters.withProductDetails(productDetails); + return service.validate(transferName, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = validateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse validateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Declines the transfer with given transfer Id. + * + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RecipientTransferDetailsInner object if successful. + */ + public RecipientTransferDetailsInner decline(String transferName) { + return declineWithServiceResponseAsync(transferName).toBlocking().single().body(); + } + + /** + * Declines the transfer with given transfer Id. + * + * @param transferName Transfer Name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture declineAsync(String transferName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(declineWithServiceResponseAsync(transferName), serviceCallback); + } + + /** + * Declines the transfer with given transfer Id. + * + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RecipientTransferDetailsInner object + */ + public Observable declineAsync(String transferName) { + return declineWithServiceResponseAsync(transferName).map(new Func1, RecipientTransferDetailsInner>() { + @Override + public RecipientTransferDetailsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Declines the transfer with given transfer Id. + * + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RecipientTransferDetailsInner object + */ + public Observable> declineWithServiceResponseAsync(String transferName) { + if (transferName == null) { + throw new IllegalArgumentException("Parameter transferName is required and cannot be null."); + } + return service.decline(transferName, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = declineDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse declineDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the transfer with given transfer Id. + * + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RecipientTransferDetailsInner object if successful. + */ + public RecipientTransferDetailsInner get(String transferName) { + return getWithServiceResponseAsync(transferName).toBlocking().single().body(); + } + + /** + * Gets the transfer with given transfer Id. + * + * @param transferName Transfer Name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String transferName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(transferName), serviceCallback); + } + + /** + * Gets the transfer with given transfer Id. + * + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RecipientTransferDetailsInner object + */ + public Observable getAsync(String transferName) { + return getWithServiceResponseAsync(transferName).map(new Func1, RecipientTransferDetailsInner>() { + @Override + public RecipientTransferDetailsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the transfer with given transfer Id. + * + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RecipientTransferDetailsInner object + */ + public Observable> getWithServiceResponseAsync(String transferName) { + if (transferName == null) { + throw new IllegalArgumentException("Parameter transferName is required and cannot be null."); + } + return service.get(transferName, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the transfers received by caller. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RecipientTransferDetailsInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the transfers received by caller. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the transfers received by caller. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecipientTransferDetailsInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the transfers received by caller. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecipientTransferDetailsInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the transfers received by caller. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RecipientTransferDetailsInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + return service.list(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the transfers received by caller. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RecipientTransferDetailsInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the transfers received by caller. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the transfers received by caller. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecipientTransferDetailsInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the transfers received by caller. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecipientTransferDetailsInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the transfers received by caller. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RecipientTransferDetailsInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransactionImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransactionImpl.java new file mode 100644 index 000000000000..3514bdd18c92 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransactionImpl.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.Transaction; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.billing.v2019_10_01_preview.TransactionTypeKind; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Amount; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ReservationType; + +class TransactionImpl extends WrapperImpl implements Transaction { + private final BillingManager manager; + + TransactionImpl(TransactionInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + + + @Override + public String billingProfileDisplayName() { + return this.inner().billingProfileDisplayName(); + } + + @Override + public String billingProfileId() { + return this.inner().billingProfileId(); + } + + @Override + public String customerDisplayName() { + return this.inner().customerDisplayName(); + } + + @Override + public String customerId() { + return this.inner().customerId(); + } + + @Override + public DateTime dateProperty() { + return this.inner().dateProperty(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String invoice() { + return this.inner().invoice(); + } + + @Override + public String invoiceSectionDisplayName() { + return this.inner().invoiceSectionDisplayName(); + } + + @Override + public String invoiceSectionId() { + return this.inner().invoiceSectionId(); + } + + @Override + public TransactionTypeKind kind() { + return this.inner().kind(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String orderId() { + return this.inner().orderId(); + } + + @Override + public String orderName() { + return this.inner().orderName(); + } + + @Override + public String productDescription() { + return this.inner().productDescription(); + } + + @Override + public String productFamily() { + return this.inner().productFamily(); + } + + @Override + public String productType() { + return this.inner().productType(); + } + + @Override + public String productTypeId() { + return this.inner().productTypeId(); + } + + @Override + public Integer quantity() { + return this.inner().quantity(); + } + + @Override + public String subscriptionId() { + return this.inner().subscriptionId(); + } + + @Override + public String subscriptionName() { + return this.inner().subscriptionName(); + } + + @Override + public Amount transactionAmount() { + return this.inner().transactionAmount(); + } + + @Override + public ReservationType transactionType() { + return this.inner().transactionType(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransactionInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransactionInner.java new file mode 100644 index 000000000000..67a3e5a282c3 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransactionInner.java @@ -0,0 +1,347 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.TransactionTypeKind; +import org.joda.time.DateTime; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ReservationType; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Amount; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A reservation transaction resource. + */ +@JsonFlatten +public class TransactionInner extends ProxyResource { + /** + * The kind of transaction. Choices are all and reservation. Possible + * values include: 'all', 'reservation'. + */ + @JsonProperty(value = "properties.kind") + private TransactionTypeKind kind; + + /** + * The date of reservation transaction. + */ + @JsonProperty(value = "properties.date", access = JsonProperty.Access.WRITE_ONLY) + private DateTime dateProperty; + + /** + * Invoice number or 'pending' if not invoiced. + */ + @JsonProperty(value = "properties.invoice", access = JsonProperty.Access.WRITE_ONLY) + private String invoice; + + /** + * The reservation order id. + */ + @JsonProperty(value = "properties.orderId", access = JsonProperty.Access.WRITE_ONLY) + private String orderId; + + /** + * The reservation order name. + */ + @JsonProperty(value = "properties.orderName", access = JsonProperty.Access.WRITE_ONLY) + private String orderName; + + /** + * The product family. + */ + @JsonProperty(value = "properties.productFamily", access = JsonProperty.Access.WRITE_ONLY) + private String productFamily; + + /** + * The product type id. + */ + @JsonProperty(value = "properties.productTypeId", access = JsonProperty.Access.WRITE_ONLY) + private String productTypeId; + + /** + * The type of product. + */ + @JsonProperty(value = "properties.productType", access = JsonProperty.Access.WRITE_ONLY) + private String productType; + + /** + * Product description. + */ + @JsonProperty(value = "properties.productDescription", access = JsonProperty.Access.WRITE_ONLY) + private String productDescription; + + /** + * Transaction types. Possible values include: 'Purchase', 'Usage Charge'. + */ + @JsonProperty(value = "properties.transactionType") + private ReservationType transactionType; + + /** + * Last charge associated with the purchase. + */ + @JsonProperty(value = "properties.transactionAmount", access = JsonProperty.Access.WRITE_ONLY) + private Amount transactionAmount; + + /** + * Purchase quantity. + */ + @JsonProperty(value = "properties.quantity", access = JsonProperty.Access.WRITE_ONLY) + private Integer quantity; + + /** + * Invoice section id to which this product belongs. + */ + @JsonProperty(value = "properties.invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionId; + + /** + * Invoice section display name to which this product belongs. + */ + @JsonProperty(value = "properties.invoiceSectionDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionDisplayName; + + /** + * Billing Profile id to which this product belongs. + */ + @JsonProperty(value = "properties.billingProfileId", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileId; + + /** + * Billing Profile display name to which this product belongs. + */ + @JsonProperty(value = "properties.billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileDisplayName; + + /** + * Customer id to which this product belongs. + */ + @JsonProperty(value = "properties.customerId", access = JsonProperty.Access.WRITE_ONLY) + private String customerId; + + /** + * Display name of customer to which this product belongs. + */ + @JsonProperty(value = "properties.customerDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String customerDisplayName; + + /** + * The subscription id. + */ + @JsonProperty(value = "properties.subscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionId; + + /** + * The subscription name. + */ + @JsonProperty(value = "properties.subscriptionName", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionName; + + /** + * Get the kind of transaction. Choices are all and reservation. Possible values include: 'all', 'reservation'. + * + * @return the kind value + */ + public TransactionTypeKind kind() { + return this.kind; + } + + /** + * Set the kind of transaction. Choices are all and reservation. Possible values include: 'all', 'reservation'. + * + * @param kind the kind value to set + * @return the TransactionInner object itself. + */ + public TransactionInner withKind(TransactionTypeKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the date of reservation transaction. + * + * @return the dateProperty value + */ + public DateTime dateProperty() { + return this.dateProperty; + } + + /** + * Get invoice number or 'pending' if not invoiced. + * + * @return the invoice value + */ + public String invoice() { + return this.invoice; + } + + /** + * Get the reservation order id. + * + * @return the orderId value + */ + public String orderId() { + return this.orderId; + } + + /** + * Get the reservation order name. + * + * @return the orderName value + */ + public String orderName() { + return this.orderName; + } + + /** + * Get the product family. + * + * @return the productFamily value + */ + public String productFamily() { + return this.productFamily; + } + + /** + * Get the product type id. + * + * @return the productTypeId value + */ + public String productTypeId() { + return this.productTypeId; + } + + /** + * Get the type of product. + * + * @return the productType value + */ + public String productType() { + return this.productType; + } + + /** + * Get product description. + * + * @return the productDescription value + */ + public String productDescription() { + return this.productDescription; + } + + /** + * Get transaction types. Possible values include: 'Purchase', 'Usage Charge'. + * + * @return the transactionType value + */ + public ReservationType transactionType() { + return this.transactionType; + } + + /** + * Set transaction types. Possible values include: 'Purchase', 'Usage Charge'. + * + * @param transactionType the transactionType value to set + * @return the TransactionInner object itself. + */ + public TransactionInner withTransactionType(ReservationType transactionType) { + this.transactionType = transactionType; + return this; + } + + /** + * Get last charge associated with the purchase. + * + * @return the transactionAmount value + */ + public Amount transactionAmount() { + return this.transactionAmount; + } + + /** + * Get purchase quantity. + * + * @return the quantity value + */ + public Integer quantity() { + return this.quantity; + } + + /** + * Get invoice section id to which this product belongs. + * + * @return the invoiceSectionId value + */ + public String invoiceSectionId() { + return this.invoiceSectionId; + } + + /** + * Get invoice section display name to which this product belongs. + * + * @return the invoiceSectionDisplayName value + */ + public String invoiceSectionDisplayName() { + return this.invoiceSectionDisplayName; + } + + /** + * Get billing Profile id to which this product belongs. + * + * @return the billingProfileId value + */ + public String billingProfileId() { + return this.billingProfileId; + } + + /** + * Get billing Profile display name to which this product belongs. + * + * @return the billingProfileDisplayName value + */ + public String billingProfileDisplayName() { + return this.billingProfileDisplayName; + } + + /** + * Get customer id to which this product belongs. + * + * @return the customerId value + */ + public String customerId() { + return this.customerId; + } + + /** + * Get display name of customer to which this product belongs. + * + * @return the customerDisplayName value + */ + public String customerDisplayName() { + return this.customerDisplayName; + } + + /** + * Get the subscription id. + * + * @return the subscriptionId value + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Get the subscription name. + * + * @return the subscriptionName value + */ + public String subscriptionName() { + return this.subscriptionName; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransactionListResultImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransactionListResultImpl.java new file mode 100644 index 000000000000..56432436dd37 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransactionListResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.TransactionListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class TransactionListResultImpl extends WrapperImpl implements TransactionListResult { + private final BillingManager manager; + TransactionListResultImpl(TransactionListResultInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransactionListResultInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransactionListResultInner.java new file mode 100644 index 000000000000..1b77bb5d5214 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransactionListResultInner.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of listing reservation transactions. + */ +public class TransactionListResultInner { + /** + * The list of reservation transactions. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the list of reservation transactions. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Get the link (url) to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransactionsImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransactionsImpl.java new file mode 100644 index 000000000000..910ad9339644 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransactionsImpl.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Transactions; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Transaction; +import com.microsoft.azure.management.billing.v2019_10_01_preview.TransactionListResult; + +class TransactionsImpl extends WrapperImpl implements Transactions { + private final BillingManager manager; + + TransactionsImpl(BillingManager manager) { + super(manager.inner().transactions()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + private TransactionImpl wrapModel(TransactionInner inner) { + return new TransactionImpl(inner, manager()); + } + + @Override + public Observable listByBillingAccountAsync(final String billingAccountName, final String startDate, final String endDate) { + TransactionsInner client = this.inner(); + return client.listByBillingAccountAsync(billingAccountName, startDate, endDate) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Transaction call(TransactionInner inner) { + return new TransactionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByBillingProfileAsync(String billingAccountName, String billingProfileName, String startDate, String endDate) { + TransactionsInner client = this.inner(); + return client.listByBillingProfileAsync(billingAccountName, billingProfileName, startDate, endDate) + .map(new Func1() { + @Override + public TransactionListResult call(TransactionListResultInner inner) { + return new TransactionListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String startDate, String endDate) { + TransactionsInner client = this.inner(); + return client.listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, startDate, endDate) + .map(new Func1() { + @Override + public TransactionListResult call(TransactionListResultInner inner) { + return new TransactionListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String billingAccountName, String billingProfileName, String transactionName, String startDate, String endDate) { + TransactionsInner client = this.inner(); + return client.getAsync(billingAccountName, billingProfileName, transactionName, startDate, endDate) + .map(new Func1() { + @Override + public Transaction call(TransactionInner inner) { + return new TransactionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByCustomerAsync(final String billingAccountName, final String customerName, final String startDate, final String endDate) { + TransactionsInner client = this.inner(); + return client.listByCustomerAsync(billingAccountName, customerName, startDate, endDate) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Transaction call(TransactionInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransactionsInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransactionsInner.java new file mode 100644 index 000000000000..a7b0e922737a --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransactionsInner.java @@ -0,0 +1,1340 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Transactions. + */ +public class TransactionsInner { + /** The Retrofit service to perform REST calls. */ + private TransactionsService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of TransactionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TransactionsInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(TransactionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Transactions to be + * used by Retrofit to perform actually REST calls. + */ + interface TransactionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Transactions listByCustomer" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/transactions") + Observable> listByCustomer(@Path("billingAccountName") String billingAccountName, @Path("customerName") String customerName, @Query("api-version") String apiVersion, @Query("startDate") String startDate, @Query("endDate") String endDate, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Transactions listByBillingAccount" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/transactions") + Observable> listByBillingAccount(@Path("billingAccountName") String billingAccountName, @Query("api-version") String apiVersion, @Query("startDate") String startDate, @Query("endDate") String endDate, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Transactions listByBillingProfile" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/transactions") + Observable> listByBillingProfile(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Query("api-version") String apiVersion, @Query("startDate") String startDate, @Query("endDate") String endDate, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Transactions listByInvoiceSection" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transactions") + Observable> listByInvoiceSection(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Query("api-version") String apiVersion, @Query("startDate") String startDate, @Query("endDate") String endDate, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Transactions get" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/transactions/{transactionName}") + Observable> get(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("transactionName") String transactionName, @Query("startDate") String startDate, @Query("endDate") String endDate, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Transactions listByCustomerNext" }) + @GET + Observable> listByCustomerNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Transactions listByBillingAccountNext" }) + @GET + Observable> listByBillingAccountNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists the transactions by customer id for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param startDate Start date + * @param endDate End date + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TransactionInner> object if successful. + */ + public PagedList listByCustomer(final String billingAccountName, final String customerName, final String startDate, final String endDate) { + ServiceResponse> response = listByCustomerSinglePageAsync(billingAccountName, customerName, startDate, endDate).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByCustomerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the transactions by customer id for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param startDate Start date + * @param endDate End date + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByCustomerAsync(final String billingAccountName, final String customerName, final String startDate, final String endDate, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByCustomerSinglePageAsync(billingAccountName, customerName, startDate, endDate), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByCustomerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the transactions by customer id for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param startDate Start date + * @param endDate End date + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransactionInner> object + */ + public Observable> listByCustomerAsync(final String billingAccountName, final String customerName, final String startDate, final String endDate) { + return listByCustomerWithServiceResponseAsync(billingAccountName, customerName, startDate, endDate) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the transactions by customer id for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param startDate Start date + * @param endDate End date + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransactionInner> object + */ + public Observable>> listByCustomerWithServiceResponseAsync(final String billingAccountName, final String customerName, final String startDate, final String endDate) { + return listByCustomerSinglePageAsync(billingAccountName, customerName, startDate, endDate) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByCustomerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the transactions by customer id for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param startDate Start date + * @param endDate End date + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TransactionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByCustomerSinglePageAsync(final String billingAccountName, final String customerName, final String startDate, final String endDate) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (customerName == null) { + throw new IllegalArgumentException("Parameter customerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (startDate == null) { + throw new IllegalArgumentException("Parameter startDate is required and cannot be null."); + } + if (endDate == null) { + throw new IllegalArgumentException("Parameter endDate is required and cannot be null."); + } + final String filter = null; + return service.listByCustomer(billingAccountName, customerName, this.client.apiVersion(), startDate, endDate, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByCustomerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the transactions by customer id for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param startDate Start date + * @param endDate End date + * @param filter May be used to filter by transaction kind. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TransactionInner> object if successful. + */ + public PagedList listByCustomer(final String billingAccountName, final String customerName, final String startDate, final String endDate, final String filter) { + ServiceResponse> response = listByCustomerSinglePageAsync(billingAccountName, customerName, startDate, endDate, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByCustomerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the transactions by customer id for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param startDate Start date + * @param endDate End date + * @param filter May be used to filter by transaction kind. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByCustomerAsync(final String billingAccountName, final String customerName, final String startDate, final String endDate, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByCustomerSinglePageAsync(billingAccountName, customerName, startDate, endDate, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByCustomerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the transactions by customer id for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param startDate Start date + * @param endDate End date + * @param filter May be used to filter by transaction kind. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransactionInner> object + */ + public Observable> listByCustomerAsync(final String billingAccountName, final String customerName, final String startDate, final String endDate, final String filter) { + return listByCustomerWithServiceResponseAsync(billingAccountName, customerName, startDate, endDate, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the transactions by customer id for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param customerName Customer name. + * @param startDate Start date + * @param endDate End date + * @param filter May be used to filter by transaction kind. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransactionInner> object + */ + public Observable>> listByCustomerWithServiceResponseAsync(final String billingAccountName, final String customerName, final String startDate, final String endDate, final String filter) { + return listByCustomerSinglePageAsync(billingAccountName, customerName, startDate, endDate, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByCustomerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the transactions by customer id for given start date and end date. + * + ServiceResponse> * @param billingAccountName billing Account Id. + ServiceResponse> * @param customerName Customer name. + ServiceResponse> * @param startDate Start date + ServiceResponse> * @param endDate End date + ServiceResponse> * @param filter May be used to filter by transaction kind. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TransactionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByCustomerSinglePageAsync(final String billingAccountName, final String customerName, final String startDate, final String endDate, final String filter) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (customerName == null) { + throw new IllegalArgumentException("Parameter customerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (startDate == null) { + throw new IllegalArgumentException("Parameter startDate is required and cannot be null."); + } + if (endDate == null) { + throw new IllegalArgumentException("Parameter endDate is required and cannot be null."); + } + return service.listByCustomer(billingAccountName, customerName, this.client.apiVersion(), startDate, endDate, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByCustomerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByCustomerDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the transactions by billing account name for given start and end date. + * + * @param billingAccountName billing Account Id. + * @param startDate Start date + * @param endDate End date + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TransactionInner> object if successful. + */ + public PagedList listByBillingAccount(final String billingAccountName, final String startDate, final String endDate) { + ServiceResponse> response = listByBillingAccountSinglePageAsync(billingAccountName, startDate, endDate).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the transactions by billing account name for given start and end date. + * + * @param billingAccountName billing Account Id. + * @param startDate Start date + * @param endDate End date + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByBillingAccountAsync(final String billingAccountName, final String startDate, final String endDate, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBillingAccountSinglePageAsync(billingAccountName, startDate, endDate), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the transactions by billing account name for given start and end date. + * + * @param billingAccountName billing Account Id. + * @param startDate Start date + * @param endDate End date + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransactionInner> object + */ + public Observable> listByBillingAccountAsync(final String billingAccountName, final String startDate, final String endDate) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName, startDate, endDate) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the transactions by billing account name for given start and end date. + * + * @param billingAccountName billing Account Id. + * @param startDate Start date + * @param endDate End date + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransactionInner> object + */ + public Observable>> listByBillingAccountWithServiceResponseAsync(final String billingAccountName, final String startDate, final String endDate) { + return listByBillingAccountSinglePageAsync(billingAccountName, startDate, endDate) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByBillingAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the transactions by billing account name for given start and end date. + * + * @param billingAccountName billing Account Id. + * @param startDate Start date + * @param endDate End date + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TransactionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBillingAccountSinglePageAsync(final String billingAccountName, final String startDate, final String endDate) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (startDate == null) { + throw new IllegalArgumentException("Parameter startDate is required and cannot be null."); + } + if (endDate == null) { + throw new IllegalArgumentException("Parameter endDate is required and cannot be null."); + } + final String filter = null; + return service.listByBillingAccount(billingAccountName, this.client.apiVersion(), startDate, endDate, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBillingAccountDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the transactions by billing account name for given start and end date. + * + * @param billingAccountName billing Account Id. + * @param startDate Start date + * @param endDate End date + * @param filter May be used to filter by transaction kind. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TransactionInner> object if successful. + */ + public PagedList listByBillingAccount(final String billingAccountName, final String startDate, final String endDate, final String filter) { + ServiceResponse> response = listByBillingAccountSinglePageAsync(billingAccountName, startDate, endDate, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the transactions by billing account name for given start and end date. + * + * @param billingAccountName billing Account Id. + * @param startDate Start date + * @param endDate End date + * @param filter May be used to filter by transaction kind. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByBillingAccountAsync(final String billingAccountName, final String startDate, final String endDate, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBillingAccountSinglePageAsync(billingAccountName, startDate, endDate, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the transactions by billing account name for given start and end date. + * + * @param billingAccountName billing Account Id. + * @param startDate Start date + * @param endDate End date + * @param filter May be used to filter by transaction kind. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransactionInner> object + */ + public Observable> listByBillingAccountAsync(final String billingAccountName, final String startDate, final String endDate, final String filter) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName, startDate, endDate, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the transactions by billing account name for given start and end date. + * + * @param billingAccountName billing Account Id. + * @param startDate Start date + * @param endDate End date + * @param filter May be used to filter by transaction kind. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransactionInner> object + */ + public Observable>> listByBillingAccountWithServiceResponseAsync(final String billingAccountName, final String startDate, final String endDate, final String filter) { + return listByBillingAccountSinglePageAsync(billingAccountName, startDate, endDate, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByBillingAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the transactions by billing account name for given start and end date. + * + ServiceResponse> * @param billingAccountName billing Account Id. + ServiceResponse> * @param startDate Start date + ServiceResponse> * @param endDate End date + ServiceResponse> * @param filter May be used to filter by transaction kind. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TransactionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBillingAccountSinglePageAsync(final String billingAccountName, final String startDate, final String endDate, final String filter) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (startDate == null) { + throw new IllegalArgumentException("Parameter startDate is required and cannot be null."); + } + if (endDate == null) { + throw new IllegalArgumentException("Parameter endDate is required and cannot be null."); + } + return service.listByBillingAccount(billingAccountName, this.client.apiVersion(), startDate, endDate, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBillingAccountDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByBillingAccountDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the transactions by billing profile name for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param startDate Start date + * @param endDate End date + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TransactionListResultInner object if successful. + */ + public TransactionListResultInner listByBillingProfile(String billingAccountName, String billingProfileName, String startDate, String endDate) { + return listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, startDate, endDate).toBlocking().single().body(); + } + + /** + * Lists the transactions by billing profile name for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param startDate Start date + * @param endDate End date + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByBillingProfileAsync(String billingAccountName, String billingProfileName, String startDate, String endDate, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, startDate, endDate), serviceCallback); + } + + /** + * Lists the transactions by billing profile name for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param startDate Start date + * @param endDate End date + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransactionListResultInner object + */ + public Observable listByBillingProfileAsync(String billingAccountName, String billingProfileName, String startDate, String endDate) { + return listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, startDate, endDate).map(new Func1, TransactionListResultInner>() { + @Override + public TransactionListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the transactions by billing profile name for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param startDate Start date + * @param endDate End date + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransactionListResultInner object + */ + public Observable> listByBillingProfileWithServiceResponseAsync(String billingAccountName, String billingProfileName, String startDate, String endDate) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (startDate == null) { + throw new IllegalArgumentException("Parameter startDate is required and cannot be null."); + } + if (endDate == null) { + throw new IllegalArgumentException("Parameter endDate is required and cannot be null."); + } + final String filter = null; + return service.listByBillingProfile(billingAccountName, billingProfileName, this.client.apiVersion(), startDate, endDate, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByBillingProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the transactions by billing profile name for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param startDate Start date + * @param endDate End date + * @param filter May be used to filter by transaction kind. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TransactionListResultInner object if successful. + */ + public TransactionListResultInner listByBillingProfile(String billingAccountName, String billingProfileName, String startDate, String endDate, String filter) { + return listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, startDate, endDate, filter).toBlocking().single().body(); + } + + /** + * Lists the transactions by billing profile name for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param startDate Start date + * @param endDate End date + * @param filter May be used to filter by transaction kind. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByBillingProfileAsync(String billingAccountName, String billingProfileName, String startDate, String endDate, String filter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, startDate, endDate, filter), serviceCallback); + } + + /** + * Lists the transactions by billing profile name for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param startDate Start date + * @param endDate End date + * @param filter May be used to filter by transaction kind. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransactionListResultInner object + */ + public Observable listByBillingProfileAsync(String billingAccountName, String billingProfileName, String startDate, String endDate, String filter) { + return listByBillingProfileWithServiceResponseAsync(billingAccountName, billingProfileName, startDate, endDate, filter).map(new Func1, TransactionListResultInner>() { + @Override + public TransactionListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the transactions by billing profile name for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param startDate Start date + * @param endDate End date + * @param filter May be used to filter by transaction kind. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransactionListResultInner object + */ + public Observable> listByBillingProfileWithServiceResponseAsync(String billingAccountName, String billingProfileName, String startDate, String endDate, String filter) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (startDate == null) { + throw new IllegalArgumentException("Parameter startDate is required and cannot be null."); + } + if (endDate == null) { + throw new IllegalArgumentException("Parameter endDate is required and cannot be null."); + } + return service.listByBillingProfile(billingAccountName, billingProfileName, this.client.apiVersion(), startDate, endDate, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByBillingProfileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByBillingProfileDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the transactions by invoice section name for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param startDate Start date + * @param endDate End date + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TransactionListResultInner object if successful. + */ + public TransactionListResultInner listByInvoiceSection(String billingAccountName, String billingProfileName, String invoiceSectionName, String startDate, String endDate) { + return listByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, startDate, endDate).toBlocking().single().body(); + } + + /** + * Lists the transactions by invoice section name for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param startDate Start date + * @param endDate End date + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String startDate, String endDate, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, startDate, endDate), serviceCallback); + } + + /** + * Lists the transactions by invoice section name for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param startDate Start date + * @param endDate End date + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransactionListResultInner object + */ + public Observable listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String startDate, String endDate) { + return listByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, startDate, endDate).map(new Func1, TransactionListResultInner>() { + @Override + public TransactionListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the transactions by invoice section name for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param startDate Start date + * @param endDate End date + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransactionListResultInner object + */ + public Observable> listByInvoiceSectionWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String startDate, String endDate) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (startDate == null) { + throw new IllegalArgumentException("Parameter startDate is required and cannot be null."); + } + if (endDate == null) { + throw new IllegalArgumentException("Parameter endDate is required and cannot be null."); + } + final String filter = null; + return service.listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, this.client.apiVersion(), startDate, endDate, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByInvoiceSectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the transactions by invoice section name for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param startDate Start date + * @param endDate End date + * @param filter May be used to filter by transaction kind. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TransactionListResultInner object if successful. + */ + public TransactionListResultInner listByInvoiceSection(String billingAccountName, String billingProfileName, String invoiceSectionName, String startDate, String endDate, String filter) { + return listByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, startDate, endDate, filter).toBlocking().single().body(); + } + + /** + * Lists the transactions by invoice section name for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param startDate Start date + * @param endDate End date + * @param filter May be used to filter by transaction kind. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String startDate, String endDate, String filter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, startDate, endDate, filter), serviceCallback); + } + + /** + * Lists the transactions by invoice section name for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param startDate Start date + * @param endDate End date + * @param filter May be used to filter by transaction kind. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransactionListResultInner object + */ + public Observable listByInvoiceSectionAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String startDate, String endDate, String filter) { + return listByInvoiceSectionWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, startDate, endDate, filter).map(new Func1, TransactionListResultInner>() { + @Override + public TransactionListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the transactions by invoice section name for given start date and end date. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param startDate Start date + * @param endDate End date + * @param filter May be used to filter by transaction kind. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransactionListResultInner object + */ + public Observable> listByInvoiceSectionWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String startDate, String endDate, String filter) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (startDate == null) { + throw new IllegalArgumentException("Parameter startDate is required and cannot be null."); + } + if (endDate == null) { + throw new IllegalArgumentException("Parameter endDate is required and cannot be null."); + } + return service.listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, this.client.apiVersion(), startDate, endDate, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByInvoiceSectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByInvoiceSectionDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get the transaction. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param transactionName Transaction name. + * @param startDate Start date + * @param endDate End date + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TransactionInner object if successful. + */ + public TransactionInner get(String billingAccountName, String billingProfileName, String transactionName, String startDate, String endDate) { + return getWithServiceResponseAsync(billingAccountName, billingProfileName, transactionName, startDate, endDate).toBlocking().single().body(); + } + + /** + * Get the transaction. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param transactionName Transaction name. + * @param startDate Start date + * @param endDate End date + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String billingAccountName, String billingProfileName, String transactionName, String startDate, String endDate, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(billingAccountName, billingProfileName, transactionName, startDate, endDate), serviceCallback); + } + + /** + * Get the transaction. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param transactionName Transaction name. + * @param startDate Start date + * @param endDate End date + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransactionInner object + */ + public Observable getAsync(String billingAccountName, String billingProfileName, String transactionName, String startDate, String endDate) { + return getWithServiceResponseAsync(billingAccountName, billingProfileName, transactionName, startDate, endDate).map(new Func1, TransactionInner>() { + @Override + public TransactionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the transaction. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param transactionName Transaction name. + * @param startDate Start date + * @param endDate End date + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransactionInner object + */ + public Observable> getWithServiceResponseAsync(String billingAccountName, String billingProfileName, String transactionName, String startDate, String endDate) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (transactionName == null) { + throw new IllegalArgumentException("Parameter transactionName is required and cannot be null."); + } + if (startDate == null) { + throw new IllegalArgumentException("Parameter startDate is required and cannot be null."); + } + if (endDate == null) { + throw new IllegalArgumentException("Parameter endDate is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(billingAccountName, billingProfileName, transactionName, startDate, endDate, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the transactions by customer id for given start date and end date. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TransactionInner> object if successful. + */ + public PagedList listByCustomerNext(final String nextPageLink) { + ServiceResponse> response = listByCustomerNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByCustomerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the transactions by customer id for given start date and end date. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByCustomerNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByCustomerNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByCustomerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the transactions by customer id for given start date and end date. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransactionInner> object + */ + public Observable> listByCustomerNextAsync(final String nextPageLink) { + return listByCustomerNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the transactions by customer id for given start date and end date. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransactionInner> object + */ + public Observable>> listByCustomerNextWithServiceResponseAsync(final String nextPageLink) { + return listByCustomerNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByCustomerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the transactions by customer id for given start date and end date. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TransactionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByCustomerNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByCustomerNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByCustomerNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByCustomerNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the transactions by billing account name for given start and end date. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TransactionInner> object if successful. + */ + public PagedList listByBillingAccountNext(final String nextPageLink) { + ServiceResponse> response = listByBillingAccountNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the transactions by billing account name for given start and end date. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByBillingAccountNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBillingAccountNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the transactions by billing account name for given start and end date. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransactionInner> object + */ + public Observable> listByBillingAccountNextAsync(final String nextPageLink) { + return listByBillingAccountNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the transactions by billing account name for given start and end date. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransactionInner> object + */ + public Observable>> listByBillingAccountNextWithServiceResponseAsync(final String nextPageLink) { + return listByBillingAccountNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByBillingAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the transactions by billing account name for given start and end date. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TransactionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBillingAccountNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByBillingAccountNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBillingAccountNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByBillingAccountNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransferBillingSubscriptionResultImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransferBillingSubscriptionResultImpl.java new file mode 100644 index 000000000000..e0ba3498ca08 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransferBillingSubscriptionResultImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.TransferBillingSubscriptionResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class TransferBillingSubscriptionResultImpl extends WrapperImpl implements TransferBillingSubscriptionResult { + private final BillingManager manager; + TransferBillingSubscriptionResultImpl(TransferBillingSubscriptionResultInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public String billingSubscriptionName() { + return this.inner().billingSubscriptionName(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransferBillingSubscriptionResultInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransferBillingSubscriptionResultInner.java new file mode 100644 index 000000000000..2966f1629c0b --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransferBillingSubscriptionResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Request parameters to transfer billing subscription. + */ +@JsonFlatten +public class TransferBillingSubscriptionResultInner { + /** + * The destination billing subscription id. + */ + @JsonProperty(value = "properties.billingSubscriptionName") + private String billingSubscriptionName; + + /** + * Get the destination billing subscription id. + * + * @return the billingSubscriptionName value + */ + public String billingSubscriptionName() { + return this.billingSubscriptionName; + } + + /** + * Set the destination billing subscription id. + * + * @param billingSubscriptionName the billingSubscriptionName value to set + * @return the TransferBillingSubscriptionResultInner object itself. + */ + public TransferBillingSubscriptionResultInner withBillingSubscriptionName(String billingSubscriptionName) { + this.billingSubscriptionName = billingSubscriptionName; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransferDetailsInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransferDetailsInner.java new file mode 100644 index 000000000000..fc0f1f4801e3 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransferDetailsInner.java @@ -0,0 +1,235 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.billing.v2019_10_01_preview.TransferStatus; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.DetailedTransferStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Details of the transfer. + */ +@JsonFlatten +public class TransferDetailsInner { + /** + * Transfer creation time. + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationTime; + + /** + * Transfer expiration time. + */ + @JsonProperty(value = "properties.expirationTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime expirationTime; + + /** + * Target invoice section Id. + */ + @JsonProperty(value = "properties.invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionId; + + /** + * Target billing account Id. + */ + @JsonProperty(value = "properties.billingAccountId", access = JsonProperty.Access.WRITE_ONLY) + private String billingAccountId; + + /** + * Reseller Id for transfer. + */ + @JsonProperty(value = "properties.resellerId", access = JsonProperty.Access.WRITE_ONLY) + private String resellerId; + + /** + * Reseller name for transfer. + */ + @JsonProperty(value = "properties.resellerName", access = JsonProperty.Access.WRITE_ONLY) + private String resellerName; + + /** + * Customer type of the initiator. + */ + @JsonProperty(value = "properties.initiatorCustomerType", access = JsonProperty.Access.WRITE_ONLY) + private String initiatorCustomerType; + + /** + * Target billing profile Id. + */ + @JsonProperty(value = "properties.billingProfileId", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileId; + + /** + * Overall transfer status. Possible values include: 'Pending', + * 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', 'Canceled', + * 'Declined'. + */ + @JsonProperty(value = "properties.transferStatus", access = JsonProperty.Access.WRITE_ONLY) + private TransferStatus transferStatus; + + /** + * Email Id of recipient of transfer. + */ + @JsonProperty(value = "properties.recipientEmailId", access = JsonProperty.Access.WRITE_ONLY) + private String recipientEmailId; + + /** + * Email Id of initiator of transfer. + */ + @JsonProperty(value = "properties.initiatorEmailId", access = JsonProperty.Access.WRITE_ONLY) + private String initiatorEmailId; + + /** + * Email Id who user canceled the transfer. + */ + @JsonProperty(value = "properties.canceledBy", access = JsonProperty.Access.WRITE_ONLY) + private String canceledBy; + + /** + * Transfer last modification time. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * Detailed transfer status. + */ + @JsonProperty(value = "properties.detailedTransferStatus", access = JsonProperty.Access.WRITE_ONLY) + private List detailedTransferStatus; + + /** + * Get transfer creation time. + * + * @return the creationTime value + */ + public DateTime creationTime() { + return this.creationTime; + } + + /** + * Get transfer expiration time. + * + * @return the expirationTime value + */ + public DateTime expirationTime() { + return this.expirationTime; + } + + /** + * Get target invoice section Id. + * + * @return the invoiceSectionId value + */ + public String invoiceSectionId() { + return this.invoiceSectionId; + } + + /** + * Get target billing account Id. + * + * @return the billingAccountId value + */ + public String billingAccountId() { + return this.billingAccountId; + } + + /** + * Get reseller Id for transfer. + * + * @return the resellerId value + */ + public String resellerId() { + return this.resellerId; + } + + /** + * Get reseller name for transfer. + * + * @return the resellerName value + */ + public String resellerName() { + return this.resellerName; + } + + /** + * Get customer type of the initiator. + * + * @return the initiatorCustomerType value + */ + public String initiatorCustomerType() { + return this.initiatorCustomerType; + } + + /** + * Get target billing profile Id. + * + * @return the billingProfileId value + */ + public String billingProfileId() { + return this.billingProfileId; + } + + /** + * Get overall transfer status. Possible values include: 'Pending', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', 'Canceled', 'Declined'. + * + * @return the transferStatus value + */ + public TransferStatus transferStatus() { + return this.transferStatus; + } + + /** + * Get email Id of recipient of transfer. + * + * @return the recipientEmailId value + */ + public String recipientEmailId() { + return this.recipientEmailId; + } + + /** + * Get email Id of initiator of transfer. + * + * @return the initiatorEmailId value + */ + public String initiatorEmailId() { + return this.initiatorEmailId; + } + + /** + * Get email Id who user canceled the transfer. + * + * @return the canceledBy value + */ + public String canceledBy() { + return this.canceledBy; + } + + /** + * Get transfer last modification time. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get detailed transfer status. + * + * @return the detailedTransferStatus value + */ + public List detailedTransferStatus() { + return this.detailedTransferStatus; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransfersImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransfersImpl.java new file mode 100644 index 000000000000..1d7fe6507bc7 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransfersImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.Transfers; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.billing.v2019_10_01_preview.InvoiceSectionBillingProfileBillingAccountTransferDetails; +import com.microsoft.azure.management.billing.v2019_10_01_preview.InitiateTransferRequest; + +class TransfersImpl extends WrapperImpl implements Transfers { + private final BillingManager manager; + + TransfersImpl(BillingManager manager) { + super(manager.inner().transfers()); + this.manager = manager; + } + + public BillingManager manager() { + return this.manager; + } + + private InvoiceSectionBillingProfileBillingAccountTransferDetailsImpl wrapModel(TransferDetailsInner inner) { + return new InvoiceSectionBillingProfileBillingAccountTransferDetailsImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String billingAccountName, final String billingProfileName, final String invoiceSectionName) { + TransfersInner client = this.inner(); + return client.listAsync(billingAccountName, billingProfileName, invoiceSectionName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public InvoiceSectionBillingProfileBillingAccountTransferDetails call(TransferDetailsInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String transferName) { + TransfersInner client = this.inner(); + return client.getAsync(billingAccountName, billingProfileName, invoiceSectionName, transferName) + .map(new Func1() { + @Override + public InvoiceSectionBillingProfileBillingAccountTransferDetails call(TransferDetailsInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable cancelAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String transferName) { + TransfersInner client = this.inner(); + return client.cancelAsync(billingAccountName, billingProfileName, invoiceSectionName, transferName).toCompletable(); + } + + @Override + public Observable initiateAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, InitiateTransferRequest parameters) { + TransfersInner client = this.inner(); + return client.initiateAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters) + .map(new Func1() { + @Override + public InvoiceSectionBillingProfileBillingAccountTransferDetails call(TransferDetailsInner inner) { + return new InvoiceSectionBillingProfileBillingAccountTransferDetailsImpl(inner, manager()); + } + }); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransfersInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransfersInner.java new file mode 100644 index 000000000000..45c12a56c5a4 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/TransfersInner.java @@ -0,0 +1,605 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ErrorResponseException; +import com.microsoft.azure.management.billing.v2019_10_01_preview.InitiateTransferRequest; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Transfers. + */ +public class TransfersInner { + /** The Retrofit service to perform REST calls. */ + private TransfersService service; + /** The service client containing this operation class. */ + private BillingManagementClientImpl client; + + /** + * Initializes an instance of TransfersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TransfersInner(Retrofit retrofit, BillingManagementClientImpl client) { + this.service = retrofit.create(TransfersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Transfers to be + * used by Retrofit to perform actually REST calls. + */ + interface TransfersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Transfers initiate" }) + @POST("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/initiateTransfer") + Observable> initiate(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Body InitiateTransferRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Transfers get" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transfers/{transferName}") + Observable> get(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Path("transferName") String transferName, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Transfers cancel" }) + @HTTP(path = "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transfers/{transferName}", method = "DELETE", hasBody = true) + Observable> cancel(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Path("transferName") String transferName, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Transfers list" }) + @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transfers") + Observable> list(@Path("billingAccountName") String billingAccountName, @Path("billingProfileName") String billingProfileName, @Path("invoiceSectionName") String invoiceSectionName, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Transfers listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Initiates the request to transfer the legacy subscriptions or RIs. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param parameters Parameters supplied to initiate the transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TransferDetailsInner object if successful. + */ + public TransferDetailsInner initiate(String billingAccountName, String billingProfileName, String invoiceSectionName, InitiateTransferRequest parameters) { + return initiateWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters).toBlocking().single().body(); + } + + /** + * Initiates the request to transfer the legacy subscriptions or RIs. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param parameters Parameters supplied to initiate the transfer. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture initiateAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, InitiateTransferRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(initiateWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters), serviceCallback); + } + + /** + * Initiates the request to transfer the legacy subscriptions or RIs. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param parameters Parameters supplied to initiate the transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransferDetailsInner object + */ + public Observable initiateAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, InitiateTransferRequest parameters) { + return initiateWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters).map(new Func1, TransferDetailsInner>() { + @Override + public TransferDetailsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Initiates the request to transfer the legacy subscriptions or RIs. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param parameters Parameters supplied to initiate the transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransferDetailsInner object + */ + public Observable> initiateWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, InitiateTransferRequest parameters) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.initiate(billingAccountName, billingProfileName, invoiceSectionName, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = initiateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse initiateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the transfer details for given transfer Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TransferDetailsInner object if successful. + */ + public TransferDetailsInner get(String billingAccountName, String billingProfileName, String invoiceSectionName, String transferName) { + return getWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, transferName).toBlocking().single().body(); + } + + /** + * Gets the transfer details for given transfer Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param transferName Transfer Name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String transferName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, transferName), serviceCallback); + } + + /** + * Gets the transfer details for given transfer Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransferDetailsInner object + */ + public Observable getAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String transferName) { + return getWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, transferName).map(new Func1, TransferDetailsInner>() { + @Override + public TransferDetailsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the transfer details for given transfer Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransferDetailsInner object + */ + public Observable> getWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String transferName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (transferName == null) { + throw new IllegalArgumentException("Parameter transferName is required and cannot be null."); + } + return service.get(billingAccountName, billingProfileName, invoiceSectionName, transferName, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Cancels the transfer for given transfer Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TransferDetailsInner object if successful. + */ + public TransferDetailsInner cancel(String billingAccountName, String billingProfileName, String invoiceSectionName, String transferName) { + return cancelWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, transferName).toBlocking().single().body(); + } + + /** + * Cancels the transfer for given transfer Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param transferName Transfer Name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture cancelAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String transferName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(cancelWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, transferName), serviceCallback); + } + + /** + * Cancels the transfer for given transfer Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransferDetailsInner object + */ + public Observable cancelAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String transferName) { + return cancelWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, transferName).map(new Func1, TransferDetailsInner>() { + @Override + public TransferDetailsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancels the transfer for given transfer Id. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param transferName Transfer Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransferDetailsInner object + */ + public Observable> cancelWithServiceResponseAsync(String billingAccountName, String billingProfileName, String invoiceSectionName, String transferName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + if (transferName == null) { + throw new IllegalArgumentException("Parameter transferName is required and cannot be null."); + } + return service.cancel(billingAccountName, billingProfileName, invoiceSectionName, transferName, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = cancelDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse cancelDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all transfer's details initiated from given invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TransferDetailsInner> object if successful. + */ + public PagedList list(final String billingAccountName, final String billingProfileName, final String invoiceSectionName) { + ServiceResponse> response = listSinglePageAsync(billingAccountName, billingProfileName, invoiceSectionName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all transfer's details initiated from given invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String billingAccountName, final String billingProfileName, final String invoiceSectionName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(billingAccountName, billingProfileName, invoiceSectionName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all transfer's details initiated from given invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransferDetailsInner> object + */ + public Observable> listAsync(final String billingAccountName, final String billingProfileName, final String invoiceSectionName) { + return listWithServiceResponseAsync(billingAccountName, billingProfileName, invoiceSectionName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all transfer's details initiated from given invoice section. + * + * @param billingAccountName billing Account Id. + * @param billingProfileName Billing Profile Id. + * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransferDetailsInner> object + */ + public Observable>> listWithServiceResponseAsync(final String billingAccountName, final String billingProfileName, final String invoiceSectionName) { + return listSinglePageAsync(billingAccountName, billingProfileName, invoiceSectionName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all transfer's details initiated from given invoice section. + * + ServiceResponse> * @param billingAccountName billing Account Id. + ServiceResponse> * @param billingProfileName Billing Profile Id. + ServiceResponse> * @param invoiceSectionName InvoiceSection Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TransferDetailsInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String billingAccountName, final String billingProfileName, final String invoiceSectionName) { + if (billingAccountName == null) { + throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); + } + if (billingProfileName == null) { + throw new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."); + } + if (invoiceSectionName == null) { + throw new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null."); + } + return service.list(billingAccountName, billingProfileName, invoiceSectionName, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all transfer's details initiated from given invoice section. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TransferDetailsInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all transfer's details initiated from given invoice section. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all transfer's details initiated from given invoice section. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransferDetailsInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all transfer's details initiated from given invoice section. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransferDetailsInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all transfer's details initiated from given invoice section. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TransferDetailsInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/UpdateAutoRenewOperationImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/UpdateAutoRenewOperationImpl.java new file mode 100644 index 000000000000..933521359f67 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/UpdateAutoRenewOperationImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.UpdateAutoRenewOperation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; + +class UpdateAutoRenewOperationImpl extends WrapperImpl implements UpdateAutoRenewOperation { + private final BillingManager manager; + UpdateAutoRenewOperationImpl(UpdateAutoRenewOperationInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public DateTime endDate() { + return this.inner().endDate(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/UpdateAutoRenewOperationInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/UpdateAutoRenewOperationInner.java new file mode 100644 index 000000000000..8ec11b2d0285 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/UpdateAutoRenewOperationInner.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Summary of cancel product operation. + */ +@JsonFlatten +public class UpdateAutoRenewOperationInner { + /** + * The end date of this asset. + */ + @JsonProperty(value = "properties.endDate") + private DateTime endDate; + + /** + * Get the end date of this asset. + * + * @return the endDate value + */ + public DateTime endDate() { + return this.endDate; + } + + /** + * Set the end date of this asset. + * + * @param endDate the endDate value to set + * @return the UpdateAutoRenewOperationInner object itself. + */ + public UpdateAutoRenewOperationInner withEndDate(DateTime endDate) { + this.endDate = endDate; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateAddressResponseImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateAddressResponseImpl.java new file mode 100644 index 000000000000..e286e36b124e --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateAddressResponseImpl.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.ValidateAddressResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.AddressValidationStatus; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.AddressDetails; + +class ValidateAddressResponseImpl extends WrapperImpl implements ValidateAddressResponse { + private final BillingManager manager; + ValidateAddressResponseImpl(ValidateAddressResponseInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public AddressValidationStatus status() { + return this.inner().status(); + } + + @Override + public List suggestedAddresses() { + return this.inner().suggestedAddresses(); + } + + @Override + public String validationMessage() { + return this.inner().validationMessage(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateAddressResponseInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateAddressResponseInner.java new file mode 100644 index 000000000000..266f26739e29 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateAddressResponseInner.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.AddressValidationStatus; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.AddressDetails; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of the address validation. + */ +public class ValidateAddressResponseInner { + /** + * status of the address validation. Possible values include: 'Valid', + * 'Invalid'. + */ + @JsonProperty(value = "status") + private AddressValidationStatus status; + + /** + * list of suggested addresses. + */ + @JsonProperty(value = "suggestedAddresses") + private List suggestedAddresses; + + /** + * Validation error message. + */ + @JsonProperty(value = "validationMessage") + private String validationMessage; + + /** + * Get status of the address validation. Possible values include: 'Valid', 'Invalid'. + * + * @return the status value + */ + public AddressValidationStatus status() { + return this.status; + } + + /** + * Set status of the address validation. Possible values include: 'Valid', 'Invalid'. + * + * @param status the status value to set + * @return the ValidateAddressResponseInner object itself. + */ + public ValidateAddressResponseInner withStatus(AddressValidationStatus status) { + this.status = status; + return this; + } + + /** + * Get list of suggested addresses. + * + * @return the suggestedAddresses value + */ + public List suggestedAddresses() { + return this.suggestedAddresses; + } + + /** + * Set list of suggested addresses. + * + * @param suggestedAddresses the suggestedAddresses value to set + * @return the ValidateAddressResponseInner object itself. + */ + public ValidateAddressResponseInner withSuggestedAddresses(List suggestedAddresses) { + this.suggestedAddresses = suggestedAddresses; + return this; + } + + /** + * Get validation error message. + * + * @return the validationMessage value + */ + public String validationMessage() { + return this.validationMessage; + } + + /** + * Set validation error message. + * + * @param validationMessage the validationMessage value to set + * @return the ValidateAddressResponseInner object itself. + */ + public ValidateAddressResponseInner withValidationMessage(String validationMessage) { + this.validationMessage = validationMessage; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateProductTransferEligibilityResultImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateProductTransferEligibilityResultImpl.java new file mode 100644 index 000000000000..2f349a06f39a --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateProductTransferEligibilityResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.ValidateProductTransferEligibilityResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ValidateProductTransferEligibilityError; + +class ValidateProductTransferEligibilityResultImpl extends WrapperImpl implements ValidateProductTransferEligibilityResult { + private final BillingManager manager; + ValidateProductTransferEligibilityResultImpl(ValidateProductTransferEligibilityResultInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public ValidateProductTransferEligibilityError errorDetails() { + return this.inner().errorDetails(); + } + + @Override + public Boolean isTransferEligible() { + return this.inner().isTransferEligible(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateProductTransferEligibilityResultInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateProductTransferEligibilityResultInner.java new file mode 100644 index 000000000000..6b0a0f2a4750 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateProductTransferEligibilityResultInner.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.ValidateProductTransferEligibilityError; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of the product transfer eligibility validation. + */ +public class ValidateProductTransferEligibilityResultInner { + /** + * Specifies whether the transfer is eligible or not. + */ + @JsonProperty(value = "isTransferEligible", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isTransferEligible; + + /** + * Validation error details. + */ + @JsonProperty(value = "errorDetails") + private ValidateProductTransferEligibilityError errorDetails; + + /** + * Get specifies whether the transfer is eligible or not. + * + * @return the isTransferEligible value + */ + public Boolean isTransferEligible() { + return this.isTransferEligible; + } + + /** + * Get validation error details. + * + * @return the errorDetails value + */ + public ValidateProductTransferEligibilityError errorDetails() { + return this.errorDetails; + } + + /** + * Set validation error details. + * + * @param errorDetails the errorDetails value to set + * @return the ValidateProductTransferEligibilityResultInner object itself. + */ + public ValidateProductTransferEligibilityResultInner withErrorDetails(ValidateProductTransferEligibilityError errorDetails) { + this.errorDetails = errorDetails; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateSubscriptionTransferEligibilityResultImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateSubscriptionTransferEligibilityResultImpl.java new file mode 100644 index 000000000000..879c544c292c --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateSubscriptionTransferEligibilityResultImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.ValidateSubscriptionTransferEligibilityResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ValidateSubscriptionTransferEligibilityError; + +class ValidateSubscriptionTransferEligibilityResultImpl extends WrapperImpl implements ValidateSubscriptionTransferEligibilityResult { + private final BillingManager manager; + ValidateSubscriptionTransferEligibilityResultImpl(ValidateSubscriptionTransferEligibilityResultInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public ValidateSubscriptionTransferEligibilityError errorDetails() { + return this.inner().errorDetails(); + } + + @Override + public Boolean isTransferEligible() { + return this.inner().isTransferEligible(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateSubscriptionTransferEligibilityResultInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateSubscriptionTransferEligibilityResultInner.java new file mode 100644 index 000000000000..005e2aba9122 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateSubscriptionTransferEligibilityResultInner.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.ValidateSubscriptionTransferEligibilityError; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of the transfer eligibility validation. + */ +public class ValidateSubscriptionTransferEligibilityResultInner { + /** + * Specifies whether the transfer is eligible or not. + */ + @JsonProperty(value = "isTransferEligible", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isTransferEligible; + + /** + * Validation error details. + */ + @JsonProperty(value = "errorDetails") + private ValidateSubscriptionTransferEligibilityError errorDetails; + + /** + * Get specifies whether the transfer is eligible or not. + * + * @return the isTransferEligible value + */ + public Boolean isTransferEligible() { + return this.isTransferEligible; + } + + /** + * Get validation error details. + * + * @return the errorDetails value + */ + public ValidateSubscriptionTransferEligibilityError errorDetails() { + return this.errorDetails; + } + + /** + * Set validation error details. + * + * @param errorDetails the errorDetails value to set + * @return the ValidateSubscriptionTransferEligibilityResultInner object itself. + */ + public ValidateSubscriptionTransferEligibilityResultInner withErrorDetails(ValidateSubscriptionTransferEligibilityError errorDetails) { + this.errorDetails = errorDetails; + return this; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateTransferListResponseImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateTransferListResponseImpl.java new file mode 100644 index 000000000000..8e7e936954b6 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateTransferListResponseImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import com.microsoft.azure.management.billing.v2019_10_01_preview.ValidateTransferListResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ValidateTransferResponse; + +class ValidateTransferListResponseImpl extends WrapperImpl implements ValidateTransferListResponse { + private final BillingManager manager; + ValidateTransferListResponseImpl(ValidateTransferListResponseInner inner, BillingManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BillingManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateTransferListResponseInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateTransferListResponseInner.java new file mode 100644 index 000000000000..69db46979c09 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/ValidateTransferListResponseInner.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.billing.v2019_10_01_preview.ValidateTransferResponse; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of transfer validation. + */ +public class ValidateTransferListResponseInner { + /** + * The list of transfer validation results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the list of transfer validation results. + * + * @return the value value + */ + public List value() { + return this.value; + } + +} diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/package-info.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/package-info.java new file mode 100644 index 000000000000..397658ef927a --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for BillingManagementClient. + * Billing client provides access to billing resources for Azure subscriptions. + */ +package com.microsoft.azure.management.billing.v2019_10_01_preview.implementation; diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/package-info.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/package-info.java new file mode 100644 index 000000000000..62b83a45f744 --- /dev/null +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for BillingManagementClient. + * Billing client provides access to billing resources for Azure subscriptions. + */ +package com.microsoft.azure.management.billing.v2019_10_01_preview; diff --git a/eng/.docsettings.yml b/eng/.docsettings.yml index 3ae4c9aa409d..4fb91b2a5c7e 100644 --- a/eng/.docsettings.yml +++ b/eng/.docsettings.yml @@ -75,6 +75,9 @@ known_content_issues: - ['sdk/cosmos/changelog/README.md', '#3113'] - ['sdk/cosmos/microsoft-azure-cosmos-benchmark/README.md', '#3113'] - ['sdk/cosmos/README.md', '#3113'] + - ['sdk/storage/azure-storage-blob/swagger/README.md', '#3113'] + - ['sdk/storage/azure-storage-queue/swagger/README.md', '#3113'] + - ['sdk/storage/azure-storage-file/swagger/README.md', '#3113'] package_indexing_exclusion_list: - azure-loganalytics-sample - azure-applicationinsights-query-sample diff --git a/eng/code-quality-reports/src/main/java/com/azure/tools/checkstyle/checks/OnlyFinalFieldsForImmutableClassCheck.java b/eng/code-quality-reports/src/main/java/com/azure/tools/checkstyle/checks/OnlyFinalFieldsForImmutableClassCheck.java index 85252a28a214..916c7533859f 100644 --- a/eng/code-quality-reports/src/main/java/com/azure/tools/checkstyle/checks/OnlyFinalFieldsForImmutableClassCheck.java +++ b/eng/code-quality-reports/src/main/java/com/azure/tools/checkstyle/checks/OnlyFinalFieldsForImmutableClassCheck.java @@ -1,5 +1,5 @@ -// Licensed under the MIT License. // Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.azure.tools.checkstyle.checks; @@ -19,8 +19,8 @@ */ public class OnlyFinalFieldsForImmutableClassCheck extends AbstractCheck { private static final String IMMUTABLE_NOTATION = "Immutable"; - private static final String ERROR_MSG = "The variable field ''%s'' should be final." + - "Classes annotated with @Immutable are supposed to be immutable."; + private static final String ERROR_MSG = "The variable field ''%s'' should be final." + + "Classes annotated with @Immutable are supposed to be immutable."; private boolean hasImmutableAnnotation; diff --git a/eng/code-quality-reports/src/main/java/com/azure/tools/checkstyle/checks/ServiceClientBuilderCheck.java b/eng/code-quality-reports/src/main/java/com/azure/tools/checkstyle/checks/ServiceClientBuilderCheck.java index 8623828a9c63..417643ccc4f8 100644 --- a/eng/code-quality-reports/src/main/java/com/azure/tools/checkstyle/checks/ServiceClientBuilderCheck.java +++ b/eng/code-quality-reports/src/main/java/com/azure/tools/checkstyle/checks/ServiceClientBuilderCheck.java @@ -90,7 +90,7 @@ public void visitToken(DetailAST token) { // method name has prefix 'build' but not 'build*Client' or 'build*AsyncClient' if (!methodName.endsWith("Client")) { log(token, String.format( - "@ServiceClientBuilder class should not have a method name, ''%s'' starting with ''build'' but not ending with ''Client''." , methodName)); + "@ServiceClientBuilder class should not have a method name, ''%s'' starting with ''build'' but not ending with ''Client''.", methodName)); } break; default: diff --git a/eng/code-quality-reports/src/main/java/com/azure/tools/checkstyle/checks/Utils.java b/eng/code-quality-reports/src/main/java/com/azure/tools/checkstyle/checks/Utils.java index 5cc32d5249c2..11ff09b1b760 100644 --- a/eng/code-quality-reports/src/main/java/com/azure/tools/checkstyle/checks/Utils.java +++ b/eng/code-quality-reports/src/main/java/com/azure/tools/checkstyle/checks/Utils.java @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + package com.azure.tools.checkstyle.checks; import com.puppycrawl.tools.checkstyle.api.DetailAST; @@ -39,7 +42,7 @@ protected static boolean hasIllegalCombination(DetailAST modifiers) { Optional illegalCombination = TokenUtil.findFirstTokenByPredicate(modifiers, (node) -> { final int type = node.getType(); return INVALID_FINAL_COMBINATION.contains(node.getType()) || (TokenTypes.ANNOTATION == type - && INVALID_FINAL_ANNOTATIONS.contains(node.findFirstToken(TokenTypes.IDENT).getText())); + && INVALID_FINAL_ANNOTATIONS.contains(node.findFirstToken(TokenTypes.IDENT).getText())); }); return illegalCombination.isPresent(); diff --git a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml index 553c34ca080f..916cd16a7796 100755 --- a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml +++ b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml @@ -112,6 +112,9 @@ + + + diff --git a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml index 6cfdbbd51923..bf64bafa0c43 100755 --- a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml +++ b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml @@ -65,6 +65,8 @@ + + diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml index 06ce79cd972c..c468ebd85216 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -56,6 +56,9 @@ jobs: JavaVersion: '1.11' steps: + - checkout: self + fetchDepth: 1 + - script: | echo "##vso[build.addbuildtag]Scheduled" displayName: 'Tag scheduled builds' @@ -87,6 +90,9 @@ jobs: vmImage: 'ubuntu-16.04' steps: + - checkout: self + fetchDepth: 1 + - task: UsePythonVersion@0 displayName: 'Use Python 3.6' inputs: @@ -222,12 +228,16 @@ jobs: vmImage: $(OSVmImage) steps: + - checkout: self + fetchDepth: 1 + - template: ../steps/verify-agent-os.yml parameters: OSName: $(OSName) - task: Maven@3 displayName: 'Start Jetty' + condition: ne(variables['SdkType'], 'client') inputs: mavenPomFile: pom.client.xml options: '$(DefaultOptions) $(ProfileFlag)' diff --git a/pom.client.xml b/pom.client.xml index ce6957bcaeed..525ed2caf70b 100644 --- a/pom.client.xml +++ b/pom.client.xml @@ -1,7 +1,7 @@ - + 4.0.0 com.azure azure-client-sdk-parent @@ -164,12 +164,13 @@ - Max + max Low true ${project.build.directory}/spotbugs spotbugs/spotbugs-exclude.xml true + false @@ -341,7 +342,6 @@ false - com.microsoft.azure.template: *.impl*: *.implementation*: com.azure.tools.checkstyle* @@ -401,6 +401,10 @@ Azure Storage - Queues com.azure.storage.queue* + + Azure Telemetry + com.azure.tracing.opentelemetry* + https://docs.oracle.com/javase/8/docs/api/ @@ -438,12 +442,13 @@ - Max + max Low true ${project.build.directory}/spotbugs spotbugs/spotbugs-exclude.xml true + false @@ -511,12 +516,13 @@ spotbugs-maven-plugin ${spotbugs.maven.version} - Max + max Low true ${project.build.directory}/spotbugs eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml true + false @@ -724,12 +730,13 @@ ./eng/jacoco-test-coverage - + template-module - include-template + env.ENABLETEMPLATEDOCS + true diff --git a/pom.data.xml b/pom.data.xml index b29bea93bc9d..c4f136e43183 100644 --- a/pom.data.xml +++ b/pom.data.xml @@ -545,7 +545,7 @@ ./sdk/cosmos ./sdk/eventhubs/pom.data.xml ./sdk/keyvault/pom.data.xml - ./sdk/servicebus/azure-servicebus + ./sdk/servicebus/microsoft-azure-servicebus ./sdk/storage/microsoft-azure-storage-blob diff --git a/sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/CosmosClientBuilder.java b/sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/CosmosClientBuilder.java index c42b5c78bd42..c35c4202d6cf 100644 --- a/sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/CosmosClientBuilder.java +++ b/sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/CosmosClientBuilder.java @@ -4,7 +4,6 @@ import com.azure.data.cosmos.internal.Configs; import com.azure.data.cosmos.internal.Permission; -import com.azure.data.cosmos.sync.CosmosSyncClient; import org.apache.commons.lang3.StringUtils; import java.util.List; @@ -211,7 +210,6 @@ private void validateConfig() { "cannot build client without any one of key, resource token, permissions, token resolver, and cosmos key credential"); ifThrowIllegalArgException(cosmosKeyCredential != null && StringUtils.isEmpty(cosmosKeyCredential.key()), "cannot build client without key credential"); - } /** * Builds a cosmos sync client object with the provided properties diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubAsyncClient.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubAsyncClient.java index b071a586319d..a3a6c04861ec 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubAsyncClient.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubAsyncClient.java @@ -49,13 +49,13 @@ * the Event Hubs namespace and offers operations for sending event data, receiving events, and inspecting the connected * Event Hub. * - *

Creating an {@link EventHubAsyncClient} using Event Hubs namespace connection string

+ *

Creating an {@link EventHubAsyncClient} using an Event Hubs namespace connection string

* - * {@codesnippet com.azure.messaging.eventhubs.eventhubasyncclient.connectionString#string-string} + * {@codesnippet com.azure.messaging.eventhubs.eventhubasyncclient.instantiation#string-string} * - *

Creating an {@link EventHubAsyncClient} using Event Hub instance connection string

+ *

Creating an {@link EventHubAsyncClient} using an Event Hub instance connection string

* - * {@codesnippet com.azure.messaging.eventhubs.eventhubasyncclient.connectionstring#string} + * {@codesnippet com.azure.messaging.eventhubs.eventhubasyncclient.instantiation#string} * * @see EventHubClientBuilder * @see About Azure Event Hubs @@ -236,20 +236,22 @@ public EventHubAsyncConsumer createConsumer(String consumerGroup, String partiti * @param options The set of options to apply when creating the consumer. * @return An new {@link EventHubAsyncConsumer} that receives events from the partition with all configured {@link * EventHubConsumerOptions}. - * @throws NullPointerException If {@code eventPosition}, or {@code options} is {@code null}. - * @throws IllegalArgumentException If {@code consumerGroup} or {@code partitionId} is {@code null} or an - * empty string. + * @throws NullPointerException If {@code eventPosition}, {@code consumerGroup}, {@code partitionId}, or {@code + * options} is {@code null}. + * @throws IllegalArgumentException If {@code consumerGroup} or {@code partitionId} is an empty string. */ public EventHubAsyncConsumer createConsumer(String consumerGroup, String partitionId, EventPosition eventPosition, EventHubConsumerOptions options) { Objects.requireNonNull(eventPosition); Objects.requireNonNull(options); + Objects.requireNonNull(consumerGroup); + Objects.requireNonNull(partitionId); if (ImplUtils.isNullOrEmpty(consumerGroup)) { - throw new IllegalArgumentException("'consumerGroup' cannot be null or empty."); + throw new IllegalArgumentException("'consumerGroup' cannot be an empty string."); } if (ImplUtils.isNullOrEmpty(partitionId)) { - throw new IllegalArgumentException("'partitionId' cannot be null or empty."); + throw new IllegalArgumentException("'partitionId' cannot be an empty string."); } final EventHubConsumerOptions clonedOptions = options.clone(); @@ -268,8 +270,6 @@ public EventHubAsyncConsumer createConsumer(String consumerGroup, String partiti return connection.createSession(entityPath).cast(EventHubSession.class); }).flatMap(session -> { logger.verbose("Creating consumer for path: {}", entityPath); - - logger.verbose("Creating producer for {}", entityPath); final RetryPolicy retryPolicy = RetryUtil.getRetryPolicy(clonedOptions.retry()); return session.createConsumer(linkName, entityPath, getExpression(eventPosition), diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubAsyncProducer.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubAsyncProducer.java index e4626ddf7045..ca3eeef4db77 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubAsyncProducer.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubAsyncProducer.java @@ -90,6 +90,7 @@ * same partition because they all share the same {@link BatchOptions#partitionKey()}. *

* {@codesnippet com.azure.messaging.eventhubs.eventhubasyncproducer.send#eventDataBatch} + * * @see EventHubAsyncClient#createProducer() */ @Immutable @@ -166,10 +167,13 @@ public Mono createBatch(BatchOptions options) { /** * Sends a single event to the associated Event Hub. If the size of the single event exceeds the maximum size * allowed, an exception will be triggered and the send will fail. + *

* For more information regarding the maximum event size allowed, see * Azure Event Hubs Quotas and * Limits. + *

+ * * @param event Event to send to the service. * * @return A {@link Mono} that completes when the event is pushed to the service. @@ -183,11 +187,13 @@ public Mono send(EventData event) { /** * Sends a single event to the associated Event Hub with the send options. If the size of the single event exceeds * the maximum size allowed, an exception will be triggered and the send will fail. + * *

* For more information regarding the maximum event size allowed, see * Azure Event Hubs Quotas and * Limits. - * @param event Event to send to the service. + *

+ * @param event Event to send to the service. * @param options The set of options to consider when sending this event. * * @return A {@link Mono} that completes when the event is pushed to the service. @@ -217,7 +223,7 @@ public Mono send(Iterable events) { * Sends a set of events to the associated Event Hub using a batched approach. If the size of events exceed the * maximum size of a single batch, an exception will be triggered and the send will fail. By default, the message * size is the max amount allowed on the link. - * @param events Events to send to the service. + * @param events Events to send to the service. * @param options The set of options to consider when sending this batch. * * @return A {@link Mono} that completes when all events are pushed to the service. diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubClient.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubClient.java new file mode 100644 index 000000000000..031113295187 --- /dev/null +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubClient.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.messaging.eventhubs; + +import com.azure.core.amqp.RetryOptions; +import com.azure.core.http.rest.IterableResponse; +import com.azure.core.implementation.annotation.ReturnType; +import com.azure.core.implementation.annotation.ServiceClient; +import com.azure.core.implementation.annotation.ServiceMethod; +import com.azure.messaging.eventhubs.implementation.ConnectionOptions; +import com.azure.messaging.eventhubs.models.EventHubConsumerOptions; +import com.azure.messaging.eventhubs.models.EventHubProducerOptions; +import com.azure.messaging.eventhubs.models.EventPosition; + +import java.io.Closeable; +import java.time.Duration; +import java.util.Objects; + +/** + * The main point of interaction with Azure Event Hubs, the client offers a connection to a specific Event Hub within + * the Event Hubs namespace and offers operations for sending event data, receiving events, and inspecting the connected + * Event Hub. + * + *

+ * Creating a synchronous {@link EventHubClient} using an Event Hub instance connection string + *

+ * + * {@codesnippet com.azure.messaging.eventhubs.eventhubclient.instantiation} + * + * @see EventHubClientBuilder + * @see EventHubAsyncClient To communicate with Event Hub using an asynchronous client. + * @see About Azure Event Hubs + */ +@ServiceClient(builder = EventHubClientBuilder.class) +public class EventHubClient implements Closeable { + private final EventHubAsyncClient client; + private final RetryOptions retry; + private final EventHubProducerOptions defaultProducerOptions; + private final EventHubConsumerOptions defaultConsumerOptions; + + EventHubClient(EventHubAsyncClient client, ConnectionOptions connectionOptions) { + Objects.requireNonNull(connectionOptions); + + this.client = Objects.requireNonNull(client); + this.retry = connectionOptions.retry(); + this.defaultProducerOptions = new EventHubProducerOptions() + .retry(connectionOptions.retry()); + this.defaultConsumerOptions = new EventHubConsumerOptions() + .retry(connectionOptions.retry()) + .scheduler(connectionOptions.scheduler()); + } + + /** + * Retrieves information about an Event Hub, including the number of partitions present and their identifiers. + * + * @return The set of information for the Event Hub that this client is associated with. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventHubProperties getProperties() { + return client.getProperties().block(retry.tryTimeout()); + } + + /** + * Retrieves the identifiers for all the partitions of an Event Hub. + * + * @return The identifiers for all partitions of an Event Hub. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public IterableResponse getPartitionIds() { + return new IterableResponse<>(client.getPartitionIds()); + } + + /** + * Retrieves information about a specific partition for an Event Hub, including elements that describe the available + * events in the partition event stream. + * + * @param partitionId The unique identifier of a partition associated with the Event Hub. + * @return The information for the requested partition under the Event Hub this client is associated with. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PartitionProperties getPartitionProperties(String partitionId) { + return client.getPartitionProperties(partitionId).block(retry.tryTimeout()); + } + + /** + * Creates an Event Hub producer responsible for transmitting {@link EventData} to the Event Hub, grouped together + * in batches. Event data is automatically routed to an available partition. + * + * @return A new {@link EventHubProducer}. + */ + public EventHubProducer createProducer() { + return createProducer(defaultProducerOptions); + } + + /** + * Creates an Event Hub producer responsible for transmitting {@link EventData} to the Event Hub, grouped together + * in batches. If {@link EventHubProducerOptions#partitionId() options.partitionId()} is not {@code null}, the + * events are routed to that specific partition. Otherwise, events are automatically routed to an available + * partition. + * + * @param options The set of options to apply when creating the producer. + * @return A new {@link EventHubProducer}. + * @throws NullPointerException if {@code options} is {@code null}. + */ + public EventHubProducer createProducer(EventHubProducerOptions options) { + Objects.requireNonNull(options); + + final EventHubAsyncProducer producer = client.createProducer(options); + + final Duration tryTimeout = options.retry() != null && options.retry().tryTimeout() != null + ? options.retry().tryTimeout() + : defaultProducerOptions.retry().tryTimeout(); + + return new EventHubProducer(producer, tryTimeout); + } + + /** + * Creates an Event Hub consumer responsible for reading {@link EventData} from a specific Event Hub partition, as a + * member of the specified consumer group, and begins reading events from the {@code eventPosition}. + * + * The consumer created is non-exclusive, allowing multiple consumers from the same consumer group to be actively + * reading events from the partition. These non-exclusive consumers are sometimes referred to as "Non-epoch + * Consumers". + * + * @param consumerGroup The name of the consumer group this consumer is associated with. Events are read in the + * context of this group. The name of the consumer group that is created by default is {@link + * EventHubAsyncClient#DEFAULT_CONSUMER_GROUP_NAME "$Default"}. + * @param partitionId The identifier of the Event Hub partition. + * @param eventPosition The position within the partition where the consumer should begin reading events. + * @return A new {@link EventHubConsumer} that receives events from the partition at the given position. + * @throws NullPointerException If {@code eventPosition}, {@code consumerGroup}, {@code partitionId}, or {@code + * options} is {@code null}. + * @throws IllegalArgumentException If {@code consumerGroup} or {@code partitionId} is an empty string. + */ + public EventHubConsumer createConsumer(String consumerGroup, String partitionId, EventPosition eventPosition) { + final EventHubAsyncConsumer consumer = client.createConsumer(consumerGroup, partitionId, eventPosition); + return new EventHubConsumer(consumer, defaultConsumerOptions); + } + + /** + * Creates an Event Hub consumer responsible for reading {@link EventData} from a specific Event Hub partition, as a + * member of the configured consumer group, and begins reading events from the specified {@code eventPosition}. + * + *

+ * A consumer may be exclusive, which asserts ownership over the partition for the consumer group to ensure that + * only one consumer from that group is reading from the partition. These exclusive consumers are sometimes referred + * to as "Epoch Consumers." + * + * A consumer may also be non-exclusive, allowing multiple consumers from the same consumer group to be actively + * reading events from the partition. These non-exclusive consumers are sometimes referred to as "Non-epoch + * Consumers." + * + * Designating a consumer as exclusive may be specified in the {@code options}, by setting {@link + * EventHubConsumerOptions#ownerLevel(Long)} to a non-null value. By default, consumers are created as + * non-exclusive. + *

+ * + * @param consumerGroup The name of the consumer group this consumer is associated with. Events are read in the + * context of this group. The name of the consumer group that is created by default is {@link + * EventHubAsyncClient#DEFAULT_CONSUMER_GROUP_NAME "$Default"}. + * @param partitionId The identifier of the Event Hub partition from which events will be received. + * @param eventPosition The position within the partition where the consumer should begin reading events. + * @param options The set of options to apply when creating the consumer. + * @return An new {@link EventHubConsumer} that receives events from the partition with all configured {@link + * EventHubConsumerOptions}. + * @throws NullPointerException If {@code eventPosition}, {@code consumerGroup}, {@code partitionId}, or {@code + * options} is {@code null}. + * @throws IllegalArgumentException If {@code consumerGroup} or {@code partitionId} is an empty string. + */ + public EventHubConsumer createConsumer(String consumerGroup, String partitionId, EventPosition eventPosition, + EventHubConsumerOptions options) { + final EventHubAsyncConsumer consumer = client.createConsumer(consumerGroup, partitionId, eventPosition, options); + return new EventHubConsumer(consumer, options); + } + + /** + * {@inheritDoc} + */ + @Override + public void close() { + client.close(); + } +} diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubClientBuilder.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubClientBuilder.java index 8fd54fc4b773..cdd80c591111 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubClientBuilder.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubClientBuilder.java @@ -41,27 +41,27 @@ * #credential(String, String, TokenCredential)}, is required in order to construct an {@link EventHubAsyncClient}. *

* - *

Creating an {@link EventHubAsyncClient} using Event Hubs namespace connection string

- * - * {@codesnippet com.azure.messaging.eventhubs.eventhubasyncclient.connectionString#string-string} - * - *

Creating an {@link EventHubAsyncClient} using Event Hub instance connection string

+ *

+ * Creating an asynchronous {@link EventHubAsyncClient} using Event Hubs namespace connection string + *

* - * {@codesnippet com.azure.messaging.eventhubs.eventhubasyncclient.connectionstring#string} + * {@codesnippet com.azure.messaging.eventhubs.eventhubasyncclient.instantiation#string-string} * - *

Creating an {@link EventHubAsyncClient} using Event Hub with no retry, different timeout and new - * Scheduler

+ *

+ * Creating a synchronous {@link EventHubClient} using an Event Hub instance connection string + *

* - * {@codesnippet com.azure.messaging.eventhubs.eventhubasyncclient.retry-timeout-scheduler} + * {@codesnippet com.azure.messaging.eventhubs.eventhubclient.instantiation} * - *

Creating an {@link EventProcessor} instance using Event Hub instance connection - * string

+ *

+ * Creating an {@link EventProcessor} using Event Hub instance connection string + *

* {@codesnippet com.azure.messaging.eventhubs.eventprocessor.instantiation} * * @see EventHubAsyncClient * @see EventProcessor */ -@ServiceClientBuilder(serviceClients = {EventHubAsyncClient.class, EventProcessor.class}) +@ServiceClientBuilder(serviceClients = {EventHubAsyncClient.class, EventHubClient.class, EventProcessor.class}) public class EventHubClientBuilder { private static final String AZURE_EVENT_HUBS_CONNECTION_STRING = "AZURE_EVENT_HUBS_CONNECTION_STRING"; @@ -277,74 +277,44 @@ public EventHubClientBuilder retry(RetryOptions retryOptions) { * specified but the transport type is not {@link TransportType#AMQP_WEB_SOCKETS web sockets}. */ public EventHubAsyncClient buildAsyncClient() { - configuration = configuration == null ? ConfigurationManager.getConfiguration().clone() : configuration; - - if (credentials == null) { - final String connectionString = configuration.get(AZURE_EVENT_HUBS_CONNECTION_STRING); - - if (ImplUtils.isNullOrEmpty(connectionString)) { - throw new IllegalArgumentException("Credentials have not been set using 'EventHubClientBuilder.credentials(String)'" - + "EventHubClientBuilder.credentials(String, String, TokenCredential). And the connection string is" - + "not set in the '" + AZURE_EVENT_HUBS_CONNECTION_STRING + "' environment variable."); - } - - connectionString(connectionString); - } - - if (retryOptions == null) { - retryOptions = DEFAULT_RETRY; - } - - // If the proxy has been configured by the user but they have overridden the TransportType with something that - // is not AMQP_WEB_SOCKETS. - if (proxyConfiguration != null && proxyConfiguration.isProxyAddressConfigured() - && transport != TransportType.AMQP_WEB_SOCKETS) { - throw new IllegalArgumentException("Cannot use a proxy when TransportType is not AMQP."); - } - - if (proxyConfiguration == null) { - proxyConfiguration = getDefaultProxyConfiguration(configuration); - } - - if (scheduler == null) { - scheduler = Schedulers.elastic(); - } - + final ConnectionOptions connectionOptions = getConnectionOptions(); final ReactorProvider provider = new ReactorProvider(); final ReactorHandlerProvider handlerProvider = new ReactorHandlerProvider(provider); - final CBSAuthorizationType authorizationType = credentials instanceof EventHubSharedAccessKeyCredential - ? CBSAuthorizationType.SHARED_ACCESS_SIGNATURE - : CBSAuthorizationType.JSON_WEB_TOKEN; - final ConnectionOptions parameters = new ConnectionOptions(host, eventHubName, credentials, authorizationType, - transport, retryOptions, proxyConfiguration, scheduler); - return new EventHubAsyncClient(parameters, provider, handlerProvider); + return new EventHubAsyncClient(connectionOptions, provider, handlerProvider); } - private ProxyConfiguration getDefaultProxyConfiguration(Configuration configuration) { - ProxyAuthenticationType authentication = ProxyAuthenticationType.NONE; - if (proxyConfiguration != null) { - authentication = proxyConfiguration.authentication(); - } - - String proxyAddress = configuration.get(BaseConfigurations.HTTP_PROXY); - - if (ImplUtils.isNullOrEmpty(proxyAddress)) { - return ProxyConfiguration.SYSTEM_DEFAULTS; - } - - final String[] hostPort = proxyAddress.split(":"); - if (hostPort.length < 2) { - throw new IllegalArgumentException("HTTP_PROXY cannot be parsed into a proxy"); - } - - final String host = hostPort[0]; - final int port = Integer.parseInt(hostPort[1]); - final Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(host, port)); - final String username = configuration.get(ProxyConfiguration.PROXY_USERNAME); - final String password = configuration.get(ProxyConfiguration.PROXY_PASSWORD); + /** + * Creates a new {@link EventHubClient} based on options set on this builder. Every time {@code buildClient()} + * is invoked, a new instance of {@link EventHubClient} is created. + * + *

+ * The following options are used if ones are not specified in the builder: + * + *

    + *
  • If no configuration is specified, the {@link ConfigurationManager#getConfiguration() global configuration} + * is used to provide any shared configuration values. The configuration values read are the {@link + * BaseConfigurations#HTTP_PROXY}, {@link ProxyConfiguration#PROXY_USERNAME}, and {@link + * ProxyConfiguration#PROXY_PASSWORD}.
  • + *
  • If no retry is specified, the default retry options are used.
  • + *
  • If no proxy is specified, the builder checks the {@link ConfigurationManager#getConfiguration() global + * configuration} for a configured proxy, then it checks to see if a system proxy is configured.
  • + *
  • If no timeout is specified, a {@link ClientConstants#OPERATION_TIMEOUT timeout of one minute} is used.
  • + *
  • If no scheduler is specified, an {@link Schedulers#elastic() elastic scheduler} is used.
  • + *
+ * + * @return A new {@link EventHubClient} instance with all the configured options. + * @throws IllegalArgumentException if the credentials have not been set using either {@link + * #connectionString(String)} or {@link #credential(String, String, TokenCredential)}. Or, if a proxy is + * specified but the transport type is not {@link TransportType#AMQP_WEB_SOCKETS web sockets}. + */ + public EventHubClient buildClient() { + final ConnectionOptions connectionOptions = getConnectionOptions(); + final ReactorProvider provider = new ReactorProvider(); + final ReactorHandlerProvider handlerProvider = new ReactorHandlerProvider(provider); + final EventHubAsyncClient client = new EventHubAsyncClient(connectionOptions, provider, handlerProvider); - return new ProxyConfiguration(authentication, proxy, username, password); + return new EventHubClient(client, connectionOptions); } /** @@ -429,4 +399,72 @@ public EventProcessor buildEventProcessor() { return new EventProcessor(buildAsyncClient(), this.consumerGroupName, this.partitionProcessorFactory, initialEventPosition, partitionManager, eventHubName); } + + private ConnectionOptions getConnectionOptions() { + configuration = configuration == null ? ConfigurationManager.getConfiguration().clone() : configuration; + + if (credentials == null) { + final String connectionString = configuration.get(AZURE_EVENT_HUBS_CONNECTION_STRING); + + if (ImplUtils.isNullOrEmpty(connectionString)) { + throw new IllegalArgumentException("Credentials have not been set using 'EventHubClientBuilder.credentials(String)'" + + "EventHubClientBuilder.credentials(String, String, TokenCredential). And the connection string is" + + "not set in the '" + AZURE_EVENT_HUBS_CONNECTION_STRING + "' environment variable."); + } + + connectionString(connectionString); + } + + if (retryOptions == null) { + retryOptions = DEFAULT_RETRY; + } + + // If the proxy has been configured by the user but they have overridden the TransportType with something that + // is not AMQP_WEB_SOCKETS. + if (proxyConfiguration != null && proxyConfiguration.isProxyAddressConfigured() + && transport != TransportType.AMQP_WEB_SOCKETS) { + throw new IllegalArgumentException("Cannot use a proxy when TransportType is not AMQP."); + } + + if (proxyConfiguration == null) { + proxyConfiguration = getDefaultProxyConfiguration(configuration); + } + + if (scheduler == null) { + scheduler = Schedulers.elastic(); + } + + final CBSAuthorizationType authorizationType = credentials instanceof EventHubSharedAccessKeyCredential + ? CBSAuthorizationType.SHARED_ACCESS_SIGNATURE + : CBSAuthorizationType.JSON_WEB_TOKEN; + + return new ConnectionOptions(host, eventHubName, credentials, authorizationType, + transport, retryOptions, proxyConfiguration, scheduler); + } + + private ProxyConfiguration getDefaultProxyConfiguration(Configuration configuration) { + ProxyAuthenticationType authentication = ProxyAuthenticationType.NONE; + if (proxyConfiguration != null) { + authentication = proxyConfiguration.authentication(); + } + + String proxyAddress = configuration.get(BaseConfigurations.HTTP_PROXY); + + if (ImplUtils.isNullOrEmpty(proxyAddress)) { + return ProxyConfiguration.SYSTEM_DEFAULTS; + } + + final String[] hostPort = proxyAddress.split(":"); + if (hostPort.length < 2) { + throw new IllegalArgumentException("HTTP_PROXY cannot be parsed into a proxy"); + } + + final String host = hostPort[0]; + final int port = Integer.parseInt(hostPort[1]); + final Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(host, port)); + final String username = configuration.get(ProxyConfiguration.PROXY_USERNAME); + final String password = configuration.get(ProxyConfiguration.PROXY_PASSWORD); + + return new ProxyConfiguration(authentication, proxy, username, password); + } } diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubConsumer.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubConsumer.java new file mode 100644 index 000000000000..7650df110601 --- /dev/null +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubConsumer.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.messaging.eventhubs; + +import com.azure.core.http.rest.IterableResponse; +import com.azure.messaging.eventhubs.models.EventHubConsumerOptions; +import com.azure.messaging.eventhubs.models.EventPosition; +import reactor.core.publisher.Flux; + +import java.io.Closeable; +import java.io.IOException; +import java.time.Duration; +import java.util.Objects; + +/** + * A consumer responsible for reading {@link EventData} from a specific Event Hub partition in the context of a specific + * consumer group. + * + *
    + *
  • If {@link EventHubConsumer} is created where {@link EventHubConsumerOptions#ownerLevel()} has a + * value, then Event Hubs service will guarantee only one active consumer exists per partitionId and consumer group + * combination. This consumer is sometimes referred to as an "Epoch Consumer."
  • + *
  • Multiple consumers per partitionId and consumer group combination can be created by not setting + * {@link EventHubConsumerOptions#ownerLevel()} when creating consumers. This non-exclusive consumer is sometimes + * referred to as a "Non-Epoch Consumer."
  • + *
+ * + * @see EventHubClient#createConsumer(String, String, EventPosition) + * @see EventHubClient#createConsumer(String, String, EventPosition, EventHubConsumerOptions) + */ +public class EventHubConsumer implements Closeable { + private final EventHubAsyncConsumer consumer; + private final EventHubConsumerOptions options; + + EventHubConsumer(EventHubAsyncConsumer consumer, EventHubConsumerOptions options) { + this.consumer = Objects.requireNonNull(consumer); + this.options = Objects.requireNonNull(options); + + //TODO (conniey): Keep track of the last sequence number as each method invoked. + this.consumer.receive().windowTimeout(options.prefetchCount(), this.options.retry().tryTimeout()); + } + + /** + * Receives a batch of EventData from the Event Hub partition. + * + * @param maximumMessageCount The maximum number of messages to receive in this batch. + * @return A set of {@link EventData} that was received. The iterable contains up to {@code maximumMessageCount} + * events. + */ + public IterableResponse receive(int maximumMessageCount) { + return new IterableResponse<>(Flux.empty()); + } + + /** + * Receives a batch of EventData from the Event Hub partition + * + * @param maximumMessageCount The maximum number of messages to receive in this batch. + * @param maximumWaitTime The maximum amount of time to wait to build up the requested message count for the + * batch; if not specified, the default wait time specified when the consumer was created will be used. + * @return A set of {@link EventData} that was received. The iterable contains up to {@code maximumMessageCount} + * events. + */ + public IterableResponse receive(int maximumMessageCount, Duration maximumWaitTime) { + return new IterableResponse<>(Flux.empty()); + } + + /** + * {@inheritDoc} + */ + @Override + public void close() throws IOException { + consumer.close(); + } +} diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubProducer.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubProducer.java new file mode 100644 index 000000000000..d71484492a9f --- /dev/null +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubProducer.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.messaging.eventhubs; + +import com.azure.core.implementation.annotation.Immutable; +import com.azure.messaging.eventhubs.models.BatchOptions; +import com.azure.messaging.eventhubs.models.EventHubProducerOptions; +import com.azure.messaging.eventhubs.models.SendOptions; + +import java.io.Closeable; +import java.io.IOException; +import java.time.Duration; +import java.util.Objects; + +/** + * A producer responsible for transmitting {@link EventData} to a specific Event Hub, grouped together in batches. + * Depending on the options specified at creation, the producer may be created to allow event data to be automatically + * routed to an available partition or specific to a partition. + * + *

+ * Allowing automatic routing of partitions is recommended when: + *

    + *
  • The sending of events needs to be highly available.
  • + *
  • The event data should be evenly distributed among all available partitions.
  • + *
+ *

+ * + *

+ * If no partition is specified, the following rules are used for automatically selecting one: + *

    + *
  1. Distribute the events equally amongst all available partitions using a round-robin approach.
  2. + *
  3. If a partition becomes unavailable, the Event Hubs service will automatically detect it and forward the + * message to another available partition.
  4. + *
+ *

+ * + *

Create a producer that routes events to any partition

+ * To allow automatic routing of messages to available partition, do not specify the {@link + * EventHubProducerOptions#partitionId() partitionId} when creating the {@link EventHubProducer}. + *

+ * {@codesnippet com.azure.messaging.eventhubs.eventhubproducer.instantiation} + * + *

Create a producer that publishes events to partition "foo" with a timeout of 45 seconds.

+ *

+ * Developers can push events to a single partition by specifying the {@link EventHubProducerOptions#partitionId(String) + * partitionId} when creating an {@link EventHubProducer}. + *

+ * {@codesnippet com.azure.messaging.eventhubs.eventhubproducer.instantiation#partitionId} + * + *

Publish events to the same partition, grouped together using {@link SendOptions#partitionKey(String)}.

+ *

+ * If developers want to push similar events to end up at the same partition, but do not require them to go to a + * specific partition, they can use {@link SendOptions#partitionKey(String)}. + *

+ * In the sample below, all the "sandwiches" end up in the same partition, but it could end up in partition 0, 1, etc. + * of the available partitions. All that matters to the end user is that they are grouped together. + *

+ * {@codesnippet com.azure.messaging.eventhubs.eventhubproducer.send#publisher-sendOptions} + * + *

Publish events using an {@link EventDataBatch}.

+ *

+ * Developers can create an {@link EventDataBatch}, add the events they want into it, and publish these events together. + * When creating a {@link EventDataBatch batch}, developers can specify a set of {@link BatchOptions options} to + * configure this batch. + *

+ * In the scenario below, the developer is creating a networked video game. They want to receive telemetry about their + * users' gaming systems, but do not want to slow down the network with telemetry. So they limit the size of their + * {@link EventDataBatch batches} to be no larger than 256 bytes. The events within the batch also get hashed to the + * same partition because they all share the same {@link BatchOptions#partitionKey()}. + *

+ * {@codesnippet com.azure.messaging.eventhubs.eventhubproducer.send#eventDataBatch} + * + * @see EventHubClient#createProducer() + * @see EventHubAsyncProducer To asynchronously generate events to an Event Hub, see EventHubAsyncProducer. + */ +@Immutable +public class EventHubProducer implements Closeable { + private final EventHubAsyncProducer producer; + private final Duration tryTimeout; + + /** + * Creates a new instance of {@link EventHubProducer} that sends messages to an Azure Event Hub. + * + * @throws NullPointerException if {@code producer} or {@code tryTimeout} is null. + */ + EventHubProducer(EventHubAsyncProducer producer, Duration tryTimeout) { + this.producer = Objects.requireNonNull(producer); + this.tryTimeout = Objects.requireNonNull(tryTimeout); + } + + /** + * Creates an {@link EventDataBatch} that can fit as many events as the transport allows. + * + * @return A new {@link EventDataBatch} that can fit as many events as the transport allows. + */ + public EventDataBatch createBatch() { + return producer.createBatch().block(tryTimeout); + } + + /** + * Creates an {@link EventDataBatch} that can fit as many events as the transport allows. + * + * @param options A set of options used to configure the {@link EventDataBatch}. + * @return A new {@link EventDataBatch} that can fit as many events as the transport allows. + */ + public EventDataBatch createBatch(BatchOptions options) { + return producer.createBatch(options).block(tryTimeout); + } + + /** + * Sends a single event to the associated Event Hub. If the size of the single event exceeds the maximum size + * allowed, an exception will be triggered and the send will fail. + * + *

+ * For more information regarding the maximum event size allowed, see + * Azure Event Hubs Quotas and + * Limits. + *

+ * + * @param event Event to send to the service. + */ + public void send(EventData event) { + producer.send(event).block(); + } + + /** + * Sends a single event to the associated Event Hub with the send options. If the size of the single event exceeds + * the maximum size allowed, an exception will be triggered and the send will fail. + * + *

+ * For more information regarding the maximum event size allowed, see + * Azure Event Hubs Quotas and + * Limits. + *

+ * + * @param event Event to send to the service. + * @param options The set of options to consider when sending this event. + */ + public void send(EventData event, SendOptions options) { + producer.send(event, options).block(); + } + + /** + * Sends a set of events to the associated Event Hub using a batched approach. If the size of events exceed the + * maximum size of a single batch, an exception will be triggered and the send will fail. By default, the message + * size is the max amount allowed on the link. + * + *

+ * For more information regarding the maximum event size allowed, see + * Azure Event Hubs Quotas and + * Limits. + *

+ * + * @param events Events to send to the service. + */ + public void send(Iterable events) { + producer.send(events).block(); + } + + /** + * Sends a set of events to the associated Event Hub using a batched approach. If the size of events exceed the + * maximum size of a single batch, an exception will be triggered and the send will fail. By default, the message + * size is the max amount allowed on the link. + * + *

+ * For more information regarding the maximum event size allowed, see + * Azure Event Hubs Quotas and + * Limits. + *

+ * + * @param events Events to send to the service. + * @param options The set of options to consider when sending this batch. + */ + public void send(Iterable events, SendOptions options) { + producer.send(events, options).block(); + } + + /** + * Sends the batch to the associated Event Hub. + * + * @param batch The batch to send to the service. + * @throws NullPointerException if {@code batch} is {@code null}. + * @see EventHubProducer#createBatch() + * @see EventHubProducer#createBatch(BatchOptions) + */ + public void send(EventDataBatch batch) { + producer.send(batch).block(); + } + + /** + * {@inheritDoc} + */ + @Override + public void close() throws IOException { + producer.close(); + } +} diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/ConsumeEvent.java b/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/ConsumeEvent.java index 89f7b0f63257..2f33f372ba32 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/ConsumeEvent.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/ConsumeEvent.java @@ -51,6 +51,11 @@ public static void main(String[] args) throws InterruptedException, IOException // TimeoutException is thrown. String firstPartition = client.getPartitionIds().blockFirst(OPERATION_TIMEOUT); + // This shouldn't happen, but if we are unable to get the partitions within the timeout period. + if (firstPartition == null) { + firstPartition = "0"; + } + // Create a consumer. // The "$Default" consumer group is created by default. This value can be found by going to the Event Hub // instance you are connecting to, and selecting the "Consumer groups" page. EventPosition.latest() tells the diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubAsyncClientJavaDocCodeSamples.java b/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubAsyncClientJavaDocCodeSamples.java index 99b1b75dfa20..796a0738b6c7 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubAsyncClientJavaDocCodeSamples.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubAsyncClientJavaDocCodeSamples.java @@ -3,11 +3,6 @@ package com.azure.messaging.eventhubs; -import com.azure.core.amqp.RetryOptions; -import reactor.core.scheduler.Schedulers; - -import java.time.Duration; - /** * Contains code snippets when generating javadocs through doclets for {@link EventHubAsyncClient}. */ @@ -17,15 +12,15 @@ public class EventHubAsyncClientJavaDocCodeSamples { * Creating an {@link EventHubAsyncClient} using an Event Hubs namespace connection string with an Event Hub name. */ public void instantiation() { - // BEGIN: com.azure.messaging.eventhubs.eventhubasyncclient.connectionString#string-string + // BEGIN: com.azure.messaging.eventhubs.eventhubasyncclient.instantiation#string-string String connectionString = "Endpoint={endpoint};SharedAccessKeyName={sharedAccessKeyName};" - + "SharedAccessKey={sharedAccessKey};EntityPath={eventHubName}"; + + "SharedAccessKey={sharedAccessKey}"; String eventHubName = "my-event-hub"; EventHubAsyncClient client = new EventHubClientBuilder() .connectionString(connectionString, eventHubName) .buildAsyncClient(); - // END: com.azure.messaging.eventhubs.eventhubasyncclient.connectionString#string-string + // END: com.azure.messaging.eventhubs.eventhubasyncclient.instantiation#string-string client.close(); } @@ -34,34 +29,14 @@ public void instantiation() { * Creating an {@link EventHubAsyncClient} using a connection string specific to an Event Hub instance. */ public void instantiationInstance() { - // BEGIN: com.azure.messaging.eventhubs.eventhubasyncclient.connectionstring#string - String connectionString = "Endpoint={endpoint};SharedAccessKeyName={sharedAccessKeyName};" - + "SharedAccessKey={sharedAccessKey};EntityPath={eventHubName}"; - - EventHubAsyncClient client = new EventHubClientBuilder() - .connectionString(connectionString) - .buildAsyncClient(); - // END: com.azure.messaging.eventhubs.eventhubasyncclient.connectionstring#string - - client.close(); - } - - /** - * Demonstrates an {@link EventHubClientBuilder} using retry, timeout and a different scheduler. - */ - public void instantiationRetry() { - // BEGIN: com.azure.messaging.eventhubs.eventhubasyncclient.retry-timeout-scheduler + // BEGIN: com.azure.messaging.eventhubs.eventhubasyncclient.instantiation#string String connectionString = "Endpoint={endpoint};SharedAccessKeyName={sharedAccessKeyName};" + "SharedAccessKey={sharedAccessKey};EntityPath={eventHubName}"; - RetryOptions retryOptions = new RetryOptions() - .tryTimeout(Duration.ofSeconds(30)); EventHubAsyncClient client = new EventHubClientBuilder() .connectionString(connectionString) - .retry(retryOptions) - .scheduler(Schedulers.newElastic("dedicated-event-hub-scheduler")) .buildAsyncClient(); - // END: com.azure.messaging.eventhubs.eventhubasyncclient.retry-timeout-scheduler + // END: com.azure.messaging.eventhubs.eventhubasyncclient.instantiation#string client.close(); } diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubAsyncProducerJavaDocCodeSamples.java b/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubAsyncProducerJavaDocCodeSamples.java index 1c00ee7e23e5..f176ebb2825e 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubAsyncProducerJavaDocCodeSamples.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubAsyncProducerJavaDocCodeSamples.java @@ -22,7 +22,8 @@ public class EventHubAsyncProducerJavaDocCodeSamples { private final EventHubAsyncClient client = new EventHubClientBuilder().connectionString("fake-string").buildAsyncClient(); /** - * Code snippet demonstrating how to create an EventHubProducer that automatically routes events to any partition. + * Code snippet demonstrating how to create an {@link EventHubAsyncProducer} that automatically routes events to any + * partition. * * @throws IOException if the producer cannot be disposed. */ @@ -39,7 +40,8 @@ public void instantiate() throws IOException { } /** - * Code snippet demonstrating how to create an EventHubProducer that routes events to a single partition. + * Code snippet demonstrating how to create an {@link EventHubAsyncProducer} that routes events to a single + * partition. * * @throws IOException if the producer cannot be disposed. */ diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubClientJavaDocCodeSamples.java b/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubClientJavaDocCodeSamples.java new file mode 100644 index 000000000000..c4f947fd78c4 --- /dev/null +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubClientJavaDocCodeSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.messaging.eventhubs; + +/** + * Contains code snippets when generating javadocs through doclets for {@link EventHubClient}. + */ +public class EventHubClientJavaDocCodeSamples { + /** + * Creating an {@link EventHubClient} using a connection string specific to an Event Hub instance with different + * retry options. + */ + public void instantiation() { + // BEGIN: com.azure.messaging.eventhubs.eventhubclient.instantiation + String connectionString = "Endpoint={endpoint};SharedAccessKeyName={sharedAccessKeyName};" + + "SharedAccessKey={sharedAccessKey};EntityPath={eventHubName}"; + + EventHubClient client = new EventHubClientBuilder() + .connectionString(connectionString) + .buildClient(); + // END: com.azure.messaging.eventhubs.eventhubclient.instantiation + + client.close(); + } +} diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubProducerJavaDocCodeSamples.java b/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubProducerJavaDocCodeSamples.java new file mode 100644 index 000000000000..a525234d4bad --- /dev/null +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubProducerJavaDocCodeSamples.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.messaging.eventhubs; + +import com.azure.core.amqp.RetryOptions; +import com.azure.messaging.eventhubs.models.BatchOptions; +import com.azure.messaging.eventhubs.models.EventHubProducerOptions; +import com.azure.messaging.eventhubs.models.SendOptions; + +import java.io.IOException; +import java.time.Duration; +import java.util.Arrays; +import java.util.List; + +import static java.nio.charset.StandardCharsets.UTF_8; + +/** + * Contains code snippets when generating javadocs through doclets for {@link EventHubProducer}. + */ +public class EventHubProducerJavaDocCodeSamples { + private final EventHubClient client = new EventHubClientBuilder() + .connectionString("fake-string") + .buildClient(); + + /** + * Code snippet demonstrating how to create an {@link EventHubProducer} that automatically routes events to any + * partition. + * + * @throws IOException if the producer cannot be disposed. + */ + public void instantiate() throws IOException { + // BEGIN: com.azure.messaging.eventhubs.eventhubproducer.instantiation + EventHubClient client = new EventHubClientBuilder() + .connectionString("event-hubs-namespace-connection-string", "event-hub-name") + .buildClient(); + + EventHubProducer producer = client.createProducer(); + // END: com.azure.messaging.eventhubs.eventhubproducer.instantiation + + producer.close(); + } + + /** + * Code snippet demonstrating how to create an {@link EventHubProducer} that routes events to a single partition. + * + * @throws IOException if the producer cannot be disposed. + */ + public void instantiatePartitionProducer() throws IOException { + // BEGIN: com.azure.messaging.eventhubs.eventhubproducer.instantiation#partitionId + RetryOptions retryOptions = new RetryOptions() + .tryTimeout(Duration.ofSeconds(45)); + EventHubProducerOptions options = new EventHubProducerOptions() + .partitionId("foo") + .retry(retryOptions); + + EventHubProducer producer = client.createProducer(options); + // END: com.azure.messaging.eventhubs.eventhubproducer.instantiation#partitionId + + producer.close(); + } + + /** + * Code snippet demonstrating how to send events with a partition key. + */ + public void sendEventsSendOptions() { + // BEGIN: com.azure.messaging.eventhubs.eventhubproducer.send#publisher-sendOptions + final List events = Arrays.asList( + new EventData("sourdough".getBytes(UTF_8)), + new EventData("rye".getBytes(UTF_8)), + new EventData("wheat".getBytes(UTF_8)) + ); + + final EventHubProducer producer = client.createProducer(); + final SendOptions options = new SendOptions() + .partitionKey("bread"); + + producer.send(events, options); + // END: com.azure.messaging.eventhubs.eventhubproducer.send#publisher-sendOptions + } + + /** + * Code snippet demonstrating how to create an {@link EventDataBatch} and send it. + */ + public void sendEventDataBatch() { + final EventHubProducer producer = client.createProducer(); + + // BEGIN: com.azure.messaging.eventhubs.eventhubproducer.send#eventDataBatch + final List telemetryEvents = Arrays.asList( + new EventData("92".getBytes(UTF_8)).addProperty("telemetry", "latency"), + new EventData("98".getBytes(UTF_8)).addProperty("telemetry", "cpu-temperature"), + new EventData("120".getBytes(UTF_8)).addProperty("telemetry", "fps") + ); + + final BatchOptions options = new BatchOptions() + .partitionKey("telemetry") + .maximumSizeInBytes(256); + + EventDataBatch currentBatch = producer.createBatch(options); + + // For each telemetry event, we try to add it to the current batch. + // When the batch is full, send it then create another batch to add more events to. + for (EventData event : telemetryEvents) { + if (!currentBatch.tryAdd(event)) { + producer.send(currentBatch); + currentBatch = producer.createBatch(options); + } + } + // END: com.azure.messaging.eventhubs.eventhubproducer.send#eventDataBatch + } +} diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubAsyncClientIntegrationTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubAsyncClientIntegrationTest.java new file mode 100644 index 000000000000..c6f2c028eeea --- /dev/null +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubAsyncClientIntegrationTest.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.messaging.eventhubs; + +import com.azure.core.amqp.TransportType; +import com.azure.core.util.logging.ClientLogger; +import com.azure.messaging.eventhubs.implementation.ApiTestBase; +import com.azure.messaging.eventhubs.implementation.ConnectionOptions; +import com.azure.messaging.eventhubs.implementation.ReactorHandlerProvider; +import com.azure.messaging.eventhubs.models.EventHubConsumerOptions; +import com.azure.messaging.eventhubs.models.EventHubProducerOptions; +import com.azure.messaging.eventhubs.models.EventPosition; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TestName; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import reactor.core.Disposable; +import reactor.core.Disposables; +import reactor.core.publisher.Flux; +import reactor.test.StepVerifier; + +import java.time.Instant; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicReference; + +import static com.azure.messaging.eventhubs.EventHubAsyncClient.DEFAULT_CONSUMER_GROUP_NAME; +import static com.azure.messaging.eventhubs.TestUtils.isMatchingEvent; +import static java.nio.charset.StandardCharsets.UTF_8; + +/** + * Tests scenarios on {@link EventHubAsyncClient}. + */ +@RunWith(Parameterized.class) +public class EventHubAsyncClientIntegrationTest extends ApiTestBase { + private static final int NUMBER_OF_EVENTS = 5; + + @Parameterized.Parameters(name = "{index}: transportType={0}") + public static Iterable getTransportTypes() { + return Arrays.asList(TransportType.AMQP, TransportType.AMQP_WEB_SOCKETS); + } + + private static final String PARTITION_ID = "1"; + private static final AtomicBoolean HAS_PUSHED_EVENTS = new AtomicBoolean(); + private static final AtomicReference MESSAGES_PUSHED_INSTANT = new AtomicReference<>(); + private static final String MESSAGE_TRACKING_VALUE = UUID.randomUUID().toString(); + + private EventHubAsyncClient client; + + @Rule + public TestName testName = new TestName(); + + public EventHubAsyncClientIntegrationTest(TransportType transportType) { + super(new ClientLogger(EventHubAsyncClientIntegrationTest.class)); + + setTransportType(transportType); + } + + @Override + protected String testName() { + return testName.getMethodName(); + } + + @Override + protected void beforeTest() { + skipIfNotRecordMode(); + + final ReactorHandlerProvider handlerProvider = new ReactorHandlerProvider(getReactorProvider()); + final ConnectionOptions connectionOptions = getConnectionOptions(); + + client = new EventHubAsyncClient(connectionOptions, getReactorProvider(), handlerProvider); + + setupEventTestData(client); + } + + @Override + protected void afterTest() { + dispose(client); + } + + @Test(expected = NullPointerException.class) + public void nullConstructor() throws NullPointerException { + new EventHubAsyncClient(null, null, null); + } + + /** + * Verifies that we can receive messages, and that the receiver continues to fetch messages when the prefetch queue + * is exhausted. + */ + @Test + public void receiveMessage() { + // Arrange + final EventHubConsumerOptions options = new EventHubConsumerOptions() + .prefetchCount(2); + final EventHubAsyncConsumer consumer = client.createConsumer(DEFAULT_CONSUMER_GROUP_NAME, PARTITION_ID, + EventPosition.fromEnqueuedTime(MESSAGES_PUSHED_INSTANT.get()), options); + + // Act & Assert + StepVerifier.create(consumer.receive().filter(x -> isMatchingEvent(x, MESSAGE_TRACKING_VALUE)).take(NUMBER_OF_EVENTS)) + .expectNextCount(NUMBER_OF_EVENTS) + .verifyComplete(); + } + + /** + * Verifies that we can have multiple consumers listening to the same partition + consumer group at the same time. + */ + @Ignore("Investigate. Only 2 of the 4 consumers get the events. The other two consumers do not.") + @Test + public void parallelEventHubClients() throws InterruptedException { + skipIfNotRecordMode(); + + // Arrange + final int numberOfClients = 4; + final int numberOfEvents = 10; + final String messageTrackingId = "message-tracking-id"; + final String messageTrackingValue = UUID.randomUUID().toString(); + final Flux events = Flux.range(0, numberOfEvents).map(number -> { + final EventData eventData = new EventData("testString".getBytes(UTF_8)); + eventData.addProperty(messageTrackingId, messageTrackingValue); + return eventData; + }); + + final CountDownLatch countDownLatch = new CountDownLatch(numberOfClients); + final EventHubAsyncClient[] clients = new EventHubAsyncClient[numberOfClients]; + for (int i = 0; i < numberOfClients; i++) { + clients[i] = new EventHubAsyncClient(getConnectionOptions(), getReactorProvider(), new ReactorHandlerProvider(getReactorProvider())); + } + + final EventHubAsyncProducer producer = clients[0].createProducer(new EventHubProducerOptions().partitionId(PARTITION_ID)); + final List consumers = new ArrayList<>(); + final Disposable.Composite subscriptions = Disposables.composite(); + + try { + for (final EventHubAsyncClient hubClient : clients) { + final EventHubAsyncConsumer consumer = hubClient.createConsumer(DEFAULT_CONSUMER_GROUP_NAME, PARTITION_ID, EventPosition.latest()); + consumers.add(consumer); + + final Disposable subscription = consumer.receive().filter(event -> { + return event.properties() != null + && event.properties().containsKey(messageTrackingId) + && messageTrackingValue.equals(event.properties().get(messageTrackingId)); + }).take(numberOfEvents).subscribe(event -> { + logger.info("Event[{}] matched.", event.sequenceNumber()); + }, error -> Assert.fail("An error should not have occurred:" + error.toString()), () -> { + long count = countDownLatch.getCount(); + logger.info("Finished consuming events. Counting down: {}", count); + countDownLatch.countDown(); + }); + + subscriptions.add(subscription); + } + + // Act + producer.send(events).block(TIMEOUT); + + // Assert + // Wait for all the events we sent to be received by each of the consumers. + countDownLatch.await(TIMEOUT.getSeconds(), TimeUnit.SECONDS); + Assert.assertEquals(0, countDownLatch.getCount()); + + logger.info("Completed successfully."); + } finally { + logger.info("Disposing of subscriptions, consumers and clients."); + subscriptions.dispose(); + + dispose(producer); + dispose(consumers.toArray(new EventHubAsyncConsumer[0])); + dispose(clients); + } + } + + /** + * When we run this test, we check if there have been events already pushed to the partition, if not, we push some + * events there. + */ + private void setupEventTestData(EventHubAsyncClient client) { + if (HAS_PUSHED_EVENTS.getAndSet(true)) { + logger.info("Already pushed events to partition. Skipping."); + return; + } + + logger.info("Pushing events to partition. Message tracking value: {}", MESSAGE_TRACKING_VALUE); + + final EventHubProducerOptions producerOptions = new EventHubProducerOptions().partitionId(PARTITION_ID); + final EventHubAsyncProducer producer = client.createProducer(producerOptions); + final Flux events = TestUtils.getEvents(NUMBER_OF_EVENTS, MESSAGE_TRACKING_VALUE); + + try { + MESSAGES_PUSHED_INSTANT.set(Instant.now()); + producer.send(events).block(TIMEOUT); + } finally { + dispose(producer); + } + } +} diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubAsyncProducerIntegrationTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubAsyncProducerIntegrationTest.java index 11b676fdffa5..1741a14c08c7 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubAsyncProducerIntegrationTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubAsyncProducerIntegrationTest.java @@ -3,15 +3,10 @@ package com.azure.messaging.eventhubs; -import com.azure.core.amqp.TransportType; import com.azure.core.util.logging.ClientLogger; import com.azure.messaging.eventhubs.implementation.ApiTestBase; -import com.azure.messaging.eventhubs.implementation.ConnectionOptions; -import com.azure.messaging.eventhubs.implementation.ConnectionStringProperties; -import com.azure.messaging.eventhubs.implementation.ReactorHandlerProvider; import com.azure.messaging.eventhubs.models.BatchOptions; import com.azure.messaging.eventhubs.models.EventHubProducerOptions; -import com.azure.messaging.eventhubs.models.ProxyConfiguration; import org.junit.Assert; import org.junit.Rule; import org.junit.Test; @@ -45,13 +40,13 @@ protected String testName() { @Override protected void beforeTest() { - final ReactorHandlerProvider handlerProvider = new ReactorHandlerProvider(getReactorProvider()); - final ConnectionStringProperties properties = new ConnectionStringProperties(getConnectionString()); - final ConnectionOptions connectionOptions = new ConnectionOptions(properties.endpoint().getHost(), - properties.eventHubName(), getTokenCredential(), getAuthorizationType(), TransportType.AMQP, RETRY_OPTIONS, - ProxyConfiguration.SYSTEM_DEFAULTS, Schedulers.parallel()); + skipIfNotRecordMode(); - client = new EventHubAsyncClient(connectionOptions, getReactorProvider(), handlerProvider); + client = new EventHubClientBuilder() + .connectionString(getConnectionString()) + .retry(RETRY_OPTIONS) + .scheduler(Schedulers.parallel()) + .buildAsyncClient(); } @Override @@ -64,8 +59,6 @@ protected void afterTest() { */ @Test public void sendMessageToPartition() throws IOException { - skipIfNotRecordMode(); - // Arrange final EventHubProducerOptions producerOptions = new EventHubProducerOptions().partitionId(PARTITION_ID); final List events = Arrays.asList( @@ -86,8 +79,6 @@ public void sendMessageToPartition() throws IOException { */ @Test public void sendMessage() throws IOException { - skipIfNotRecordMode(); - // Arrange final List events = Arrays.asList( new EventData("Event 1".getBytes(UTF_8)), @@ -106,8 +97,6 @@ public void sendMessage() throws IOException { */ @Test public void sendBatch() throws IOException { - skipIfNotRecordMode(); - // Arrange final List events = Arrays.asList( new EventData("Event 1".getBytes(UTF_8)), @@ -134,8 +123,6 @@ public void sendBatch() throws IOException { */ @Test public void sendBatchWithPartitionKey() throws IOException { - skipIfNotRecordMode(); - // Arrange final List events = Arrays.asList( new EventData("Event 1".getBytes(UTF_8)), diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubAsyncProducerTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubAsyncProducerTest.java index eaf3bc89e17a..76892d08ac55 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubAsyncProducerTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubAsyncProducerTest.java @@ -68,7 +68,7 @@ public void teardown() { public void sendMultipleMessages() { // Arrange final int count = 4; - final byte[] contents = CONTENTS.getBytes(UTF_8); + final byte[] contents = TEST_CONTENTS.getBytes(UTF_8); final Flux testData = Flux.range(0, count).flatMap(number -> { final EventData data = new EventData(contents); return Flux.just(data); @@ -100,7 +100,7 @@ public void sendMultipleMessages() { @Test public void sendSingleMessage() { // Arrange - final EventData testData = new EventData(CONTENTS.getBytes(UTF_8)); + final EventData testData = new EventData(TEST_CONTENTS.getBytes(UTF_8)); when(sendLink.send(any(Message.class))).thenReturn(Mono.empty()); @@ -128,8 +128,8 @@ public void sendSingleMessage() { public void partitionProducerCannotSendWithPartitionKey() { // Arrange final Flux testData = Flux.just( - new EventData(CONTENTS.getBytes(UTF_8)), - new EventData(CONTENTS.getBytes(UTF_8))); + new EventData(TEST_CONTENTS.getBytes(UTF_8)), + new EventData(TEST_CONTENTS.getBytes(UTF_8))); when(sendLink.send(anyList())).thenReturn(Mono.empty()); @@ -163,7 +163,7 @@ public void sendTooManyMessages() { // We believe 20 events is enough for that EventDataBatch to be greater than max size. final Flux testData = Flux.range(0, 20).flatMap(number -> { - final EventData data = new EventData(CONTENTS.getBytes(UTF_8)); + final EventData data = new EventData(TEST_CONTENTS.getBytes(UTF_8)); return Flux.just(data); }); @@ -378,7 +378,7 @@ public void sendsAnEventDataBatch() { verify(link, times(2)).getLinkSize(); } - private static final String CONTENTS = "SSLorem ipsum dolor sit amet, consectetur adipiscing elit. Donec vehicula posuere lobortis. Aliquam finibus volutpat dolor, faucibus pellentesque ipsum bibendum vitae. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut sit amet urna hendrerit, dapibus justo a, sodales justo. Mauris finibus augue id pulvinar congue. Nam maximus luctus ipsum, at commodo ligula euismod ac. Phasellus vitae lacus sit amet diam porta placerat. \n" + static final String TEST_CONTENTS = "SSLorem ipsum dolor sit amet, consectetur adipiscing elit. Donec vehicula posuere lobortis. Aliquam finibus volutpat dolor, faucibus pellentesque ipsum bibendum vitae. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut sit amet urna hendrerit, dapibus justo a, sodales justo. Mauris finibus augue id pulvinar congue. Nam maximus luctus ipsum, at commodo ligula euismod ac. Phasellus vitae lacus sit amet diam porta placerat. \n" + "Ut sodales efficitur sapien ut posuere. Morbi sed tellus est. Proin eu erat purus. Proin massa nunc, condimentum id iaculis dignissim, consectetur et odio. Cras suscipit sem eu libero aliquam tincidunt. Nullam ut arcu suscipit, eleifend velit in, cursus libero. Ut eleifend facilisis odio sit amet feugiat. Phasellus at nunc sit amet elit sagittis commodo ac in nisi. Fusce vitae aliquam quam. Integer vel nibh euismod, tempus elit vitae, pharetra est. Duis vulputate enim a elementum dignissim. Morbi dictum enim id elit scelerisque, in elementum nulla pharetra. \n" + "Aenean aliquet aliquet condimentum. Proin dapibus dui id libero tempus feugiat. Sed commodo ligula a lectus mattis, vitae tincidunt velit auctor. Fusce quis semper dui. Phasellus eu efficitur sem. Ut non sem sit amet enim condimentum venenatis id dictum massa. Nullam sagittis lacus a neque sodales, et ultrices arcu mattis. Aliquam erat volutpat. \n" + "Aenean fringilla quam elit, id mattis purus vestibulum nec. Praesent porta eros in dapibus molestie. Vestibulum orci libero, tincidunt et turpis eget, condimentum lobortis enim. Fusce suscipit ante et mauris consequat cursus nec laoreet lorem. Maecenas in sollicitudin diam, non tincidunt purus. Nunc mauris purus, laoreet eget interdum vitae, placerat a sapien. In mi risus, blandit eu facilisis nec, molestie suscipit leo. Pellentesque molestie urna vitae dui faucibus bibendum. \n" diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubClientIntegrationTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubClientIntegrationTest.java index 83eb91c70326..db8edc51cc50 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubClientIntegrationTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubClientIntegrationTest.java @@ -3,66 +3,27 @@ package com.azure.messaging.eventhubs; -import com.azure.core.amqp.TransportType; +import com.azure.core.http.rest.IterableResponse; import com.azure.core.util.logging.ClientLogger; import com.azure.messaging.eventhubs.implementation.ApiTestBase; -import com.azure.messaging.eventhubs.implementation.ConnectionOptions; -import com.azure.messaging.eventhubs.implementation.ReactorHandlerProvider; -import com.azure.messaging.eventhubs.models.EventHubConsumerOptions; -import com.azure.messaging.eventhubs.models.EventHubProducerOptions; -import com.azure.messaging.eventhubs.models.EventPosition; +import com.azure.messaging.eventhubs.implementation.ConnectionStringProperties; import org.junit.Assert; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import reactor.core.Disposable; -import reactor.core.Disposables; -import reactor.core.publisher.Flux; -import reactor.test.StepVerifier; import java.time.Instant; -import java.util.ArrayList; -import java.util.Arrays; import java.util.List; -import java.util.UUID; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicReference; - -import static com.azure.messaging.eventhubs.EventHubAsyncClient.DEFAULT_CONSUMER_GROUP_NAME; -import static com.azure.messaging.eventhubs.TestUtils.isMatchingEvent; -import static java.nio.charset.StandardCharsets.UTF_8; - -/** - * Tests scenarios on {@link EventHubAsyncClient}. - */ -@RunWith(Parameterized.class) -public class EventHubClientIntegrationTest extends ApiTestBase { - private static final int NUMBER_OF_EVENTS = 5; - - @Parameterized.Parameters(name = "{index}: transportType={0}") - public static Iterable getTransportTypes() { - return Arrays.asList(TransportType.AMQP, TransportType.AMQP_WEB_SOCKETS); - } +import java.util.stream.Collectors; - private static final String PARTITION_ID = "1"; - private static final AtomicBoolean HAS_PUSHED_EVENTS = new AtomicBoolean(); - private static final AtomicReference MESSAGES_PUSHED_INSTANT = new AtomicReference<>(); - private static final String MESSAGE_TRACKING_VALUE = UUID.randomUUID().toString(); - - private EventHubAsyncClient client; +public class EventHubClientIntegrationTest extends ApiTestBase { + private EventHubClient client; @Rule public TestName testName = new TestName(); - public EventHubClientIntegrationTest(TransportType transportType) { + public EventHubClientIntegrationTest() { super(new ClientLogger(EventHubClientIntegrationTest.class)); - - setTransportType(transportType); } @Override @@ -74,12 +35,10 @@ protected String testName() { protected void beforeTest() { skipIfNotRecordMode(); - final ReactorHandlerProvider handlerProvider = new ReactorHandlerProvider(getReactorProvider()); - final ConnectionOptions connectionOptions = getConnectionOptions(); - - client = new EventHubAsyncClient(connectionOptions, getReactorProvider(), handlerProvider); - - setupEventTestData(client); + client = new EventHubClientBuilder() + .connectionString(getConnectionString()) + .retry(RETRY_OPTIONS) + .buildClient(); } @Override @@ -87,118 +46,58 @@ protected void afterTest() { dispose(client); } - @Test(expected = NullPointerException.class) - public void nullConstructor() throws NullPointerException { - new EventHubAsyncClient(null, null, null); - } - /** - * Verifies that we can receive messages, and that the receiver continues to fetch messages when the prefetch queue - * is exhausted. + * Verifies we can get partition ids of an Event Hub. */ @Test - public void receiveMessage() { - // Arrange - final EventHubConsumerOptions options = new EventHubConsumerOptions() - .prefetchCount(2); - final EventHubAsyncConsumer consumer = client.createConsumer(DEFAULT_CONSUMER_GROUP_NAME, PARTITION_ID, - EventPosition.fromEnqueuedTime(MESSAGES_PUSHED_INSTANT.get()), options); - - // Act & Assert - StepVerifier.create(consumer.receive().filter(x -> isMatchingEvent(x, MESSAGE_TRACKING_VALUE)).take(NUMBER_OF_EVENTS)) - .expectNextCount(NUMBER_OF_EVENTS) - .verifyComplete(); + public void getPartitionIds() { + // Act + final IterableResponse response = client.getPartitionIds(); + + // Assert + Assert.assertNotNull(response); + + final List partitionIds = response.stream().collect(Collectors.toList()); + Assert.assertTrue(partitionIds.size() > 1); } /** - * Verifies that we can have multiple consumers listening to the same partition + consumer group at the same time. + * Verifies we can get partition ids of an Event Hub. */ - @Ignore("Investigate. Only 2 of the 4 consumers get the events. The other two consumers do not.") @Test - public void parallelEventHubClients() throws InterruptedException { - skipIfNotRecordMode(); - + public void getMetadata() { // Arrange - final int numberOfClients = 4; - final int numberOfEvents = 10; - final String messageTrackingId = "message-tracking-id"; - final String messageTrackingValue = UUID.randomUUID().toString(); - final Flux events = Flux.range(0, numberOfEvents).map(number -> { - final EventData eventData = new EventData("testString".getBytes(UTF_8)); - eventData.addProperty(messageTrackingId, messageTrackingValue); - return eventData; - }); - - final CountDownLatch countDownLatch = new CountDownLatch(numberOfClients); - final EventHubAsyncClient[] clients = new EventHubAsyncClient[numberOfClients]; - for (int i = 0; i < numberOfClients; i++) { - clients[i] = new EventHubAsyncClient(getConnectionOptions(), getReactorProvider(), new ReactorHandlerProvider(getReactorProvider())); - } - - final EventHubAsyncProducer producer = clients[0].createProducer(new EventHubProducerOptions().partitionId(PARTITION_ID)); - final List consumers = new ArrayList<>(); - final Disposable.Composite subscriptions = Disposables.composite(); - - try { - for (final EventHubAsyncClient hubClient : clients) { - final EventHubAsyncConsumer consumer = hubClient.createConsumer(DEFAULT_CONSUMER_GROUP_NAME, PARTITION_ID, EventPosition.latest()); - consumers.add(consumer); - - final Disposable subscription = consumer.receive().filter(event -> { - return event.properties() != null - && event.properties().containsKey(messageTrackingId) - && messageTrackingValue.equals(event.properties().get(messageTrackingId)); - }).take(numberOfEvents).subscribe(event -> { - logger.info("Event[{}] matched.", event.sequenceNumber()); - }, error -> Assert.fail("An error should not have occurred:" + error.toString()), () -> { - long count = countDownLatch.getCount(); - logger.info("Finished consuming events. Counting down: {}", count); - countDownLatch.countDown(); - }); - - subscriptions.add(subscription); - } - - // Act - producer.send(events).block(TIMEOUT); - - // Assert - // Wait for all the events we sent to be received by each of the consumers. - countDownLatch.await(TIMEOUT.getSeconds(), TimeUnit.SECONDS); - Assert.assertEquals(0, countDownLatch.getCount()); - - logger.info("Completed successfully."); - } finally { - logger.info("Disposing of subscriptions, consumers and clients."); - subscriptions.dispose(); - - dispose(producer); - dispose(consumers.toArray(new EventHubAsyncConsumer[0])); - dispose(clients); - } + final ConnectionStringProperties connectionProperties = getConnectionStringProperties(); + + // Act + final EventHubProperties properties = client.getProperties(); + + // Assert + Assert.assertNotNull(properties); + Assert.assertEquals(connectionProperties.eventHubName(), properties.name()); + Assert.assertTrue(properties.createdAt().isBefore(Instant.now())); + + Assert.assertNotNull(properties.partitionIds()); + Assert.assertTrue(properties.partitionIds().length > 1); } /** - * When we run this test, we check if there have been events already pushed to the partition, if not, we push some - * events there. + * Verifies we can get partition ids of an Event Hub. */ - private void setupEventTestData(EventHubAsyncClient client) { - if (HAS_PUSHED_EVENTS.getAndSet(true)) { - logger.info("Already pushed events to partition. Skipping."); - return; - } - - logger.info("Pushing events to partition. Message tracking value: {}", MESSAGE_TRACKING_VALUE); - - final EventHubProducerOptions producerOptions = new EventHubProducerOptions().partitionId(PARTITION_ID); - final EventHubAsyncProducer producer = client.createProducer(producerOptions); - final Flux events = TestUtils.getEvents(NUMBER_OF_EVENTS, MESSAGE_TRACKING_VALUE); - - try { - MESSAGES_PUSHED_INSTANT.set(Instant.now()); - producer.send(events).block(TIMEOUT); - } finally { - dispose(producer); - } + @Test + public void getPartitionProperties() { + // Arrange + final ConnectionStringProperties connectionProperties = getConnectionStringProperties(); + final EventHubProperties properties = client.getProperties(); + final String partitionId = properties.partitionIds()[0]; + + // Act + final PartitionProperties partitionProperties = client.getPartitionProperties(partitionId); + + // Assert + Assert.assertNotNull(partitionProperties); + + Assert.assertEquals(connectionProperties.eventHubName(), partitionProperties.eventHubName()); + Assert.assertEquals(partitionId, partitionProperties.id()); } } diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerIntegrationTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerIntegrationTest.java new file mode 100644 index 000000000000..524d7981611e --- /dev/null +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerIntegrationTest.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.messaging.eventhubs; + +import com.azure.core.util.logging.ClientLogger; +import com.azure.messaging.eventhubs.implementation.ApiTestBase; +import com.azure.messaging.eventhubs.models.BatchOptions; +import com.azure.messaging.eventhubs.models.EventHubProducerOptions; +import org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TestName; +import reactor.core.scheduler.Schedulers; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; + +import static java.nio.charset.StandardCharsets.UTF_8; + +public class EventHubProducerIntegrationTest extends ApiTestBase { + private static final String PARTITION_ID = "1"; + private EventHubClient client; + + public EventHubProducerIntegrationTest() { + super(new ClientLogger(EventHubProducerIntegrationTest.class)); + } + + @Rule + public TestName testName = new TestName(); + + @Override + protected String testName() { + return testName.getMethodName(); + } + + @Override + protected void beforeTest() { + skipIfNotRecordMode(); + + client = new EventHubClientBuilder() + .connectionString(getConnectionString()) + .retry(RETRY_OPTIONS) + .scheduler(Schedulers.parallel()) + .buildClient(); + } + + @Override + protected void afterTest() { + dispose(client); + } + + /** + * Verifies that we can create and send a message to an Event Hub partition. + */ + @Test + public void sendMessageToPartition() throws IOException { + // Arrange + final EventHubProducerOptions producerOptions = new EventHubProducerOptions().partitionId(PARTITION_ID); + final List events = Arrays.asList( + new EventData("Event 1".getBytes(UTF_8)), + new EventData("Event 2".getBytes(UTF_8)), + new EventData("Event 3".getBytes(UTF_8))); + + // Act & Assert + try (EventHubProducer producer = client.createProducer(producerOptions)) { + producer.send(events); + } + } + + /** + * Verifies that we can create an {@link EventHubProducer} that does not care about partitions and lets the service + * distribute the events. + */ + @Test + public void sendMessage() throws IOException { + // Arrange + final List events = Arrays.asList( + new EventData("Event 1".getBytes(UTF_8)), + new EventData("Event 2".getBytes(UTF_8)), + new EventData("Event 3".getBytes(UTF_8))); + + // Act & Assert + try (EventHubProducer producer = client.createProducer()) { + producer.send(events); + } + } + + /** + * Verifies we can create an {@link EventDataBatch} and send it using our EventHubProducer. + */ + @Test + public void sendBatch() throws IOException { + // Arrange + final List events = Arrays.asList( + new EventData("Event 1".getBytes(UTF_8)), + new EventData("Event 2".getBytes(UTF_8)), + new EventData("Event 3".getBytes(UTF_8))); + + // Act & Assert + try (EventHubProducer producer = client.createProducer()) { + EventDataBatch batch = producer.createBatch(); + events.forEach(event -> { + Assert.assertTrue(batch.tryAdd(event)); + }); + + producer.send(batch); + } + } + + /** + * Verifies we can create an {@link EventDataBatch} with a partition key and send it using our EventHubProducer. + */ + @Test + public void sendBatchWithPartitionKey() throws IOException { + // Arrange + final List events = Arrays.asList( + new EventData("Event 1".getBytes(UTF_8)), + new EventData("Event 2".getBytes(UTF_8)), + new EventData("Event 3".getBytes(UTF_8))); + + // Act & Assert + try (EventHubProducer producer = client.createProducer()) { + final BatchOptions options = new BatchOptions().partitionKey("my-partition-key"); + final EventDataBatch batch = producer.createBatch(options); + + events.forEach(event -> { + Assert.assertTrue(batch.tryAdd(event)); + }); + + producer.send(batch); + } + } +} diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerTest.java new file mode 100644 index 000000000000..db2fae439f3b --- /dev/null +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerTest.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.messaging.eventhubs; + +import com.azure.core.amqp.RetryOptions; +import com.azure.core.amqp.exception.AmqpException; +import com.azure.core.amqp.exception.ErrorCondition; +import com.azure.core.amqp.exception.ErrorContext; +import com.azure.messaging.eventhubs.implementation.AmqpSendLink; +import com.azure.messaging.eventhubs.models.BatchOptions; +import com.azure.messaging.eventhubs.models.EventHubProducerOptions; +import com.azure.messaging.eventhubs.models.SendOptions; +import org.apache.qpid.proton.amqp.messaging.Section; +import org.apache.qpid.proton.message.Message; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import java.time.Duration; +import java.util.List; + +import static java.nio.charset.StandardCharsets.UTF_8; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyList; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +/** + * Unit tests to verify functionality of {@link EventHubProducer}. + */ +public class EventHubProducerTest { + @Mock + private AmqpSendLink sendLink; + @Captor + private ArgumentCaptor singleMessageCaptor; + @Captor + private ArgumentCaptor> messagesCaptor; + + private EventHubAsyncProducer asyncProducer; + private RetryOptions retryOptions = new RetryOptions().tryTimeout(Duration.ofSeconds(30)); + + @Before + public void setup() { + MockitoAnnotations.initMocks(this); + when(sendLink.getLinkSize()).thenReturn(Mono.just(EventHubAsyncProducer.MAX_MESSAGE_LENGTH_BYTES)); + when(sendLink.getErrorContext()).thenReturn(new ErrorContext("test-namespace")); + when(sendLink.send(anyList())).thenReturn(Mono.empty()); + when(sendLink.send(any(Message.class))).thenReturn(Mono.empty()); + + asyncProducer = new EventHubAsyncProducer( + Mono.fromCallable(() -> sendLink), + new EventHubProducerOptions().retry(retryOptions)); + } + + @After + public void teardown() { + Mockito.framework().clearInlineMocks(); + sendLink = null; + singleMessageCaptor = null; + messagesCaptor = null; + } + + /** + * Verifies can send a single message. + */ + @Test + public void sendSingleMessage() { + // Arrange + final EventHubProducer producer = new EventHubProducer(asyncProducer, retryOptions.tryTimeout()); + final EventData eventData = new EventData("hello-world".getBytes(UTF_8)); + + // Act + producer.send(eventData); + + // Assert + verify(sendLink, times(1)).send(any(Message.class)); + verify(sendLink).send(singleMessageCaptor.capture()); + + final Message message = singleMessageCaptor.getValue(); + Assert.assertEquals(Section.SectionType.Data, message.getBody().getType()); + } + + /** + * Verifies we can send multiple messages. + */ + @Test + public void sendMultipleMessages() { + // Arrange + final int count = 4; + final Iterable events = Flux.range(0, count).map(number -> { + final String contents = "event-data-" + number; + return new EventData(contents.getBytes(UTF_8)); + }).toIterable(); + + final SendOptions options = new SendOptions(); + final EventHubProducer producer = new EventHubProducer(asyncProducer, retryOptions.tryTimeout()); + + // Act + producer.send(events, options); + + // Assert + verify(sendLink).send(messagesCaptor.capture()); + + final List messagesSent = messagesCaptor.getValue(); + Assert.assertEquals(count, messagesSent.size()); + + messagesSent.forEach(message -> Assert.assertEquals(Section.SectionType.Data, message.getBody().getType())); + } + + /** + * Verifies that the producer can create an {@link EventDataBatch} with the size given by the underlying AMQP send + * link. + */ + @Test + public void createsEventDataBatch() { + // Arrange + int maxLinkSize = 1024; + + // Overhead when serializing an event, to figure out what the maximum size we can use for an event payload. + int eventOverhead = 24; + int maxEventPayload = maxLinkSize - eventOverhead; + + final AmqpSendLink link = mock(AmqpSendLink.class); + when(link.getLinkSize()).thenReturn(Mono.just(maxLinkSize)); + + // This event is 1024 bytes when serialized. + final EventData event = new EventData(new byte[maxEventPayload]); + + // This event will be 1025 bytes when serialized. + final EventData tooLargeEvent = new EventData(new byte[maxEventPayload + 1]); + + final EventHubProducerOptions producerOptions = new EventHubProducerOptions().retry(retryOptions); + final EventHubAsyncProducer hubAsyncProducer = new EventHubAsyncProducer(Mono.fromCallable(() -> link), producerOptions); + final EventHubProducer hubProducer = new EventHubProducer(hubAsyncProducer, retryOptions.tryTimeout()); + + // Act + final EventDataBatch batch = hubProducer.createBatch(); + + // Assert + Assert.assertNull(batch.getPartitionKey()); + Assert.assertFalse(batch.tryAdd(tooLargeEvent)); + Assert.assertTrue(batch.tryAdd(event)); + + verify(link, times(1)).getLinkSize(); + } + + /** + * Verifies we can create an EventDataBatch with partition key and link size. + */ + @Test + public void createsEventDataBatchWithPartitionKey() { + // Arrange + int maxBatchSize = 1024; + + // Overhead when serializing an event, to figure out what the maximum size we can use for an event payload. + int eventOverhead = 98; + int maxEventPayload = maxBatchSize - eventOverhead; + + // This event is 1024 bytes when serialized. + final EventData event = new EventData(new byte[maxEventPayload]); + + // No idea what the overhead for adding partition key is. But we know this will be smaller than the max size. + final BatchOptions options = new BatchOptions() + .partitionKey("some-key") + .maximumSizeInBytes(maxBatchSize); + final EventHubProducer producer = new EventHubProducer(asyncProducer, retryOptions.tryTimeout()); + + // Act + final EventDataBatch batch = producer.createBatch(options); + + // Arrange + Assert.assertEquals(options.partitionKey(), batch.getPartitionKey()); + Assert.assertTrue(batch.tryAdd(event)); + } + + /** + * Verifies we can create an EventDataBatch with partition key and link size. + */ + @Test + public void payloadTooLarge() { + // Arrange + int maxBatchSize = 1024; + + // Overhead when serializing an event, to figure out what the maximum size we can use for an event payload. + int eventOverhead = 24; + int maxEventPayload = maxBatchSize - eventOverhead; + + // This event is 1025 bytes when serialized. + final EventData event = new EventData(new byte[maxEventPayload + 1]); + + // No idea what the overhead for adding partition key is. But we know this will be smaller than the max size. + final BatchOptions options = new BatchOptions() + .maximumSizeInBytes(maxBatchSize); + final EventHubProducer producer = new EventHubProducer(asyncProducer, retryOptions.tryTimeout()); + final EventDataBatch batch = producer.createBatch(options); + + // Act & Assert + try { + batch.tryAdd(event); + } catch (AmqpException e) { + Assert.assertEquals(ErrorCondition.LINK_PAYLOAD_SIZE_EXCEEDED, e.getErrorCondition()); + } + } +} diff --git a/sdk/eventhubs/ci.data.yml b/sdk/eventhubs/ci.data.yml new file mode 100644 index 000000000000..7ca44a5f51c8 --- /dev/null +++ b/sdk/eventhubs/ci.data.yml @@ -0,0 +1,46 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +resources: + repositories: + - repository: azure-sdk-build-tools + type: git + name: internal/azure-sdk-build-tools + +trigger: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventhubs/ + exclude: + - sdk/eventhubs/azure + +pr: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventhubs/ + exclude: + - sdk/eventhubs/azure + +stages: + - template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: eventhubs + Artifacts: + - name: azure-eventhubs + safeName: azureeventhubs + - name: azure-eventhubs-eph + safeName: azureeventhubseph + - name: azure-eventhubs-extensions + safeName: azureeventhubsextensions diff --git a/sdk/eventhubs/ci.yml b/sdk/eventhubs/ci.yml index 9ecb29dd5ea3..4b074d49cf9b 100644 --- a/sdk/eventhubs/ci.yml +++ b/sdk/eventhubs/ci.yml @@ -17,6 +17,8 @@ trigger: paths: include: - sdk/eventhubs/ + exclude: + - sdk/eventhubs/microsoft-azure pr: branches: @@ -28,6 +30,8 @@ pr: paths: include: - sdk/eventhubs/ + exclude: + - sdk/eventhubs/microsoft-azure stages: - template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml diff --git a/sdk/eventhubs/pom.service.xml b/sdk/eventhubs/pom.service.xml index f99125abb872..9c863056e145 100644 --- a/sdk/eventhubs/pom.service.xml +++ b/sdk/eventhubs/pom.service.xml @@ -1,20 +1,41 @@ - + 4.0.0 com.azure azure-eventhubs-service pom - 1.0.0 - - microsoft-azure-eventhubs - microsoft-azure-eventhubs-eph - microsoft-azure-eventhubs-extensions - ../core/azure-core - ../core/azure-core-test - ../core/azure-core-amqp - azure-messaging-eventhubs - + 1.0.0 + + + data + + + env.SDKTYPE + data + + + + microsoft-azure-eventhubs + microsoft-azure-eventhubs-eph + microsoft-azure-eventhubs-extensions + + + + client + + + env.SDKTYPE + !data + + + + ../core/azure-core + ../core/azure-core-test + ../core/azure-core-amqp + azure-messaging-eventhubs + + + diff --git a/sdk/identity/azure-identity/pom.xml b/sdk/identity/azure-identity/pom.xml index e2be2e9b861f..eb7e8bb04de5 100644 --- a/sdk/identity/azure-identity/pom.xml +++ b/sdk/identity/azure-identity/pom.xml @@ -8,6 +8,10 @@ azure-identity 1.0.0-preview.3 + Microsoft Azure client library for Identity + This module contains client library for Microsoft Azure Identity. + https://github.com/Azure/azure-sdk-for-java + com.azure azure-client-sdk-parent diff --git a/sdk/keyvault/azure-keyvault-keys/README.md b/sdk/keyvault/azure-keyvault-keys/README.md index 25205aa60b89..5ee64ed6a579 100644 --- a/sdk/keyvault/azure-keyvault-keys/README.md +++ b/sdk/keyvault/azure-keyvault-keys/README.md @@ -292,8 +292,8 @@ keyAsyncClient.getKey("keyName").subscribe(keyResponse -> { Delete an existing Key by calling `deleteKey`. ```java -keyAsyncClient.deleteKey("keyName").subscribe(deletedKey -> - System.out.printf("Deleted Key's deletion time %s \n", deletedKey.deletedDate().toString())); +keyAsyncClient.deleteKey("keyName").subscribe(deletedKeyResponse -> + System.out.printf("Deleted Key's deletion time %s \n", deletedKeyResponse.value().deletedDate().toString())); ``` ### List Keys Asynchronously diff --git a/sdk/keyvault/azure-keyvault-keys/pom.xml b/sdk/keyvault/azure-keyvault-keys/pom.xml index c1819383b7dc..7cf076074879 100644 --- a/sdk/keyvault/azure-keyvault-keys/pom.xml +++ b/sdk/keyvault/azure-keyvault-keys/pom.xml @@ -15,7 +15,8 @@ azure-keyvault-keys 4.0.0-preview.3 - azure-keyvault-keys + Microsoft Azure client library for KeyVault Keys + This module contains client library for Microsoft Azure KeyVault Keys. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/keyvault/azure-keyvault-secrets/pom.xml b/sdk/keyvault/azure-keyvault-secrets/pom.xml index 0c3cf6d4f518..3e9d333cd1b8 100644 --- a/sdk/keyvault/azure-keyvault-secrets/pom.xml +++ b/sdk/keyvault/azure-keyvault-secrets/pom.xml @@ -13,7 +13,8 @@ azure-keyvault-secrets 4.0.0-preview.3 - azure-keyvault-secrets + Microsoft Azure client library for KeyVault Secrets + This module contains client library for Microsoft Azure KeyVault Secrets. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/keyvault/microsoft-azure-keyvault-test/src/test/java/com/microsoft/azure/keyvault/test/EcKeyIntegrationTests.java b/sdk/keyvault/microsoft-azure-keyvault-test/src/test/java/com/microsoft/azure/keyvault/test/EcKeyIntegrationTests.java index f508cfa07f74..b96b62d4a7ec 100644 --- a/sdk/keyvault/microsoft-azure-keyvault-test/src/test/java/com/microsoft/azure/keyvault/test/EcKeyIntegrationTests.java +++ b/sdk/keyvault/microsoft-azure-keyvault-test/src/test/java/com/microsoft/azure/keyvault/test/EcKeyIntegrationTests.java @@ -23,6 +23,7 @@ import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; @@ -110,21 +111,25 @@ public void beforeMethod() throws Exception { } @Test + @Ignore("https://github.com/Azure/azure-sdk-for-java/issues/4993") public void testSignVerifyIntegrationES256() throws Exception { validateSignVerifyInterop(importTestKey("itwkk-p256", P256TestKey()), JsonWebKeySignatureAlgorithm.ES256, "SHA-256"); } @Test + @Ignore("https://github.com/Azure/azure-sdk-for-java/issues/4993") public void testSignVerifyIntegrationES256K() throws Exception { validateSignVerifyInterop(importTestKey("itwkk-p256k", P256KTestKey()), JsonWebKeySignatureAlgorithm.ES256K, "SHA-256"); } @Test + @Ignore("https://github.com/Azure/azure-sdk-for-java/issues/4993") public void testSignVerifyIntegrationES384() throws Exception { validateSignVerifyInterop(importTestKey("itwkk-p384", P384TestKey()), JsonWebKeySignatureAlgorithm.ES384, "SHA-384"); } @Test + @Ignore("https://github.com/Azure/azure-sdk-for-java/issues/4993") public void testSignVerifyIntegrationES521() throws Exception { validateSignVerifyInterop(importTestKey("itwkk-p521", P521TestKey()), JsonWebKeySignatureAlgorithm.ES512, "SHA-512"); } diff --git a/sdk/keyvault/pom.service.xml b/sdk/keyvault/pom.service.xml index 956a21dfe3d7..d64ee420186b 100644 --- a/sdk/keyvault/pom.service.xml +++ b/sdk/keyvault/pom.service.xml @@ -1,30 +1,46 @@ - + 4.0.0 com.azure azure-keyvault-service pom - 1.0.0 - - - - microsoft-azure-keyvault - microsoft-azure-keyvault-core - microsoft-azure-keyvault-webkey - microsoft-azure-keyvault-cryptography - microsoft-azure-keyvault-extensions - microsoft-azure-keyvault-complete - - - ../core/azure-core - ../core/azure-core-test - ../identity/azure-identity - azure-keyvault-keys - azure-keyvault-secrets - - - + 1.0.0 + + + data + + + env.SDKTYPE + data + + + + microsoft-azure-keyvault + microsoft-azure-keyvault-complete + microsoft-azure-keyvault-core + microsoft-azure-keyvault-cryptography + microsoft-azure-keyvault-extensions + microsoft-azure-keyvault-test + microsoft-azure-keyvault-webkey + + + + client + + + env.SDKTYPE + !data + + + + ../core/azure-core + ../core/azure-core-test + ../identity/azure-identity + azure-keyvault-keys + azure-keyvault-secrets + + + diff --git a/sdk/storage/azure-storage-blob/pom.xml b/sdk/storage/azure-storage-blob/pom.xml index 59e986439e6d..71afc74b13e3 100644 --- a/sdk/storage/azure-storage-blob/pom.xml +++ b/sdk/storage/azure-storage-blob/pom.xml @@ -15,7 +15,8 @@ azure-storage-blob 12.0.0-preview.3 - azure-storage-blob + Microsoft Azure client library for Blob Storage + This module contains client library for Microsoft Azure Blob Storage. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/AppendBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/AppendBlobAsyncClient.java index 9cf6c224c0d3..d2d20d34c58f 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/AppendBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/AppendBlobAsyncClient.java @@ -94,8 +94,8 @@ public Mono> create(BlobHTTPHeaders headers, Metadata m accessConditions = (accessConditions == null) ? new BlobAccessConditions() : accessConditions; return postProcessResponse(this.azureBlobStorage.appendBlobs().createWithRestResponseAsync(null, - null, 0, null, metadata, null, null, - null, null, headers, accessConditions.leaseAccessConditions(), + null, 0, null, metadata, null, null, null, + null, null, headers, accessConditions.leaseAccessConditions(), null, accessConditions.modifiedAccessConditions(), Context.NONE)) .map(rb -> new SimpleResponse<>(rb, new AppendBlobItem(rb.deserializedHeaders()))); } @@ -144,10 +144,10 @@ public Mono> appendBlock(Flux data, long lengt : appendBlobAccessConditions; return postProcessResponse(this.azureBlobStorage.appendBlobs().appendBlockWithRestResponseAsync( - null, null, data, length, null, null, + null, null, data, length, null, null, null, null, null, null, null, appendBlobAccessConditions.leaseAccessConditions(), - appendBlobAccessConditions.appendPositionAccessConditions(), + appendBlobAccessConditions.appendPositionAccessConditions(), null, appendBlobAccessConditions.modifiedAccessConditions(), Context.NONE)) .map(rb -> new SimpleResponse<>(rb, new AppendBlobItem(rb.deserializedHeaders()))); } @@ -201,7 +201,7 @@ public Mono> appendBlockFromUrl(URL sourceURL, BlobRang return postProcessResponse( this.azureBlobStorage.appendBlobs().appendBlockFromUrlWithRestResponseAsync(null, null, - sourceURL, 0, sourceRange.toString(), sourceContentMD5, null, null, + sourceURL, 0, sourceRange.toString(), sourceContentMD5, null, null, null, null, destAccessConditions.leaseAccessConditions(), destAccessConditions.appendPositionAccessConditions(), destAccessConditions.modifiedAccessConditions(), sourceAccessConditions, Context.NONE)) diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobAsyncClient.java index b4a5e38668c6..53801a50018c 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobAsyncClient.java @@ -13,6 +13,7 @@ import com.azure.storage.blob.implementation.AzureBlobStorageBuilder; import com.azure.storage.blob.implementation.AzureBlobStorageImpl; import com.azure.storage.blob.models.AccessTier; +import com.azure.storage.blob.models.AccessTierRequired; import com.azure.storage.blob.models.BlobAccessConditions; import com.azure.storage.blob.models.BlobHTTPHeaders; import com.azure.storage.blob.models.BlobRange; @@ -245,7 +246,7 @@ public Mono> startCopyFromURL(URL sourceURL, Metadata metadata, .sourceIfNoneMatch(sourceModifiedAccessConditions.ifNoneMatch()); return postProcessResponse(this.azureBlobStorage.blobs().startCopyFromURLWithRestResponseAsync( - null, null, sourceURL, null, metadata, null, sourceConditions, + null, null, sourceURL, null, metadata, null, null, null, null, sourceConditions, destAccessConditions.modifiedAccessConditions(), destAccessConditions.leaseAccessConditions(), Context.NONE)) .map(rb -> new SimpleResponse<>(rb, rb.deserializedHeaders().copyId())); } @@ -340,7 +341,7 @@ public Mono> copyFromURL(URL copySource, Metadata metadata, Mod .sourceIfNoneMatch(sourceModifiedAccessConditions.ifNoneMatch()); return postProcessResponse(this.azureBlobStorage.blobs().copyFromURLWithRestResponseAsync( - null, null, copySource, null, metadata, null, sourceConditions, + null, null, copySource, null, metadata, null, null, null, sourceConditions, destAccessConditions.modifiedAccessConditions(), destAccessConditions.leaseAccessConditions(), Context.NONE)) .map(rb -> new SimpleResponse<>(rb, rb.deserializedHeaders().copyId())); } @@ -413,7 +414,7 @@ Mono download(BlobRange range, BlobAccessConditions acces // TODO: range is BlobRange but expected as String // TODO: figure out correct response return postProcessResponse(this.azureBlobStorage.blobs().downloadWithRestResponseAsync( - null, null, snapshot, null, null, range.toHeaderValue(), getMD5, + null, null, snapshot, null, null, range.toHeaderValue(), getMD5, null, null, null, null, null, accessConditions.leaseAccessConditions(), accessConditions.modifiedAccessConditions(), Context.NONE)) // Convert the autorest response to a DownloadAsyncResponse, which enable reliable download. @@ -691,7 +692,7 @@ public Mono setMetadata(Metadata metadata, BlobAccessConditions ac return postProcessResponse(this.azureBlobStorage.blobs().setMetadataWithRestResponseAsync( null, null, null, metadata, null, null, - null, null, accessConditions.leaseAccessConditions(), + null, null, accessConditions.leaseAccessConditions(), null, accessConditions.modifiedAccessConditions(), Context.NONE)) .map(VoidResponse::new); } @@ -734,7 +735,7 @@ public Mono> createSnapshot(Metadata metadata, BlobAcc return postProcessResponse(this.azureBlobStorage.blobs().createSnapshotWithRestResponseAsync( null, null, null, metadata, null, null, - null, null, accessConditions.modifiedAccessConditions(), + null, null, null, accessConditions.modifiedAccessConditions(), accessConditions.leaseAccessConditions(), Context.NONE)) .map(rb -> new SimpleResponse<>(rb, this.getSnapshotClient(rb.deserializedHeaders().snapshot()))); } @@ -779,9 +780,10 @@ public Mono setTier(AccessTier tier) { */ public Mono setTier(AccessTier tier, LeaseAccessConditions leaseAccessConditions) { Utility.assertNotNull("tier", tier); + AccessTierRequired accessTierRequired = AccessTierRequired.fromString(tier.toString()); return postProcessResponse(this.azureBlobStorage.blobs().setTierWithRestResponseAsync( - null, null, tier, null, null, leaseAccessConditions, Context.NONE)) + null, null, accessTierRequired, null, null, null, leaseAccessConditions, Context.NONE)) .map(VoidResponse::new); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlockBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlockBlobAsyncClient.java index 162bb1917b61..91875e7a2fd5 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlockBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlockBlobAsyncClient.java @@ -152,8 +152,8 @@ public Mono> upload(Flux data, long length, Blo accessConditions = accessConditions == null ? new BlobAccessConditions() : accessConditions; return postProcessResponse(this.azureBlobStorage.blockBlobs().uploadWithRestResponseAsync(null, - null, data, length, null, metadata, null, null, - null, null, headers, accessConditions.leaseAccessConditions(), + null, data, length, null, metadata, null, null, null, + null, null, null, headers, accessConditions.leaseAccessConditions(), null, accessConditions.modifiedAccessConditions(), Context.NONE)) .map(rb -> new SimpleResponse<>(rb, new BlockBlobItem(rb.deserializedHeaders()))); } @@ -297,8 +297,8 @@ public Mono stageBlock(String base64BlockID, Flux data, public Mono stageBlock(String base64BlockID, Flux data, long length, LeaseAccessConditions leaseAccessConditions) { return postProcessResponse(this.azureBlobStorage.blockBlobs().stageBlockWithRestResponseAsync(null, - null, base64BlockID, length, data, null, null, null, - null, null, null, leaseAccessConditions, Context.NONE)) + null, base64BlockID, length, data, null, null, null, null, + null, null, null, leaseAccessConditions, null, Context.NONE)) .map(VoidResponse::new); } @@ -359,9 +359,9 @@ public Mono stageBlockFromURL(String base64BlockID, URL sourceURL, return postProcessResponse( this.azureBlobStorage.blockBlobs().stageBlockFromURLWithRestResponseAsync(null, null, - base64BlockID, 0, sourceURL, sourceRange.toHeaderValue(), sourceContentMD5, null, + base64BlockID, 0, sourceURL, sourceRange.toHeaderValue(), sourceContentMD5, null, null, null, null, null, null, - leaseAccessConditions, sourceModifiedAccessConditions, Context.NONE)) + leaseAccessConditions, null, sourceModifiedAccessConditions, Context.NONE)) .map(VoidResponse::new); } @@ -456,9 +456,9 @@ public Mono> commitBlockList(List base64BlockIDs accessConditions = accessConditions == null ? new BlobAccessConditions() : accessConditions; return postProcessResponse(this.azureBlobStorage.blockBlobs().commitBlockListWithRestResponseAsync( - null, null, new BlockLookupList().latest(base64BlockIDs), null, metadata, - null, null, null, null, headers, - accessConditions.leaseAccessConditions(), accessConditions.modifiedAccessConditions(), Context.NONE)) + null, null, new BlockLookupList().latest(base64BlockIDs), null, null, null, metadata, null, + null, null, null, null, null, headers, + accessConditions.leaseAccessConditions(), null, accessConditions.modifiedAccessConditions(), Context.NONE)) .map(rb -> new SimpleResponse<>(rb, new BlockBlobItem(rb.deserializedHeaders()))); } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/ContainerAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/ContainerAsyncClient.java index 99b1524507bf..a741b2c7dba2 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/ContainerAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/ContainerAsyncClient.java @@ -278,7 +278,7 @@ public Mono create(Metadata metadata, PublicAccessType accessType) metadata = metadata == null ? new Metadata() : metadata; return postProcessResponse(this.azureBlobStorage.containers().createWithRestResponseAsync( - null, null, metadata, accessType, null, Context.NONE)) + null, null, metadata, accessType, null, null, null, Context.NONE)) .map(VoidResponse::new); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/PageBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/PageBlobAsyncClient.java index 944bb4ef8ff6..57a98ebc22d1 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/PageBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/PageBlobAsyncClient.java @@ -127,8 +127,8 @@ public Mono> create(long size, Long sequenceNumber, BlobH metadata = metadata == null ? new Metadata() : metadata; return postProcessResponse(this.azureBlobStorage.pageBlobs().createWithRestResponseAsync(null, - null, 0, size, null, metadata, null, null, - null, sequenceNumber, null, headers, accessConditions.leaseAccessConditions(), + null, 0, size, null, metadata, null, null, null, + null, sequenceNumber, null, headers, accessConditions.leaseAccessConditions(), null, accessConditions.modifiedAccessConditions(), Context.NONE)) .map(rb -> new SimpleResponse<>(rb, new PageBlobItem(rb.deserializedHeaders()))); } @@ -189,9 +189,9 @@ public Mono> uploadPages(PageRange pageRange, Flux new SimpleResponse<>(rb, new PageBlobItem(rb.deserializedHeaders()))); } @@ -272,7 +272,7 @@ public Mono> uploadPagesFromURL(PageRange range, URL sour destAccessConditions = destAccessConditions == null ? new PageBlobAccessConditions() : destAccessConditions; return postProcessResponse(this.azureBlobStorage.pageBlobs().uploadPagesFromURLWithRestResponseAsync( - null, null, sourceURL, sourceRangeString, 0, rangeString, sourceContentMD5, + null, null, sourceURL, sourceRangeString, 0, rangeString, sourceContentMD5, null, null, null, destAccessConditions.leaseAccessConditions(), destAccessConditions.sequenceNumberAccessConditions(), destAccessConditions.modifiedAccessConditions(), sourceAccessConditions, Context.NONE)) diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AppendBlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AppendBlobsImpl.java index 3439bb917017..9f220878e06d 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AppendBlobsImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AppendBlobsImpl.java @@ -25,17 +25,19 @@ import com.azure.storage.blob.models.AppendBlobsCreateResponse; import com.azure.storage.blob.models.AppendPositionAccessConditions; import com.azure.storage.blob.models.BlobHTTPHeaders; +import com.azure.storage.blob.models.CustomerProvidedKeyInfo; import com.azure.storage.blob.models.EncryptionAlgorithmType; import com.azure.storage.blob.models.LeaseAccessConditions; import com.azure.storage.blob.models.ModifiedAccessConditions; import com.azure.storage.blob.models.SourceModifiedAccessConditions; import com.azure.storage.blob.models.StorageErrorException; import io.netty.buffer.ByteBuf; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + import java.net.URL; import java.time.OffsetDateTime; import java.util.Map; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; /** * An instance of this class provides access to all the operations defined in @@ -72,17 +74,17 @@ private interface AppendBlobsService { @Put("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono create(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-meta-") Map metadata, @QueryParam("x-ms-encryption-key") String encryptionKey, @QueryParam("x-ms-encryption-key-sha256") String encryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-blob-type") String blobType, @HeaderParam("x-ms-blob-content-type") String blobContentType, @HeaderParam("x-ms-blob-content-encoding") String blobContentEncoding, @HeaderParam("x-ms-blob-content-language") String blobContentLanguage, @HeaderParam("x-ms-blob-content-md5") String blobContentMD5, @HeaderParam("x-ms-blob-cache-control") String blobCacheControl, @HeaderParam("x-ms-blob-content-disposition") String blobContentDisposition, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context); + Mono create(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-tags") String tags, @QueryParam("x-ms-encryption-key") String xMsEncryptionKey, @QueryParam("x-ms-encryption-key-sha256") String xMsEncryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType xMsEncryptionAlgorithm, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-blob-type") String blobType, @HeaderParam("x-ms-blob-content-type") String blobContentType, @HeaderParam("x-ms-blob-content-encoding") String blobContentEncoding, @HeaderParam("x-ms-blob-content-language") String blobContentLanguage, @HeaderParam("x-ms-blob-content-md5") String blobContentMD5, @HeaderParam("x-ms-blob-cache-control") String blobCacheControl, @HeaderParam("x-ms-blob-content-disposition") String blobContentDisposition, @HeaderParam("x-ms-lease-id") String leaseId, @QueryParam("x-ms-encryption-scope") String encryptionScope, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono appendBlock(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @BodyParam("application/octet-stream") Flux body, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("Content-MD5") String transactionalContentMD5, @QueryParam("x-ms-encryption-key") String encryptionKey, @QueryParam("x-ms-encryption-key-sha256") String encryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-blob-condition-maxsize") Long maxSize, @HeaderParam("x-ms-blob-condition-appendpos") Long appendPosition, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context); + Mono appendBlock(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @BodyParam("application/octet-stream") Flux body, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("Content-MD5") String transactionalContentMD5, @HeaderParam("x-ms-content-crc64") String transactionalContentCrc64, @QueryParam("x-ms-encryption-key") String xMsEncryptionKey, @QueryParam("x-ms-encryption-key-sha256") String xMsEncryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType xMsEncryptionAlgorithm, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-blob-condition-maxsize") Long maxSize, @HeaderParam("x-ms-blob-condition-appendpos") Long appendPosition, @QueryParam("x-ms-encryption-scope") String encryptionScope, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono appendBlockFromUrl(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @HeaderParam("x-ms-copy-source") URL copySource, @HeaderParam("x-ms-source-range") String sourceRange, @HeaderParam("x-ms-source-content-md5") String sourceContentMD5, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-blob-condition-maxsize") Long maxSize, @HeaderParam("x-ms-blob-condition-appendpos") Long appendPosition, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, @HeaderParam("x-ms-source-if-match") String sourceIfMatch, @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, Context context); + Mono appendBlockFromUrl(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @HeaderParam("x-ms-copy-source") URL copySource, @HeaderParam("x-ms-source-range") String sourceRange, @HeaderParam("x-ms-source-content-md5") String sourceContentMD5, @HeaderParam("x-ms-source-content-crc64") String sourceContentcrc64, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("Content-MD5") String transactionalContentMD5, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-blob-condition-maxsize") Long maxSize, @HeaderParam("x-ms-blob-condition-appendpos") Long appendPosition, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, @HeaderParam("x-ms-source-if-match") String sourceIfMatch, @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, Context context); } /** @@ -99,9 +101,10 @@ private interface AppendBlobsService { public Mono createWithRestResponseAsync(String containerName, String blob, long contentLength, Context context) { final Integer timeout = null; final Map metadata = null; - final String encryptionKey = null; - final String encryptionKeySha256 = null; - final EncryptionAlgorithmType encryptionAlgorithm = null; + final String tags = null; + final String xMsEncryptionKey = null; + final String xMsEncryptionKeySha256 = null; + final EncryptionAlgorithmType xMsEncryptionAlgorithm = null; final String requestId = null; final String blobType = "AppendBlob"; final String blobContentType = null; @@ -110,12 +113,13 @@ public Mono createWithRestResponseAsync(String contai final String blobCacheControl = null; final String blobContentDisposition = null; final String leaseId = null; + final String encryptionScope = null; final String ifMatch = null; final String ifNoneMatch = null; String blobContentMD5Converted = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.create(containerName, blob, this.client.getUrl(), timeout, contentLength, metadata, encryptionKey, encryptionKeySha256, encryptionAlgorithm, this.client.getVersion(), requestId, blobType, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5Converted, blobCacheControl, blobContentDisposition, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); + return service.create(containerName, blob, this.client.getUrl(), timeout, contentLength, metadata, tags, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, this.client.getVersion(), requestId, blobType, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5Converted, blobCacheControl, blobContentDisposition, leaseId, encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); } /** @@ -126,19 +130,21 @@ public Mono createWithRestResponseAsync(String contai * @param contentLength The length of the request. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. - * @param encryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. - * @param encryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. - * @param encryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. + * @param tags Optional. A URL encoded query param string which specifies the tags to be created with the Blob object. e.g. TagName1=TagValue1&TagName2=TagValue2. The x-ms-tags header may contain up to 2kb of tags. + * @param xMsEncryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. + * @param xMsEncryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. + * @param xMsEncryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. * @param blobHTTPHeaders Additional parameters for the operation. * @param leaseAccessConditions Additional parameters for the operation. + * @param customerProvidedKeyInfo Additional parameters for the operation. * @param modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createWithRestResponseAsync(String containerName, String blob, long contentLength, Integer timeout, Map metadata, String encryptionKey, String encryptionKeySha256, EncryptionAlgorithmType encryptionAlgorithm, String requestId, BlobHTTPHeaders blobHTTPHeaders, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions, Context context) { + public Mono createWithRestResponseAsync(String containerName, String blob, long contentLength, Integer timeout, Map metadata, String tags, String xMsEncryptionKey, String xMsEncryptionKeySha256, EncryptionAlgorithmType xMsEncryptionAlgorithm, String requestId, BlobHTTPHeaders blobHTTPHeaders, LeaseAccessConditions leaseAccessConditions, CustomerProvidedKeyInfo customerProvidedKeyInfo, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String blobType = "AppendBlob"; String blobContentType = null; if (blobHTTPHeaders != null) { @@ -168,6 +174,10 @@ public Mono createWithRestResponseAsync(String contai if (leaseAccessConditions != null) { leaseId = leaseAccessConditions.leaseId(); } + String encryptionScope = null; + if (customerProvidedKeyInfo != null) { + encryptionScope = customerProvidedKeyInfo.encryptionScope(); + } OffsetDateTime ifModifiedSince = null; if (modifiedAccessConditions != null) { ifModifiedSince = modifiedAccessConditions.ifModifiedSince(); @@ -187,7 +197,7 @@ public Mono createWithRestResponseAsync(String contai String blobContentMD5Converted = Base64Util.encodeToString(blobContentMD5); DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.create(containerName, blob, this.client.getUrl(), timeout, contentLength, metadata, encryptionKey, encryptionKeySha256, encryptionAlgorithm, this.client.getVersion(), requestId, blobType, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5Converted, blobCacheControl, blobContentDisposition, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); + return service.create(containerName, blob, this.client.getUrl(), timeout, contentLength, metadata, tags, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, this.client.getVersion(), requestId, blobType, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5Converted, blobCacheControl, blobContentDisposition, leaseId, encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); } /** @@ -204,20 +214,22 @@ public Mono createWithRestResponseAsync(String contai @ServiceMethod(returns = ReturnType.SINGLE) public Mono appendBlockWithRestResponseAsync(String containerName, String blob, Flux body, long contentLength, Context context) { final Integer timeout = null; - final String encryptionKey = null; - final String encryptionKeySha256 = null; - final EncryptionAlgorithmType encryptionAlgorithm = null; + final String xMsEncryptionKey = null; + final String xMsEncryptionKeySha256 = null; + final EncryptionAlgorithmType xMsEncryptionAlgorithm = null; final String requestId = null; final String comp = "appendblock"; final String leaseId = null; final Long maxSize = null; final Long appendPosition = null; + final String encryptionScope = null; final String ifMatch = null; final String ifNoneMatch = null; String transactionalContentMD5Converted = null; + String transactionalContentCrc64Converted = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.appendBlock(containerName, blob, this.client.getUrl(), body, timeout, contentLength, transactionalContentMD5Converted, encryptionKey, encryptionKeySha256, encryptionAlgorithm, this.client.getVersion(), requestId, comp, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); + return service.appendBlock(containerName, blob, this.client.getUrl(), body, timeout, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, this.client.getVersion(), requestId, comp, leaseId, maxSize, appendPosition, encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); } /** @@ -229,19 +241,21 @@ public Mono appendBlockWithRestResponseAsync(Str * @param contentLength The length of the request. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param encryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. - * @param encryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. - * @param encryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. + * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. + * @param xMsEncryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. + * @param xMsEncryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. + * @param xMsEncryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. * @param leaseAccessConditions Additional parameters for the operation. * @param appendPositionAccessConditions Additional parameters for the operation. + * @param customerProvidedKeyInfo Additional parameters for the operation. * @param modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono appendBlockWithRestResponseAsync(String containerName, String blob, Flux body, long contentLength, Integer timeout, byte[] transactionalContentMD5, String encryptionKey, String encryptionKeySha256, EncryptionAlgorithmType encryptionAlgorithm, String requestId, LeaseAccessConditions leaseAccessConditions, AppendPositionAccessConditions appendPositionAccessConditions, ModifiedAccessConditions modifiedAccessConditions, Context context) { + public Mono appendBlockWithRestResponseAsync(String containerName, String blob, Flux body, long contentLength, Integer timeout, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, String xMsEncryptionKey, String xMsEncryptionKeySha256, EncryptionAlgorithmType xMsEncryptionAlgorithm, String requestId, LeaseAccessConditions leaseAccessConditions, AppendPositionAccessConditions appendPositionAccessConditions, CustomerProvidedKeyInfo customerProvidedKeyInfo, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String comp = "appendblock"; String leaseId = null; if (leaseAccessConditions != null) { @@ -255,6 +269,10 @@ public Mono appendBlockWithRestResponseAsync(Str if (appendPositionAccessConditions != null) { appendPosition = appendPositionAccessConditions.appendPosition(); } + String encryptionScope = null; + if (customerProvidedKeyInfo != null) { + encryptionScope = customerProvidedKeyInfo.encryptionScope(); + } OffsetDateTime ifModifiedSince = null; if (modifiedAccessConditions != null) { ifModifiedSince = modifiedAccessConditions.ifModifiedSince(); @@ -272,9 +290,10 @@ public Mono appendBlockWithRestResponseAsync(Str ifNoneMatch = modifiedAccessConditions.ifNoneMatch(); } String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); + String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.appendBlock(containerName, blob, this.client.getUrl(), body, timeout, contentLength, transactionalContentMD5Converted, encryptionKey, encryptionKeySha256, encryptionAlgorithm, this.client.getVersion(), requestId, comp, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); + return service.appendBlock(containerName, blob, this.client.getUrl(), body, timeout, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, this.client.getVersion(), requestId, comp, leaseId, maxSize, appendPosition, encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); } /** @@ -302,11 +321,13 @@ public Mono appendBlockFromUrlWithRestRes final String sourceIfMatch = null; final String sourceIfNoneMatch = null; String sourceContentMD5Converted = null; + String sourceContentcrc64Converted = null; + String transactionalContentMD5Converted = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; DateTimeRfc1123 sourceIfModifiedSinceConverted = null; DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = null; - return service.appendBlockFromUrl(containerName, blob, this.client.getUrl(), sourceUrl, sourceRange, sourceContentMD5Converted, timeout, contentLength, this.client.getVersion(), requestId, comp, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, context); + return service.appendBlockFromUrl(containerName, blob, this.client.getUrl(), sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, contentLength, transactionalContentMD5Converted, this.client.getVersion(), requestId, comp, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, context); } /** @@ -318,7 +339,9 @@ public Mono appendBlockFromUrlWithRestRes * @param contentLength The length of the request. * @param sourceRange Bytes of source data in the specified range. * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. + * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy source. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. + * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. * @param leaseAccessConditions Additional parameters for the operation. * @param appendPositionAccessConditions Additional parameters for the operation. @@ -329,7 +352,7 @@ public Mono appendBlockFromUrlWithRestRes * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono appendBlockFromUrlWithRestResponseAsync(String containerName, String blob, URL sourceUrl, long contentLength, String sourceRange, byte[] sourceContentMD5, Integer timeout, String requestId, LeaseAccessConditions leaseAccessConditions, AppendPositionAccessConditions appendPositionAccessConditions, ModifiedAccessConditions modifiedAccessConditions, SourceModifiedAccessConditions sourceModifiedAccessConditions, Context context) { + public Mono appendBlockFromUrlWithRestResponseAsync(String containerName, String blob, URL sourceUrl, long contentLength, String sourceRange, byte[] sourceContentMD5, byte[] sourceContentcrc64, Integer timeout, byte[] transactionalContentMD5, String requestId, LeaseAccessConditions leaseAccessConditions, AppendPositionAccessConditions appendPositionAccessConditions, ModifiedAccessConditions modifiedAccessConditions, SourceModifiedAccessConditions sourceModifiedAccessConditions, Context context) { final String comp = "appendblock"; String leaseId = null; if (leaseAccessConditions != null) { @@ -376,10 +399,12 @@ public Mono appendBlockFromUrlWithRestRes sourceIfNoneMatch = sourceModifiedAccessConditions.sourceIfNoneMatch(); } String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); + String sourceContentcrc64Converted = Base64Util.encodeToString(sourceContentcrc64); + String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 sourceIfModifiedSinceConverted = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - return service.appendBlockFromUrl(containerName, blob, this.client.getUrl(), sourceUrl, sourceRange, sourceContentMD5Converted, timeout, contentLength, this.client.getVersion(), requestId, comp, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, context); + return service.appendBlockFromUrl(containerName, blob, this.client.getUrl(), sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, contentLength, transactionalContentMD5Converted, this.client.getVersion(), requestId, comp, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, context); } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AzureBlobStorageBuilder.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AzureBlobStorageBuilder.java index fa28f6e26d0e..fe79309a238b 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AzureBlobStorageBuilder.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AzureBlobStorageBuilder.java @@ -7,6 +7,7 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.implementation.RestProxy; import com.azure.core.implementation.annotation.ServiceClientBuilder; +import com.azure.storage.blob.models.PathRenameMode; /** * A builder for creating a new instance of the AzureBlobStorage type. @@ -45,6 +46,38 @@ public AzureBlobStorageBuilder version(String version) { return this; } + /* + * The filter parameter enables the caller to query blobs whose tags match a given expression. The given expression must evaluate to true for a blob to be returned in the results. + */ + private String filter; + + /** + * Sets The filter parameter enables the caller to query blobs whose tags match a given expression. The given expression must evaluate to true for a blob to be returned in the results. + * + * @param filter the filter value. + * @return the AzureBlobStorageBuilder. + */ + public AzureBlobStorageBuilder filter(String filter) { + this.filter = filter; + return this; + } + + /* + * Determines the behavior of the rename operation. Possible values include: 'legacy', 'posix' + */ + private PathRenameMode pathRenameMode; + + /** + * Sets Determines the behavior of the rename operation. Possible values include: 'legacy', 'posix'. + * + * @param pathRenameMode the pathRenameMode value. + * @return the AzureBlobStorageBuilder. + */ + public AzureBlobStorageBuilder pathRenameMode(PathRenameMode pathRenameMode) { + this.pathRenameMode = pathRenameMode; + return this; + } + /* * The HTTP pipeline to send requests through */ @@ -67,6 +100,9 @@ public AzureBlobStorageBuilder pipeline(HttpPipeline pipeline) { * @return an instance of AzureBlobStorageImpl. */ public AzureBlobStorageImpl build() { + if (version == null) { + this.version = "2019-02-02"; + } if (pipeline == null) { this.pipeline = RestProxy.createDefaultPipeline(); } @@ -76,8 +112,12 @@ public AzureBlobStorageImpl build() { } if (this.version != null) { client.setVersion(this.version); - } else { - client.setVersion("2018-11-09"); + } + if (this.filter != null) { + client.setFilter(this.filter); + } + if (this.pathRenameMode != null) { + client.setPathRenameMode(this.pathRenameMode); } return client; } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AzureBlobStorageImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AzureBlobStorageImpl.java index 5fc9bc8ae273..d9f48fbf8799 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AzureBlobStorageImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AzureBlobStorageImpl.java @@ -6,6 +6,7 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.implementation.RestProxy; +import com.azure.storage.blob.models.PathRenameMode; /** * Initializes a new instance of the AzureBlobStorage type. @@ -29,9 +30,11 @@ public String getUrl() { * Sets The URL of the service account, container, or blob that is the targe of the desired operation. * * @param url the url value. + * @return the service client itself. */ - void setUrl(String url) { + AzureBlobStorageImpl setUrl(String url) { this.url = url; + return this; } /** @@ -52,9 +55,61 @@ public String getVersion() { * Sets Specifies the version of the operation to use for this request. * * @param version the version value. + * @return the service client itself. */ - void setVersion(String version) { + AzureBlobStorageImpl setVersion(String version) { this.version = version; + return this; + } + + /** + * The filter parameter enables the caller to query blobs whose tags match a given expression. The given expression must evaluate to true for a blob to be returned in the results. + */ + private String filter; + + /** + * Gets The filter parameter enables the caller to query blobs whose tags match a given expression. The given expression must evaluate to true for a blob to be returned in the results. + * + * @return the filter value. + */ + public String getFilter() { + return this.filter; + } + + /** + * Sets The filter parameter enables the caller to query blobs whose tags match a given expression. The given expression must evaluate to true for a blob to be returned in the results. + * + * @param filter the filter value. + * @return the service client itself. + */ + AzureBlobStorageImpl setFilter(String filter) { + this.filter = filter; + return this; + } + + /** + * Determines the behavior of the rename operation. Possible values include: 'legacy', 'posix'. + */ + private PathRenameMode pathRenameMode; + + /** + * Gets Determines the behavior of the rename operation. Possible values include: 'legacy', 'posix'. + * + * @return the pathRenameMode value. + */ + public PathRenameMode getPathRenameMode() { + return this.pathRenameMode; + } + + /** + * Sets Determines the behavior of the rename operation. Possible values include: 'legacy', 'posix'. + * + * @param pathRenameMode the pathRenameMode value. + * @return the service client itself. + */ + AzureBlobStorageImpl setPathRenameMode(PathRenameMode pathRenameMode) { + this.pathRenameMode = pathRenameMode; + return this; } /** @@ -99,6 +154,20 @@ public ContainersImpl containers() { return this.containers; } + /** + * The DirectorysImpl object to access its operations. + */ + private DirectorysImpl directorys; + + /** + * Gets the DirectorysImpl object to access its operations. + * + * @return the DirectorysImpl object. + */ + public DirectorysImpl directorys() { + return this.directorys; + } + /** * The BlobsImpl object to access its operations. */ @@ -171,6 +240,7 @@ public AzureBlobStorageImpl(HttpPipeline httpPipeline) { this.httpPipeline = httpPipeline; this.services = new ServicesImpl(this); this.containers = new ContainersImpl(this); + this.directorys = new DirectorysImpl(this); this.blobs = new BlobsImpl(this); this.pageBlobs = new PageBlobsImpl(this); this.appendBlobs = new AppendBlobsImpl(this); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java index eba1efa297e4..9f75f3503418 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java @@ -6,6 +6,7 @@ import com.azure.core.implementation.DateTimeRfc1123; import com.azure.core.implementation.RestProxy; +import com.azure.core.implementation.annotation.BodyParam; import com.azure.core.implementation.annotation.Delete; import com.azure.core.implementation.annotation.ExpectedResponses; import com.azure.core.implementation.annotation.Get; @@ -22,7 +23,8 @@ import com.azure.core.implementation.annotation.UnexpectedResponseExceptionType; import com.azure.core.implementation.util.Base64Util; import com.azure.core.util.Context; -import com.azure.storage.blob.models.AccessTier; +import com.azure.storage.blob.models.AccessTierOptional; +import com.azure.storage.blob.models.AccessTierRequired; import com.azure.storage.blob.models.BlobHTTPHeaders; import com.azure.storage.blob.models.BlobsAbortCopyFromURLResponse; import com.azure.storage.blob.models.BlobsAcquireLeaseResponse; @@ -34,17 +36,26 @@ import com.azure.storage.blob.models.BlobsDownloadResponse; import com.azure.storage.blob.models.BlobsGetAccountInfoResponse; import com.azure.storage.blob.models.BlobsGetPropertiesResponse; +import com.azure.storage.blob.models.BlobsGetTagsResponse; import com.azure.storage.blob.models.BlobsReleaseLeaseResponse; +import com.azure.storage.blob.models.BlobsRenameResponse; import com.azure.storage.blob.models.BlobsRenewLeaseResponse; import com.azure.storage.blob.models.BlobsSetHTTPHeadersResponse; import com.azure.storage.blob.models.BlobsSetMetadataResponse; +import com.azure.storage.blob.models.BlobsSetTagsResponse; import com.azure.storage.blob.models.BlobsSetTierResponse; import com.azure.storage.blob.models.BlobsStartCopyFromURLResponse; import com.azure.storage.blob.models.BlobsUndeleteResponse; +import com.azure.storage.blob.models.BlobTags; +import com.azure.storage.blob.models.CustomerProvidedKeyInfo; +import com.azure.storage.blob.models.DataLakeStorageErrorException; import com.azure.storage.blob.models.DeleteSnapshotsOptionType; +import com.azure.storage.blob.models.DirectoryHttpHeaders; import com.azure.storage.blob.models.EncryptionAlgorithmType; import com.azure.storage.blob.models.LeaseAccessConditions; import com.azure.storage.blob.models.ModifiedAccessConditions; +import com.azure.storage.blob.models.PathRenameMode; +import com.azure.storage.blob.models.RehydratePriority; import com.azure.storage.blob.models.SourceModifiedAccessConditions; import com.azure.storage.blob.models.StorageErrorException; import java.net.URL; @@ -87,18 +98,23 @@ private interface BlobsService { @Get("{containerName}/{blob}") @ExpectedResponses({200, 206}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono download(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-range-get-content-md5") Boolean rangeGetContentMD5, @QueryParam("x-ms-encryption-key") String encryptionKey, @QueryParam("x-ms-encryption-key-sha256") String encryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context); + Mono download(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-range-get-content-md5") Boolean rangeGetContentMD5, @HeaderParam("x-ms-range-get-content-crc64") Boolean rangeGetContentCRC64, @QueryParam("x-ms-encryption-key") String xMsEncryptionKey, @QueryParam("x-ms-encryption-key-sha256") String xMsEncryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType xMsEncryptionAlgorithm, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context); @Head("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono getProperties(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId, @QueryParam("timeout") Integer timeout, @QueryParam("x-ms-encryption-key") String encryptionKey, @QueryParam("x-ms-encryption-key-sha256") String encryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context); + Mono getProperties(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId, @QueryParam("timeout") Integer timeout, @QueryParam("x-ms-encryption-key") String xMsEncryptionKey, @QueryParam("x-ms-encryption-key-sha256") String xMsEncryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType xMsEncryptionAlgorithm, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context); @Delete("{containerName}/{blob}") @ExpectedResponses({202}) @UnexpectedResponseExceptionType(StorageErrorException.class) Mono delete(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-delete-snapshots") DeleteSnapshotsOptionType deleteSnapshots, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context); + @Put("{filesystem}/{path}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType(DataLakeStorageErrorException.class) + Mono rename(@PathParam("filesystem") String filesystem, @PathParam("path") String path, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @QueryParam("mode") PathRenameMode pathRenameMode, @HeaderParam("x-ms-rename-source") String renameSource, @HeaderParam("x-ms-properties") String directoryProperties, @HeaderParam("x-ms-permissions") String posixPermissions, @HeaderParam("x-ms-umask") String posixUmask, @HeaderParam("x-ms-source-lease-id") String sourceLeaseId, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-cache-control") String cacheControl, @HeaderParam("x-ms-content-type") String contentType, @HeaderParam("x-ms-content-encoding") String contentEncoding, @HeaderParam("x-ms-content-language") String contentLanguage, @HeaderParam("x-ms-content-disposition") String contentDisposition, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, @HeaderParam("x-ms-source-if-match") String sourceIfMatch, @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, Context context); + @Put("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) @@ -112,7 +128,7 @@ private interface BlobsService { @Put("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono setMetadata(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @QueryParam("x-ms-encryption-key") String encryptionKey, @QueryParam("x-ms-encryption-key-sha256") String encryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context); + Mono setMetadata(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @QueryParam("x-ms-encryption-key") String xMsEncryptionKey, @QueryParam("x-ms-encryption-key-sha256") String xMsEncryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType xMsEncryptionAlgorithm, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-id") String leaseId, @QueryParam("x-ms-encryption-scope") String encryptionScope, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({201}) @@ -142,17 +158,17 @@ private interface BlobsService { @Put("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono createSnapshot(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @QueryParam("x-ms-encryption-key") String encryptionKey, @QueryParam("x-ms-encryption-key-sha256") String encryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-lease-id") String leaseId, Context context); + Mono createSnapshot(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @QueryParam("x-ms-encryption-key") String xMsEncryptionKey, @QueryParam("x-ms-encryption-key-sha256") String xMsEncryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType xMsEncryptionAlgorithm, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @QueryParam("x-ms-encryption-scope") String encryptionScope, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-lease-id") String leaseId, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({202}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono startCopyFromURL(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-copy-source") URL copySource, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, @HeaderParam("x-ms-source-if-match") String sourceIfMatch, @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-lease-id") String leaseId, Context context); + Mono startCopyFromURL(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-tags") String tags, @HeaderParam("x-ms-access-tier") AccessTierOptional tier, @HeaderParam("x-ms-rehydrate-priority") RehydratePriority rehydratePriority, @HeaderParam("x-ms-copy-source") URL copySource, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, @HeaderParam("x-ms-source-if-match") String sourceIfMatch, @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-lease-id") String leaseId, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({202}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono copyFromURL(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-copy-source") URL copySource, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-requires-sync") String xMsRequiresSync, @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, @HeaderParam("x-ms-source-if-match") String sourceIfMatch, @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-lease-id") String leaseId, Context context); + Mono copyFromURL(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-tags") String tags, @HeaderParam("x-ms-access-tier") AccessTierOptional tier, @HeaderParam("x-ms-copy-source") URL copySource, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-requires-sync") String xMsRequiresSync, @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, @HeaderParam("x-ms-source-if-match") String sourceIfMatch, @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-lease-id") String leaseId, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({204}) @@ -162,16 +178,26 @@ private interface BlobsService { @Put("{containerName}/{blob}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono setTier(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-access-tier") AccessTier tier, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-id") String leaseId, Context context); + Mono setTier(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-access-tier") AccessTierRequired tier, @HeaderParam("x-ms-rehydrate-priority") RehydratePriority rehydratePriority, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-id") String leaseId, Context context); @Get("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) Mono getAccountInfo(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @HeaderParam("x-ms-version") String version, @QueryParam("restype") String restype, @QueryParam("comp") String comp, Context context); + + @Put("{containerName}/{blob}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(StorageErrorException.class) + Mono setTags(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @BodyParam("application/xml; charset=utf-8") BlobTags tags, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("Content-MD5") String transactionalContentMD5, @HeaderParam("x-ms-content-crc64") String transactionalContentCrc64, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, Context context); + + @Get("{containerName}/{blob}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageErrorException.class) + Mono getTags(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, Context context); } /** - * The Download operation reads or downloads a blob from the system, including its metadata and properties. You can also call Download to read a snapshot or verison. + * The Download operation reads or downloads a blob from the system, including its metadata and properties. You can also call Download to read a snapshot or version. * * @param containerName The container name. * @param blob The blob name. @@ -186,20 +212,21 @@ public Mono downloadWithRestResponseAsync(String containe final Integer timeout = null; final String range = null; final Boolean rangeGetContentMD5 = null; - final String encryptionKey = null; - final String encryptionKeySha256 = null; - final EncryptionAlgorithmType encryptionAlgorithm = null; + final Boolean rangeGetContentCRC64 = null; + final String xMsEncryptionKey = null; + final String xMsEncryptionKeySha256 = null; + final EncryptionAlgorithmType xMsEncryptionAlgorithm = null; final String requestId = null; final String leaseId = null; final String ifMatch = null; final String ifNoneMatch = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.download(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, range, rangeGetContentMD5, encryptionKey, encryptionKeySha256, encryptionAlgorithm, this.client.getVersion(), requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); + return service.download(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, range, rangeGetContentMD5, rangeGetContentCRC64, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, this.client.getVersion(), requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); } /** - * The Download operation reads or downloads a blob from the system, including its metadata and properties. You can also call Download to read a snapshot or verison. + * The Download operation reads or downloads a blob from the system, including its metadata and properties. You can also call Download to read a snapshot or version. * * @param containerName The container name. * @param blob The blob name. @@ -208,9 +235,10 @@ public Mono downloadWithRestResponseAsync(String containe * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. * @param range Return only the bytes of the blob in the specified range. * @param rangeGetContentMD5 When set to true and specified together with the Range, the service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size. - * @param encryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. - * @param encryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. - * @param encryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. + * @param rangeGetContentCRC64 When set to true and specified together with the Range, the service returns the CRC64 hash for the range, as long as the range is less than or equal to 4 MB in size. + * @param xMsEncryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. + * @param xMsEncryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. + * @param xMsEncryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. * @param leaseAccessConditions Additional parameters for the operation. * @param modifiedAccessConditions Additional parameters for the operation. @@ -219,7 +247,7 @@ public Mono downloadWithRestResponseAsync(String containe * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono downloadWithRestResponseAsync(String containerName, String blob, String snapshot, String versionId, Integer timeout, String range, Boolean rangeGetContentMD5, String encryptionKey, String encryptionKeySha256, EncryptionAlgorithmType encryptionAlgorithm, String requestId, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions, Context context) { + public Mono downloadWithRestResponseAsync(String containerName, String blob, String snapshot, String versionId, Integer timeout, String range, Boolean rangeGetContentMD5, Boolean rangeGetContentCRC64, String xMsEncryptionKey, String xMsEncryptionKeySha256, EncryptionAlgorithmType xMsEncryptionAlgorithm, String requestId, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions, Context context) { String leaseId = null; if (leaseAccessConditions != null) { leaseId = leaseAccessConditions.leaseId(); @@ -242,7 +270,7 @@ public Mono downloadWithRestResponseAsync(String containe } DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.download(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, range, rangeGetContentMD5, encryptionKey, encryptionKeySha256, encryptionAlgorithm, this.client.getVersion(), requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); + return service.download(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, range, rangeGetContentMD5, rangeGetContentCRC64, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, this.client.getVersion(), requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); } /** @@ -259,16 +287,16 @@ public Mono getPropertiesWithRestResponseAsync(Strin final String snapshot = null; final String versionId = null; final Integer timeout = null; - final String encryptionKey = null; - final String encryptionKeySha256 = null; - final EncryptionAlgorithmType encryptionAlgorithm = null; + final String xMsEncryptionKey = null; + final String xMsEncryptionKeySha256 = null; + final EncryptionAlgorithmType xMsEncryptionAlgorithm = null; final String requestId = null; final String leaseId = null; final String ifMatch = null; final String ifNoneMatch = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.getProperties(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, encryptionKey, encryptionKeySha256, encryptionAlgorithm, this.client.getVersion(), requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); + return service.getProperties(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, this.client.getVersion(), requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); } /** @@ -279,9 +307,9 @@ public Mono getPropertiesWithRestResponseAsync(Strin * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more information on working with blob snapshots, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating a Snapshot of a Blob.</a>. * @param versionId The version ID parameter is an opaque DateTime value that, when present, specifies the blob version to retrieve. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. - * @param encryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. - * @param encryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. - * @param encryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. + * @param xMsEncryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. + * @param xMsEncryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. + * @param xMsEncryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. * @param leaseAccessConditions Additional parameters for the operation. * @param modifiedAccessConditions Additional parameters for the operation. @@ -290,7 +318,7 @@ public Mono getPropertiesWithRestResponseAsync(Strin * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPropertiesWithRestResponseAsync(String containerName, String blob, String snapshot, String versionId, Integer timeout, String encryptionKey, String encryptionKeySha256, EncryptionAlgorithmType encryptionAlgorithm, String requestId, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions, Context context) { + public Mono getPropertiesWithRestResponseAsync(String containerName, String blob, String snapshot, String versionId, Integer timeout, String xMsEncryptionKey, String xMsEncryptionKeySha256, EncryptionAlgorithmType xMsEncryptionAlgorithm, String requestId, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions, Context context) { String leaseId = null; if (leaseAccessConditions != null) { leaseId = leaseAccessConditions.leaseId(); @@ -313,7 +341,7 @@ public Mono getPropertiesWithRestResponseAsync(Strin } DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.getProperties(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, encryptionKey, encryptionKeySha256, encryptionAlgorithm, this.client.getVersion(), requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); + return service.getProperties(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, this.client.getVersion(), requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); } /** @@ -383,6 +411,126 @@ public Mono deleteWithRestResponseAsync(String containerNam return service.delete(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, deleteSnapshots, this.client.getVersion(), requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); } + /** + * Rename a blob/file. By default, the destination is overwritten and if the destination already exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). To fail if the destination already exists, use a conditional request with If-None-Match: "*". + * + * @param filesystem The filesystem name. + * @param path The namespace path to a file or directory. + * @param renameSource The file or directory to be renamed. The value must have the following format: "/{filesysystem}/{path}". If "x-ms-properties" is specified, the properties will overwrite the existing properties; otherwise, the existing properties will be preserved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a Mono which performs the network request upon subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono renameWithRestResponseAsync(String filesystem, String path, String renameSource, Context context) { + final Integer timeout = null; + final String directoryProperties = null; + final String posixPermissions = null; + final String posixUmask = null; + final String sourceLeaseId = null; + final String requestId = null; + final String cacheControl = null; + final String contentType = null; + final String contentEncoding = null; + final String contentLanguage = null; + final String contentDisposition = null; + final String leaseId = null; + final String ifMatch = null; + final String ifNoneMatch = null; + final String sourceIfMatch = null; + final String sourceIfNoneMatch = null; + DateTimeRfc1123 ifModifiedSinceConverted = null; + DateTimeRfc1123 ifUnmodifiedSinceConverted = null; + DateTimeRfc1123 sourceIfModifiedSinceConverted = null; + DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = null; + return service.rename(filesystem, path, this.client.getUrl(), timeout, this.client.getPathRenameMode(), renameSource, directoryProperties, posixPermissions, posixUmask, sourceLeaseId, this.client.getVersion(), requestId, cacheControl, contentType, contentEncoding, contentLanguage, contentDisposition, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, context); + } + + /** + * Rename a blob/file. By default, the destination is overwritten and if the destination already exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). To fail if the destination already exists, use a conditional request with If-None-Match: "*". + * + * @param filesystem The filesystem name. + * @param path The namespace path to a file or directory. + * @param renameSource The file or directory to be renamed. The value must have the following format: "/{filesysystem}/{path}". If "x-ms-properties" is specified, the properties will overwrite the existing properties; otherwise, the existing properties will be preserved. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. + * @param directoryProperties Optional. User-defined properties to be stored with the file or directory, in the format of a comma-separated list of name and value pairs "n1=v1, n2=v2, ...", where each value is base64 encoded. + * @param posixPermissions Optional and only valid if Hierarchical Namespace is enabled for the account. Sets POSIX access permissions for the file owner, the file owning group, and others. Each class may be granted read, write, or execute permission. The sticky bit is also supported. Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are supported. + * @param posixUmask Only valid if Hierarchical Namespace is enabled for the account. This umask restricts permission settings for file and directory, and will only be applied when default Acl does not exist in parent directory. If the umask bit has set, it means that the corresponding permission will be disabled. Otherwise the corresponding permission will be determined by the permission. A 4-digit octal notation (e.g. 0022) is supported here. If no umask was specified, a default umask - 0027 will be used. + * @param sourceLeaseId A lease ID for the source path. If specified, the source path must have an active lease and the leaase ID must match. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. + * @param directoryHttpHeaders Additional parameters for the operation. + * @param leaseAccessConditions Additional parameters for the operation. + * @param modifiedAccessConditions Additional parameters for the operation. + * @param sourceModifiedAccessConditions Additional parameters for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a Mono which performs the network request upon subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono renameWithRestResponseAsync(String filesystem, String path, String renameSource, Integer timeout, String directoryProperties, String posixPermissions, String posixUmask, String sourceLeaseId, String requestId, DirectoryHttpHeaders directoryHttpHeaders, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions, SourceModifiedAccessConditions sourceModifiedAccessConditions, Context context) { + String cacheControl = null; + if (directoryHttpHeaders != null) { + cacheControl = directoryHttpHeaders.cacheControl(); + } + String contentType = null; + if (directoryHttpHeaders != null) { + contentType = directoryHttpHeaders.contentType(); + } + String contentEncoding = null; + if (directoryHttpHeaders != null) { + contentEncoding = directoryHttpHeaders.contentEncoding(); + } + String contentLanguage = null; + if (directoryHttpHeaders != null) { + contentLanguage = directoryHttpHeaders.contentLanguage(); + } + String contentDisposition = null; + if (directoryHttpHeaders != null) { + contentDisposition = directoryHttpHeaders.contentDisposition(); + } + String leaseId = null; + if (leaseAccessConditions != null) { + leaseId = leaseAccessConditions.leaseId(); + } + OffsetDateTime ifModifiedSince = null; + if (modifiedAccessConditions != null) { + ifModifiedSince = modifiedAccessConditions.ifModifiedSince(); + } + OffsetDateTime ifUnmodifiedSince = null; + if (modifiedAccessConditions != null) { + ifUnmodifiedSince = modifiedAccessConditions.ifUnmodifiedSince(); + } + String ifMatch = null; + if (modifiedAccessConditions != null) { + ifMatch = modifiedAccessConditions.ifMatch(); + } + String ifNoneMatch = null; + if (modifiedAccessConditions != null) { + ifNoneMatch = modifiedAccessConditions.ifNoneMatch(); + } + OffsetDateTime sourceIfModifiedSince = null; + if (sourceModifiedAccessConditions != null) { + sourceIfModifiedSince = sourceModifiedAccessConditions.sourceIfModifiedSince(); + } + OffsetDateTime sourceIfUnmodifiedSince = null; + if (sourceModifiedAccessConditions != null) { + sourceIfUnmodifiedSince = sourceModifiedAccessConditions.sourceIfUnmodifiedSince(); + } + String sourceIfMatch = null; + if (sourceModifiedAccessConditions != null) { + sourceIfMatch = sourceModifiedAccessConditions.sourceIfMatch(); + } + String sourceIfNoneMatch = null; + if (sourceModifiedAccessConditions != null) { + sourceIfNoneMatch = sourceModifiedAccessConditions.sourceIfNoneMatch(); + } + DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + DateTimeRfc1123 sourceIfModifiedSinceConverted = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); + DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); + return service.rename(filesystem, path, this.client.getUrl(), timeout, this.client.getPathRenameMode(), renameSource, directoryProperties, posixPermissions, posixUmask, sourceLeaseId, this.client.getVersion(), requestId, cacheControl, contentType, contentEncoding, contentLanguage, contentDisposition, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, context); + } + /** * Undelete a blob that was previously soft deleted. * @@ -525,17 +673,18 @@ public Mono setHTTPHeadersWithRestResponseAsync(Str public Mono setMetadataWithRestResponseAsync(String containerName, String blob, Context context) { final Integer timeout = null; final Map metadata = null; - final String encryptionKey = null; - final String encryptionKeySha256 = null; - final EncryptionAlgorithmType encryptionAlgorithm = null; + final String xMsEncryptionKey = null; + final String xMsEncryptionKeySha256 = null; + final EncryptionAlgorithmType xMsEncryptionAlgorithm = null; final String requestId = null; final String comp = "metadata"; final String leaseId = null; + final String encryptionScope = null; final String ifMatch = null; final String ifNoneMatch = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.setMetadata(containerName, blob, this.client.getUrl(), timeout, metadata, encryptionKey, encryptionKeySha256, encryptionAlgorithm, this.client.getVersion(), requestId, comp, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); + return service.setMetadata(containerName, blob, this.client.getUrl(), timeout, metadata, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, this.client.getVersion(), requestId, comp, leaseId, encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); } /** @@ -545,23 +694,28 @@ public Mono setMetadataWithRestResponseAsync(String co * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. - * @param encryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. - * @param encryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. - * @param encryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. + * @param xMsEncryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. + * @param xMsEncryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. + * @param xMsEncryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. * @param leaseAccessConditions Additional parameters for the operation. + * @param customerProvidedKeyInfo Additional parameters for the operation. * @param modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setMetadataWithRestResponseAsync(String containerName, String blob, Integer timeout, Map metadata, String encryptionKey, String encryptionKeySha256, EncryptionAlgorithmType encryptionAlgorithm, String requestId, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions, Context context) { + public Mono setMetadataWithRestResponseAsync(String containerName, String blob, Integer timeout, Map metadata, String xMsEncryptionKey, String xMsEncryptionKeySha256, EncryptionAlgorithmType xMsEncryptionAlgorithm, String requestId, LeaseAccessConditions leaseAccessConditions, CustomerProvidedKeyInfo customerProvidedKeyInfo, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String comp = "metadata"; String leaseId = null; if (leaseAccessConditions != null) { leaseId = leaseAccessConditions.leaseId(); } + String encryptionScope = null; + if (customerProvidedKeyInfo != null) { + encryptionScope = customerProvidedKeyInfo.encryptionScope(); + } OffsetDateTime ifModifiedSince = null; if (modifiedAccessConditions != null) { ifModifiedSince = modifiedAccessConditions.ifModifiedSince(); @@ -580,7 +734,7 @@ public Mono setMetadataWithRestResponseAsync(String co } DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.setMetadata(containerName, blob, this.client.getUrl(), timeout, metadata, encryptionKey, encryptionKeySha256, encryptionAlgorithm, this.client.getVersion(), requestId, comp, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); + return service.setMetadata(containerName, blob, this.client.getUrl(), timeout, metadata, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, this.client.getVersion(), requestId, comp, leaseId, encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); } /** @@ -905,17 +1059,18 @@ public Mono breakLeaseWithRestResponseAsync(String cont public Mono createSnapshotWithRestResponseAsync(String containerName, String blob, Context context) { final Integer timeout = null; final Map metadata = null; - final String encryptionKey = null; - final String encryptionKeySha256 = null; - final EncryptionAlgorithmType encryptionAlgorithm = null; + final String xMsEncryptionKey = null; + final String xMsEncryptionKeySha256 = null; + final EncryptionAlgorithmType xMsEncryptionAlgorithm = null; final String requestId = null; final String comp = "snapshot"; + final String encryptionScope = null; final String ifMatch = null; final String ifNoneMatch = null; final String leaseId = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.createSnapshot(containerName, blob, this.client.getUrl(), timeout, metadata, encryptionKey, encryptionKeySha256, encryptionAlgorithm, this.client.getVersion(), requestId, comp, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, leaseId, context); + return service.createSnapshot(containerName, blob, this.client.getUrl(), timeout, metadata, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, this.client.getVersion(), requestId, comp, encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, leaseId, context); } /** @@ -925,10 +1080,11 @@ public Mono createSnapshotWithRestResponseAsync(Str * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. - * @param encryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. - * @param encryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. - * @param encryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. + * @param xMsEncryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. + * @param xMsEncryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. + * @param xMsEncryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. + * @param customerProvidedKeyInfo Additional parameters for the operation. * @param modifiedAccessConditions Additional parameters for the operation. * @param leaseAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. @@ -936,8 +1092,12 @@ public Mono createSnapshotWithRestResponseAsync(Str * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createSnapshotWithRestResponseAsync(String containerName, String blob, Integer timeout, Map metadata, String encryptionKey, String encryptionKeySha256, EncryptionAlgorithmType encryptionAlgorithm, String requestId, ModifiedAccessConditions modifiedAccessConditions, LeaseAccessConditions leaseAccessConditions, Context context) { + public Mono createSnapshotWithRestResponseAsync(String containerName, String blob, Integer timeout, Map metadata, String xMsEncryptionKey, String xMsEncryptionKeySha256, EncryptionAlgorithmType xMsEncryptionAlgorithm, String requestId, CustomerProvidedKeyInfo customerProvidedKeyInfo, ModifiedAccessConditions modifiedAccessConditions, LeaseAccessConditions leaseAccessConditions, Context context) { final String comp = "snapshot"; + String encryptionScope = null; + if (customerProvidedKeyInfo != null) { + encryptionScope = customerProvidedKeyInfo.encryptionScope(); + } OffsetDateTime ifModifiedSince = null; if (modifiedAccessConditions != null) { ifModifiedSince = modifiedAccessConditions.ifModifiedSince(); @@ -960,7 +1120,7 @@ public Mono createSnapshotWithRestResponseAsync(Str } DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.createSnapshot(containerName, blob, this.client.getUrl(), timeout, metadata, encryptionKey, encryptionKeySha256, encryptionAlgorithm, this.client.getVersion(), requestId, comp, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, leaseId, context); + return service.createSnapshot(containerName, blob, this.client.getUrl(), timeout, metadata, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, this.client.getVersion(), requestId, comp, encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, leaseId, context); } /** @@ -977,6 +1137,9 @@ public Mono createSnapshotWithRestResponseAsync(Str public Mono startCopyFromURLWithRestResponseAsync(String containerName, String blob, URL copySource, Context context) { final Integer timeout = null; final Map metadata = null; + final String tags = null; + final AccessTierOptional tier = null; + final RehydratePriority rehydratePriority = null; final String requestId = null; final String sourceIfMatch = null; final String sourceIfNoneMatch = null; @@ -987,7 +1150,7 @@ public Mono startCopyFromURLWithRestResponseAsync DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.startCopyFromURL(containerName, blob, this.client.getUrl(), timeout, metadata, copySource, this.client.getVersion(), requestId, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, leaseId, context); + return service.startCopyFromURL(containerName, blob, this.client.getUrl(), timeout, metadata, tags, tier, rehydratePriority, copySource, this.client.getVersion(), requestId, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, leaseId, context); } /** @@ -998,6 +1161,9 @@ public Mono startCopyFromURLWithRestResponseAsync * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. The source blob must either be public or must be authenticated via a shared access signature. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. + * @param tags Optional. A URL encoded query param string which specifies the tags to be created with the Blob object. e.g. TagName1=TagValue1&TagName2=TagValue2. The x-ms-tags header may contain up to 2kb of tags. + * @param tier Optional. Indicates the tier to be set on the blob. Possible values include: 'Hot', 'Cool', 'Archive'. + * @param rehydratePriority Optional: Indicates the priority with which to rehydrate an archived blob. Possible values include: 'High', 'Standard'. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. * @param sourceModifiedAccessConditions Additional parameters for the operation. * @param modifiedAccessConditions Additional parameters for the operation. @@ -1007,7 +1173,7 @@ public Mono startCopyFromURLWithRestResponseAsync * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startCopyFromURLWithRestResponseAsync(String containerName, String blob, URL copySource, Integer timeout, Map metadata, String requestId, SourceModifiedAccessConditions sourceModifiedAccessConditions, ModifiedAccessConditions modifiedAccessConditions, LeaseAccessConditions leaseAccessConditions, Context context) { + public Mono startCopyFromURLWithRestResponseAsync(String containerName, String blob, URL copySource, Integer timeout, Map metadata, String tags, AccessTierOptional tier, RehydratePriority rehydratePriority, String requestId, SourceModifiedAccessConditions sourceModifiedAccessConditions, ModifiedAccessConditions modifiedAccessConditions, LeaseAccessConditions leaseAccessConditions, Context context) { OffsetDateTime sourceIfModifiedSince = null; if (sourceModifiedAccessConditions != null) { sourceIfModifiedSince = sourceModifiedAccessConditions.sourceIfModifiedSince(); @@ -1048,7 +1214,7 @@ public Mono startCopyFromURLWithRestResponseAsync DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.startCopyFromURL(containerName, blob, this.client.getUrl(), timeout, metadata, copySource, this.client.getVersion(), requestId, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, leaseId, context); + return service.startCopyFromURL(containerName, blob, this.client.getUrl(), timeout, metadata, tags, tier, rehydratePriority, copySource, this.client.getVersion(), requestId, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, leaseId, context); } /** @@ -1065,6 +1231,8 @@ public Mono startCopyFromURLWithRestResponseAsync public Mono copyFromURLWithRestResponseAsync(String containerName, String blob, URL copySource, Context context) { final Integer timeout = null; final Map metadata = null; + final String tags = null; + final AccessTierOptional tier = null; final String requestId = null; final String xMsRequiresSync = "true"; final String sourceIfMatch = null; @@ -1076,7 +1244,7 @@ public Mono copyFromURLWithRestResponseAsync(String co DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.copyFromURL(containerName, blob, this.client.getUrl(), timeout, metadata, copySource, this.client.getVersion(), requestId, xMsRequiresSync, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, leaseId, context); + return service.copyFromURL(containerName, blob, this.client.getUrl(), timeout, metadata, tags, tier, copySource, this.client.getVersion(), requestId, xMsRequiresSync, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, leaseId, context); } /** @@ -1087,6 +1255,8 @@ public Mono copyFromURLWithRestResponseAsync(String co * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. The source blob must either be public or must be authenticated via a shared access signature. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. + * @param tags Optional. A URL encoded query param string which specifies the tags to be created with the Blob object. e.g. TagName1=TagValue1&TagName2=TagValue2. The x-ms-tags header may contain up to 2kb of tags. + * @param tier Optional. Indicates the tier to be set on the blob. Possible values include: 'Hot', 'Cool', 'Archive'. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. * @param sourceModifiedAccessConditions Additional parameters for the operation. * @param modifiedAccessConditions Additional parameters for the operation. @@ -1096,7 +1266,7 @@ public Mono copyFromURLWithRestResponseAsync(String co * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono copyFromURLWithRestResponseAsync(String containerName, String blob, URL copySource, Integer timeout, Map metadata, String requestId, SourceModifiedAccessConditions sourceModifiedAccessConditions, ModifiedAccessConditions modifiedAccessConditions, LeaseAccessConditions leaseAccessConditions, Context context) { + public Mono copyFromURLWithRestResponseAsync(String containerName, String blob, URL copySource, Integer timeout, Map metadata, String tags, AccessTierOptional tier, String requestId, SourceModifiedAccessConditions sourceModifiedAccessConditions, ModifiedAccessConditions modifiedAccessConditions, LeaseAccessConditions leaseAccessConditions, Context context) { final String xMsRequiresSync = "true"; OffsetDateTime sourceIfModifiedSince = null; if (sourceModifiedAccessConditions != null) { @@ -1138,7 +1308,7 @@ public Mono copyFromURLWithRestResponseAsync(String co DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.copyFromURL(containerName, blob, this.client.getUrl(), timeout, metadata, copySource, this.client.getVersion(), requestId, xMsRequiresSync, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, leaseId, context); + return service.copyFromURL(containerName, blob, this.client.getUrl(), timeout, metadata, tags, tier, copySource, this.client.getVersion(), requestId, xMsRequiresSync, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, leaseId, context); } /** @@ -1196,12 +1366,13 @@ public Mono abortCopyFromURLWithRestResponseAsync * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setTierWithRestResponseAsync(String containerName, String blob, AccessTier tier, Context context) { + public Mono setTierWithRestResponseAsync(String containerName, String blob, AccessTierRequired tier, Context context) { final Integer timeout = null; + final RehydratePriority rehydratePriority = null; final String requestId = null; final String comp = "tier"; final String leaseId = null; - return service.setTier(containerName, blob, this.client.getUrl(), timeout, tier, this.client.getVersion(), requestId, comp, leaseId, context); + return service.setTier(containerName, blob, this.client.getUrl(), timeout, tier, rehydratePriority, this.client.getVersion(), requestId, comp, leaseId, context); } /** @@ -1211,6 +1382,7 @@ public Mono setTierWithRestResponseAsync(String containerN * @param blob The blob name. * @param tier Indicates the tier to be set on the blob. Possible values include: 'P4', 'P6', 'P10', 'P20', 'P30', 'P40', 'P50', 'Hot', 'Cool', 'Archive'. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. + * @param rehydratePriority Optional: Indicates the priority with which to rehydrate an archived blob. Possible values include: 'High', 'Standard'. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. * @param leaseAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. @@ -1218,13 +1390,13 @@ public Mono setTierWithRestResponseAsync(String containerN * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setTierWithRestResponseAsync(String containerName, String blob, AccessTier tier, Integer timeout, String requestId, LeaseAccessConditions leaseAccessConditions, Context context) { + public Mono setTierWithRestResponseAsync(String containerName, String blob, AccessTierRequired tier, Integer timeout, RehydratePriority rehydratePriority, String requestId, LeaseAccessConditions leaseAccessConditions, Context context) { final String comp = "tier"; String leaseId = null; if (leaseAccessConditions != null) { leaseId = leaseAccessConditions.leaseId(); } - return service.setTier(containerName, blob, this.client.getUrl(), timeout, tier, this.client.getVersion(), requestId, comp, leaseId, context); + return service.setTier(containerName, blob, this.client.getUrl(), timeout, tier, rehydratePriority, this.client.getVersion(), requestId, comp, leaseId, context); } /** @@ -1242,4 +1414,88 @@ public Mono getAccountInfoWithRestResponseAsync(Str final String comp = "properties"; return service.getAccountInfo(containerName, blob, this.client.getUrl(), this.client.getVersion(), restype, comp, context); } + + /** + * The Set Blob Tags operation sets tags for the specified blob. This API is only supported in version 2018-11-09 and later. + * + * @param containerName The container name. + * @param blob The blob name. + * @param tags the BlobTags value. + * @param contentLength The length of the request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a Mono which performs the network request upon subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono setTagsWithRestResponseAsync(String containerName, String blob, BlobTags tags, long contentLength, Context context) { + final Integer timeout = null; + final String requestId = null; + final String comp = "tags"; + String transactionalContentMD5Converted = null; + String transactionalContentCrc64Converted = null; + return service.setTags(containerName, blob, this.client.getUrl(), tags, timeout, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, this.client.getVersion(), requestId, comp, context); + } + + /** + * The Set Blob Tags operation sets tags for the specified blob. This API is only supported in version 2018-11-09 and later. + * + * @param containerName The container name. + * @param blob The blob name. + * @param tags the BlobTags value. + * @param contentLength The length of the request. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. + * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. + * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a Mono which performs the network request upon subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono setTagsWithRestResponseAsync(String containerName, String blob, BlobTags tags, long contentLength, Integer timeout, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, String requestId, Context context) { + final String comp = "tags"; + String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); + String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); + return service.setTags(containerName, blob, this.client.getUrl(), tags, timeout, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, this.client.getVersion(), requestId, comp, context); + } + + /** + * The Get Blob Tags operation returns all tags for the specified blob, snapshot, or version. This API is only supported in version 2018-11-09 and later. + * + * @param containerName The container name. + * @param blob The blob name. + * @param contentLength The length of the request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a Mono which performs the network request upon subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTagsWithRestResponseAsync(String containerName, String blob, long contentLength, Context context) { + final Integer timeout = null; + final String snapshot = null; + final String versionId = null; + final String requestId = null; + final String comp = "tags"; + return service.getTags(containerName, blob, this.client.getUrl(), timeout, contentLength, snapshot, versionId, this.client.getVersion(), requestId, comp, context); + } + + /** + * The Get Blob Tags operation returns all tags for the specified blob, snapshot, or version. This API is only supported in version 2018-11-09 and later. + * + * @param containerName The container name. + * @param blob The blob name. + * @param contentLength The length of the request. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. + * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more information on working with blob snapshots, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating a Snapshot of a Blob.</a>. + * @param versionId The version ID parameter is an opaque DateTime value that, when present, specifies the blob version to retrieve. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a Mono which performs the network request upon subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTagsWithRestResponseAsync(String containerName, String blob, long contentLength, Integer timeout, String snapshot, String versionId, String requestId, Context context) { + final String comp = "tags"; + return service.getTags(containerName, blob, this.client.getUrl(), timeout, contentLength, snapshot, versionId, this.client.getVersion(), requestId, comp, context); + } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlockBlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlockBlobsImpl.java index 390c2436de9a..ec226b60e1d8 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlockBlobsImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlockBlobsImpl.java @@ -21,6 +21,7 @@ import com.azure.core.implementation.annotation.UnexpectedResponseExceptionType; import com.azure.core.implementation.util.Base64Util; import com.azure.core.util.Context; +import com.azure.storage.blob.models.AccessTierOptional; import com.azure.storage.blob.models.BlobHTTPHeaders; import com.azure.storage.blob.models.BlockBlobsCommitBlockListResponse; import com.azure.storage.blob.models.BlockBlobsGetBlockListResponse; @@ -29,6 +30,7 @@ import com.azure.storage.blob.models.BlockBlobsUploadResponse; import com.azure.storage.blob.models.BlockListType; import com.azure.storage.blob.models.BlockLookupList; +import com.azure.storage.blob.models.CustomerProvidedKeyInfo; import com.azure.storage.blob.models.EncryptionAlgorithmType; import com.azure.storage.blob.models.LeaseAccessConditions; import com.azure.storage.blob.models.ModifiedAccessConditions; @@ -76,22 +78,22 @@ private interface BlockBlobsService { @Put("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono upload(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @BodyParam("application/octet-stream") Flux body, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-meta-") Map metadata, @QueryParam("x-ms-encryption-key") String encryptionKey, @QueryParam("x-ms-encryption-key-sha256") String encryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-blob-type") String blobType, @HeaderParam("x-ms-blob-content-type") String blobContentType, @HeaderParam("x-ms-blob-content-encoding") String blobContentEncoding, @HeaderParam("x-ms-blob-content-language") String blobContentLanguage, @HeaderParam("x-ms-blob-content-md5") String blobContentMD5, @HeaderParam("x-ms-blob-cache-control") String blobCacheControl, @HeaderParam("x-ms-blob-content-disposition") String blobContentDisposition, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context); + Mono upload(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @BodyParam("application/octet-stream") Flux body, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-tags") String tags, @QueryParam("x-ms-encryption-key") String xMsEncryptionKey, @QueryParam("x-ms-encryption-key-sha256") String xMsEncryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType xMsEncryptionAlgorithm, @HeaderParam("x-ms-access-tier") AccessTierOptional tier, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-blob-type") String blobType, @HeaderParam("x-ms-blob-content-type") String blobContentType, @HeaderParam("x-ms-blob-content-encoding") String blobContentEncoding, @HeaderParam("x-ms-blob-content-language") String blobContentLanguage, @HeaderParam("x-ms-blob-content-md5") String blobContentMD5, @HeaderParam("x-ms-blob-cache-control") String blobCacheControl, @HeaderParam("x-ms-blob-content-disposition") String blobContentDisposition, @HeaderParam("x-ms-lease-id") String leaseId, @QueryParam("x-ms-encryption-scope") String encryptionScope, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono stageBlock(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("blockid") String blockId, @HeaderParam("Content-Length") long contentLength, @HeaderParam("Content-MD5") String transactionalContentMD5, @BodyParam("application/octet-stream") Flux body, @QueryParam("timeout") Integer timeout, @QueryParam("x-ms-encryption-key") String encryptionKey, @QueryParam("x-ms-encryption-key-sha256") String encryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-id") String leaseId, Context context); + Mono stageBlock(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("blockid") String blockId, @HeaderParam("Content-Length") long contentLength, @HeaderParam("Content-MD5") String transactionalContentMD5, @HeaderParam("x-ms-content-crc64") String transactionalContentCrc64, @BodyParam("application/octet-stream") Flux body, @QueryParam("timeout") Integer timeout, @QueryParam("x-ms-encryption-key") String xMsEncryptionKey, @QueryParam("x-ms-encryption-key-sha256") String xMsEncryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType xMsEncryptionAlgorithm, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-id") String leaseId, @QueryParam("x-ms-encryption-scope") String encryptionScope, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono stageBlockFromURL(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("blockid") String blockId, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-copy-source") URL copySource, @HeaderParam("x-ms-source-range") String sourceRange, @HeaderParam("x-ms-source-content-md5") String sourceContentMD5, @QueryParam("timeout") Integer timeout, @QueryParam("x-ms-encryption-key") String encryptionKey, @QueryParam("x-ms-encryption-key-sha256") String encryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, @HeaderParam("x-ms-source-if-match") String sourceIfMatch, @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, Context context); + Mono stageBlockFromURL(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("blockid") String blockId, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-copy-source") URL copySource, @HeaderParam("x-ms-source-range") String sourceRange, @HeaderParam("x-ms-source-content-md5") String sourceContentMD5, @HeaderParam("x-ms-source-content-crc64") String sourceContentcrc64, @QueryParam("timeout") Integer timeout, @QueryParam("x-ms-encryption-key") String xMsEncryptionKey, @QueryParam("x-ms-encryption-key-sha256") String xMsEncryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType xMsEncryptionAlgorithm, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-id") String leaseId, @QueryParam("x-ms-encryption-scope") String encryptionScope, @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, @HeaderParam("x-ms-source-if-match") String sourceIfMatch, @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono commitBlockList(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @QueryParam("x-ms-encryption-key") String encryptionKey, @QueryParam("x-ms-encryption-key-sha256") String encryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, @BodyParam("application/xml; charset=utf-8") BlockLookupList blocks, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-blob-cache-control") String blobCacheControl, @HeaderParam("x-ms-blob-content-type") String blobContentType, @HeaderParam("x-ms-blob-content-encoding") String blobContentEncoding, @HeaderParam("x-ms-blob-content-language") String blobContentLanguage, @HeaderParam("x-ms-blob-content-md5") String blobContentMD5, @HeaderParam("x-ms-blob-content-disposition") String blobContentDisposition, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context); + Mono commitBlockList(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-MD5") String transactionalContentMD5, @HeaderParam("x-ms-content-crc64") String transactionalContentCrc64, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-tags") String tags, @QueryParam("x-ms-encryption-key") String xMsEncryptionKey, @QueryParam("x-ms-encryption-key-sha256") String xMsEncryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType xMsEncryptionAlgorithm, @HeaderParam("x-ms-access-tier") AccessTierOptional tier, @BodyParam("application/xml; charset=utf-8") BlockLookupList blocks, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-blob-cache-control") String blobCacheControl, @HeaderParam("x-ms-blob-content-type") String blobContentType, @HeaderParam("x-ms-blob-content-encoding") String blobContentEncoding, @HeaderParam("x-ms-blob-content-language") String blobContentLanguage, @HeaderParam("x-ms-blob-content-md5") String blobContentMD5, @HeaderParam("x-ms-blob-content-disposition") String blobContentDisposition, @HeaderParam("x-ms-lease-id") String leaseId, @QueryParam("x-ms-encryption-scope") String encryptionScope, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context); @Get("{containerName}/{blob}") @ExpectedResponses({200}) @@ -114,9 +116,11 @@ private interface BlockBlobsService { public Mono uploadWithRestResponseAsync(String containerName, String blob, Flux body, long contentLength, Context context) { final Integer timeout = null; final Map metadata = null; - final String encryptionKey = null; - final String encryptionKeySha256 = null; - final EncryptionAlgorithmType encryptionAlgorithm = null; + final String tags = null; + final String xMsEncryptionKey = null; + final String xMsEncryptionKeySha256 = null; + final EncryptionAlgorithmType xMsEncryptionAlgorithm = null; + final AccessTierOptional tier = null; final String requestId = null; final String blobType = "BlockBlob"; final String blobContentType = null; @@ -125,12 +129,13 @@ public Mono uploadWithRestResponseAsync(String contain final String blobCacheControl = null; final String blobContentDisposition = null; final String leaseId = null; + final String encryptionScope = null; final String ifMatch = null; final String ifNoneMatch = null; String blobContentMD5Converted = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.upload(containerName, blob, this.client.getUrl(), body, timeout, contentLength, metadata, encryptionKey, encryptionKeySha256, encryptionAlgorithm, this.client.getVersion(), requestId, blobType, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5Converted, blobCacheControl, blobContentDisposition, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); + return service.upload(containerName, blob, this.client.getUrl(), body, timeout, contentLength, metadata, tags, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, tier, this.client.getVersion(), requestId, blobType, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5Converted, blobCacheControl, blobContentDisposition, leaseId, encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); } /** @@ -142,19 +147,22 @@ public Mono uploadWithRestResponseAsync(String contain * @param contentLength The length of the request. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. - * @param encryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. - * @param encryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. - * @param encryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. + * @param tags Optional. A URL encoded query param string which specifies the tags to be created with the Blob object. e.g. TagName1=TagValue1&TagName2=TagValue2. The x-ms-tags header may contain up to 2kb of tags. + * @param xMsEncryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. + * @param xMsEncryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. + * @param xMsEncryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. + * @param tier Optional. Indicates the tier to be set on the blob. Possible values include: 'Hot', 'Cool', 'Archive'. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. * @param blobHTTPHeaders Additional parameters for the operation. * @param leaseAccessConditions Additional parameters for the operation. + * @param customerProvidedKeyInfo Additional parameters for the operation. * @param modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono uploadWithRestResponseAsync(String containerName, String blob, Flux body, long contentLength, Integer timeout, Map metadata, String encryptionKey, String encryptionKeySha256, EncryptionAlgorithmType encryptionAlgorithm, String requestId, BlobHTTPHeaders blobHTTPHeaders, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions, Context context) { + public Mono uploadWithRestResponseAsync(String containerName, String blob, Flux body, long contentLength, Integer timeout, Map metadata, String tags, String xMsEncryptionKey, String xMsEncryptionKeySha256, EncryptionAlgorithmType xMsEncryptionAlgorithm, AccessTierOptional tier, String requestId, BlobHTTPHeaders blobHTTPHeaders, LeaseAccessConditions leaseAccessConditions, CustomerProvidedKeyInfo customerProvidedKeyInfo, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String blobType = "BlockBlob"; String blobContentType = null; if (blobHTTPHeaders != null) { @@ -184,6 +192,10 @@ public Mono uploadWithRestResponseAsync(String contain if (leaseAccessConditions != null) { leaseId = leaseAccessConditions.leaseId(); } + String encryptionScope = null; + if (customerProvidedKeyInfo != null) { + encryptionScope = customerProvidedKeyInfo.encryptionScope(); + } OffsetDateTime ifModifiedSince = null; if (modifiedAccessConditions != null) { ifModifiedSince = modifiedAccessConditions.ifModifiedSince(); @@ -203,7 +215,7 @@ public Mono uploadWithRestResponseAsync(String contain String blobContentMD5Converted = Base64Util.encodeToString(blobContentMD5); DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.upload(containerName, blob, this.client.getUrl(), body, timeout, contentLength, metadata, encryptionKey, encryptionKeySha256, encryptionAlgorithm, this.client.getVersion(), requestId, blobType, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5Converted, blobCacheControl, blobContentDisposition, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); + return service.upload(containerName, blob, this.client.getUrl(), body, timeout, contentLength, metadata, tags, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, tier, this.client.getVersion(), requestId, blobType, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5Converted, blobCacheControl, blobContentDisposition, leaseId, encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); } /** @@ -221,14 +233,16 @@ public Mono uploadWithRestResponseAsync(String contain @ServiceMethod(returns = ReturnType.SINGLE) public Mono stageBlockWithRestResponseAsync(String containerName, String blob, String blockId, long contentLength, Flux body, Context context) { final Integer timeout = null; - final String encryptionKey = null; - final String encryptionKeySha256 = null; - final EncryptionAlgorithmType encryptionAlgorithm = null; + final String xMsEncryptionKey = null; + final String xMsEncryptionKeySha256 = null; + final EncryptionAlgorithmType xMsEncryptionAlgorithm = null; final String requestId = null; final String comp = "block"; final String leaseId = null; + final String encryptionScope = null; String transactionalContentMD5Converted = null; - return service.stageBlock(containerName, blob, this.client.getUrl(), blockId, contentLength, transactionalContentMD5Converted, body, timeout, encryptionKey, encryptionKeySha256, encryptionAlgorithm, this.client.getVersion(), requestId, comp, leaseId, context); + String transactionalContentCrc64Converted = null; + return service.stageBlock(containerName, blob, this.client.getUrl(), blockId, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, body, timeout, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, this.client.getVersion(), requestId, comp, leaseId, encryptionScope, context); } /** @@ -240,25 +254,32 @@ public Mono stageBlockWithRestResponseAsync(String * @param contentLength The length of the request. * @param body Initial data. * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. + * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. - * @param encryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. - * @param encryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. - * @param encryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. + * @param xMsEncryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. + * @param xMsEncryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. + * @param xMsEncryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. * @param leaseAccessConditions Additional parameters for the operation. + * @param customerProvidedKeyInfo Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stageBlockWithRestResponseAsync(String containerName, String blob, String blockId, long contentLength, Flux body, byte[] transactionalContentMD5, Integer timeout, String encryptionKey, String encryptionKeySha256, EncryptionAlgorithmType encryptionAlgorithm, String requestId, LeaseAccessConditions leaseAccessConditions, Context context) { + public Mono stageBlockWithRestResponseAsync(String containerName, String blob, String blockId, long contentLength, Flux body, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Integer timeout, String xMsEncryptionKey, String xMsEncryptionKeySha256, EncryptionAlgorithmType xMsEncryptionAlgorithm, String requestId, LeaseAccessConditions leaseAccessConditions, CustomerProvidedKeyInfo customerProvidedKeyInfo, Context context) { final String comp = "block"; String leaseId = null; if (leaseAccessConditions != null) { leaseId = leaseAccessConditions.leaseId(); } + String encryptionScope = null; + if (customerProvidedKeyInfo != null) { + encryptionScope = customerProvidedKeyInfo.encryptionScope(); + } String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - return service.stageBlock(containerName, blob, this.client.getUrl(), blockId, contentLength, transactionalContentMD5Converted, body, timeout, encryptionKey, encryptionKeySha256, encryptionAlgorithm, this.client.getVersion(), requestId, comp, leaseId, context); + String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); + return service.stageBlock(containerName, blob, this.client.getUrl(), blockId, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, body, timeout, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, this.client.getVersion(), requestId, comp, leaseId, encryptionScope, context); } /** @@ -277,18 +298,20 @@ public Mono stageBlockWithRestResponseAsync(String public Mono stageBlockFromURLWithRestResponseAsync(String containerName, String blob, String blockId, long contentLength, URL sourceUrl, Context context) { final String sourceRange = null; final Integer timeout = null; - final String encryptionKey = null; - final String encryptionKeySha256 = null; - final EncryptionAlgorithmType encryptionAlgorithm = null; + final String xMsEncryptionKey = null; + final String xMsEncryptionKeySha256 = null; + final EncryptionAlgorithmType xMsEncryptionAlgorithm = null; final String requestId = null; final String comp = "block"; final String leaseId = null; + final String encryptionScope = null; final String sourceIfMatch = null; final String sourceIfNoneMatch = null; String sourceContentMD5Converted = null; + String sourceContentcrc64Converted = null; DateTimeRfc1123 sourceIfModifiedSinceConverted = null; DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = null; - return service.stageBlockFromURL(containerName, blob, this.client.getUrl(), blockId, contentLength, sourceUrl, sourceRange, sourceContentMD5Converted, timeout, encryptionKey, encryptionKeySha256, encryptionAlgorithm, this.client.getVersion(), requestId, comp, leaseId, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, context); + return service.stageBlockFromURL(containerName, blob, this.client.getUrl(), blockId, contentLength, sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, this.client.getVersion(), requestId, comp, leaseId, encryptionScope, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, context); } /** @@ -301,24 +324,30 @@ public Mono stageBlockFromURLWithRestRespon * @param sourceUrl Specify a URL to the copy source. * @param sourceRange Bytes of source data in the specified range. * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. + * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy source. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. - * @param encryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. - * @param encryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. - * @param encryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. + * @param xMsEncryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. + * @param xMsEncryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. + * @param xMsEncryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. * @param leaseAccessConditions Additional parameters for the operation. + * @param customerProvidedKeyInfo Additional parameters for the operation. * @param sourceModifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stageBlockFromURLWithRestResponseAsync(String containerName, String blob, String blockId, long contentLength, URL sourceUrl, String sourceRange, byte[] sourceContentMD5, Integer timeout, String encryptionKey, String encryptionKeySha256, EncryptionAlgorithmType encryptionAlgorithm, String requestId, LeaseAccessConditions leaseAccessConditions, SourceModifiedAccessConditions sourceModifiedAccessConditions, Context context) { + public Mono stageBlockFromURLWithRestResponseAsync(String containerName, String blob, String blockId, long contentLength, URL sourceUrl, String sourceRange, byte[] sourceContentMD5, byte[] sourceContentcrc64, Integer timeout, String xMsEncryptionKey, String xMsEncryptionKeySha256, EncryptionAlgorithmType xMsEncryptionAlgorithm, String requestId, LeaseAccessConditions leaseAccessConditions, CustomerProvidedKeyInfo customerProvidedKeyInfo, SourceModifiedAccessConditions sourceModifiedAccessConditions, Context context) { final String comp = "block"; String leaseId = null; if (leaseAccessConditions != null) { leaseId = leaseAccessConditions.leaseId(); } + String encryptionScope = null; + if (customerProvidedKeyInfo != null) { + encryptionScope = customerProvidedKeyInfo.encryptionScope(); + } OffsetDateTime sourceIfModifiedSince = null; if (sourceModifiedAccessConditions != null) { sourceIfModifiedSince = sourceModifiedAccessConditions.sourceIfModifiedSince(); @@ -336,9 +365,10 @@ public Mono stageBlockFromURLWithRestRespon sourceIfNoneMatch = sourceModifiedAccessConditions.sourceIfNoneMatch(); } String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); + String sourceContentcrc64Converted = Base64Util.encodeToString(sourceContentcrc64); DateTimeRfc1123 sourceIfModifiedSinceConverted = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - return service.stageBlockFromURL(containerName, blob, this.client.getUrl(), blockId, contentLength, sourceUrl, sourceRange, sourceContentMD5Converted, timeout, encryptionKey, encryptionKeySha256, encryptionAlgorithm, this.client.getVersion(), requestId, comp, leaseId, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, context); + return service.stageBlockFromURL(containerName, blob, this.client.getUrl(), blockId, contentLength, sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, this.client.getVersion(), requestId, comp, leaseId, encryptionScope, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, context); } /** @@ -355,9 +385,11 @@ public Mono stageBlockFromURLWithRestRespon public Mono commitBlockListWithRestResponseAsync(String containerName, String blob, BlockLookupList blocks, Context context) { final Integer timeout = null; final Map metadata = null; - final String encryptionKey = null; - final String encryptionKeySha256 = null; - final EncryptionAlgorithmType encryptionAlgorithm = null; + final String tags = null; + final String xMsEncryptionKey = null; + final String xMsEncryptionKeySha256 = null; + final EncryptionAlgorithmType xMsEncryptionAlgorithm = null; + final AccessTierOptional tier = null; final String requestId = null; final String comp = "blocklist"; final String blobCacheControl = null; @@ -366,12 +398,15 @@ public Mono commitBlockListWithRestResponseAs final String blobContentLanguage = null; final String blobContentDisposition = null; final String leaseId = null; + final String encryptionScope = null; final String ifMatch = null; final String ifNoneMatch = null; + String transactionalContentMD5Converted = null; + String transactionalContentCrc64Converted = null; String blobContentMD5Converted = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.commitBlockList(containerName, blob, this.client.getUrl(), timeout, metadata, encryptionKey, encryptionKeySha256, encryptionAlgorithm, blocks, this.client.getVersion(), requestId, comp, blobCacheControl, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5Converted, blobContentDisposition, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); + return service.commitBlockList(containerName, blob, this.client.getUrl(), timeout, transactionalContentMD5Converted, transactionalContentCrc64Converted, metadata, tags, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, tier, blocks, this.client.getVersion(), requestId, comp, blobCacheControl, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5Converted, blobContentDisposition, leaseId, encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); } /** @@ -381,20 +416,25 @@ public Mono commitBlockListWithRestResponseAs * @param blob The blob name. * @param blocks the BlockLookupList value. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. + * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. + * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. - * @param encryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. - * @param encryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. - * @param encryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. + * @param tags Optional. A URL encoded query param string which specifies the tags to be created with the Blob object. e.g. TagName1=TagValue1&TagName2=TagValue2. The x-ms-tags header may contain up to 2kb of tags. + * @param xMsEncryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. + * @param xMsEncryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. + * @param xMsEncryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. + * @param tier Optional. Indicates the tier to be set on the blob. Possible values include: 'Hot', 'Cool', 'Archive'. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. * @param blobHTTPHeaders Additional parameters for the operation. * @param leaseAccessConditions Additional parameters for the operation. + * @param customerProvidedKeyInfo Additional parameters for the operation. * @param modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono commitBlockListWithRestResponseAsync(String containerName, String blob, BlockLookupList blocks, Integer timeout, Map metadata, String encryptionKey, String encryptionKeySha256, EncryptionAlgorithmType encryptionAlgorithm, String requestId, BlobHTTPHeaders blobHTTPHeaders, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions, Context context) { + public Mono commitBlockListWithRestResponseAsync(String containerName, String blob, BlockLookupList blocks, Integer timeout, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Map metadata, String tags, String xMsEncryptionKey, String xMsEncryptionKeySha256, EncryptionAlgorithmType xMsEncryptionAlgorithm, AccessTierOptional tier, String requestId, BlobHTTPHeaders blobHTTPHeaders, LeaseAccessConditions leaseAccessConditions, CustomerProvidedKeyInfo customerProvidedKeyInfo, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String comp = "blocklist"; String blobCacheControl = null; if (blobHTTPHeaders != null) { @@ -424,6 +464,10 @@ public Mono commitBlockListWithRestResponseAs if (leaseAccessConditions != null) { leaseId = leaseAccessConditions.leaseId(); } + String encryptionScope = null; + if (customerProvidedKeyInfo != null) { + encryptionScope = customerProvidedKeyInfo.encryptionScope(); + } OffsetDateTime ifModifiedSince = null; if (modifiedAccessConditions != null) { ifModifiedSince = modifiedAccessConditions.ifModifiedSince(); @@ -440,10 +484,12 @@ public Mono commitBlockListWithRestResponseAs if (modifiedAccessConditions != null) { ifNoneMatch = modifiedAccessConditions.ifNoneMatch(); } + String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); + String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); String blobContentMD5Converted = Base64Util.encodeToString(blobContentMD5); DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.commitBlockList(containerName, blob, this.client.getUrl(), timeout, metadata, encryptionKey, encryptionKeySha256, encryptionAlgorithm, blocks, this.client.getVersion(), requestId, comp, blobCacheControl, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5Converted, blobContentDisposition, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); + return service.commitBlockList(containerName, blob, this.client.getUrl(), timeout, transactionalContentMD5Converted, transactionalContentCrc64Converted, metadata, tags, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, tier, blocks, this.client.getVersion(), requestId, comp, blobCacheControl, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5Converted, blobContentDisposition, leaseId, encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); } /** diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ContainersImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ContainersImpl.java index efb3b64cdf8b..5a594d600a85 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ContainersImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ContainersImpl.java @@ -83,7 +83,7 @@ private interface ContainersService { @Put("{containerName}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono create(@PathParam("containerName") String containerName, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-blob-public-access") PublicAccessType access, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("restype") String restype, Context context); + Mono create(@PathParam("containerName") String containerName, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-blob-public-access") PublicAccessType access, @HeaderParam("x-ms-default-encryption-scope") String defaultEncryptionScope, @HeaderParam("x-ms-deny-encryption-scope-override") Boolean denyEncryptionScopeOverride, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("restype") String restype, Context context); @Get("{containerName}") @ExpectedResponses({200}) @@ -138,12 +138,12 @@ private interface ContainersService { @Get("{containerName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono listBlobFlatSegment(@PathParam("containerName") String containerName, @HostParam("url") String url, @QueryParam("prefix") String prefix, @QueryParam("marker") String marker, @QueryParam("maxresults") Integer maxresults, @QueryParam("include") String include, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("restype") String restype, @QueryParam("comp") String comp, Context context); + Mono listBlobFlatSegment(@PathParam("containerName") String containerName, @HostParam("url") String url, @QueryParam("prefix") String prefix, @QueryParam("marker") String marker1, @QueryParam("maxresults") Integer maxresults, @QueryParam("include") String include, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("restype") String restype, @QueryParam("comp") String comp, Context context); @Get("{containerName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono listBlobHierarchySegment(@PathParam("containerName") String containerName, @HostParam("url") String url, @QueryParam("prefix") String prefix, @QueryParam("delimiter") String delimiter, @QueryParam("marker") String marker, @QueryParam("maxresults") Integer maxresults, @QueryParam("include") String include, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("restype") String restype, @QueryParam("comp") String comp, Context context); + Mono listBlobHierarchySegment(@PathParam("containerName") String containerName, @HostParam("url") String url, @QueryParam("prefix") String prefix, @QueryParam("delimiter") String delimiter, @QueryParam("marker") String marker1, @QueryParam("maxresults") Integer maxresults, @QueryParam("include") String include, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("restype") String restype, @QueryParam("comp") String comp, Context context); @Get("{containerName}") @ExpectedResponses({200}) @@ -164,9 +164,11 @@ public Mono createWithRestResponseAsync(String contain final Integer timeout = null; final Map metadata = null; final PublicAccessType access = null; + final String defaultEncryptionScope = null; + final Boolean denyEncryptionScopeOverride = null; final String requestId = null; final String restype = "container"; - return service.create(containerName, this.client.getUrl(), timeout, metadata, access, this.client.getVersion(), requestId, restype, context); + return service.create(containerName, this.client.getUrl(), timeout, metadata, access, defaultEncryptionScope, denyEncryptionScopeOverride, this.client.getVersion(), requestId, restype, context); } /** @@ -176,15 +178,17 @@ public Mono createWithRestResponseAsync(String contain * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. * @param access Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'container', 'blob'. + * @param defaultEncryptionScope Optional. Specifies the default encryption scope on the container. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. + * @param denyEncryptionScopeOverride Optional. Specifies whether to deny encryption scope override provided in the request or not. If true, reject the request with encryption scope. If false, encryption is performed using encryption scope provided in the request. For more information, see Encryption at Rest for Azure Storage Services. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createWithRestResponseAsync(String containerName, Integer timeout, Map metadata, PublicAccessType access, String requestId, Context context) { + public Mono createWithRestResponseAsync(String containerName, Integer timeout, Map metadata, PublicAccessType access, String defaultEncryptionScope, Boolean denyEncryptionScopeOverride, String requestId, Context context) { final String restype = "container"; - return service.create(containerName, this.client.getUrl(), timeout, metadata, access, this.client.getVersion(), requestId, restype, context); + return service.create(containerName, this.client.getUrl(), timeout, metadata, access, defaultEncryptionScope, denyEncryptionScopeOverride, this.client.getVersion(), requestId, restype, context); } /** diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/DirectorysImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/DirectorysImpl.java new file mode 100644 index 000000000000..1085a8ace909 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/DirectorysImpl.java @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.implementation; + +import com.azure.core.implementation.DateTimeRfc1123; +import com.azure.core.implementation.RestProxy; +import com.azure.core.implementation.annotation.Delete; +import com.azure.core.implementation.annotation.ExpectedResponses; +import com.azure.core.implementation.annotation.HeaderParam; +import com.azure.core.implementation.annotation.Host; +import com.azure.core.implementation.annotation.HostParam; +import com.azure.core.implementation.annotation.PathParam; +import com.azure.core.implementation.annotation.Put; +import com.azure.core.implementation.annotation.QueryParam; +import com.azure.core.implementation.annotation.ReturnType; +import com.azure.core.implementation.annotation.ServiceInterface; +import com.azure.core.implementation.annotation.ServiceMethod; +import com.azure.core.implementation.annotation.UnexpectedResponseExceptionType; +import com.azure.core.util.Context; +import com.azure.storage.blob.models.DataLakeStorageErrorException; +import com.azure.storage.blob.models.DirectoryHttpHeaders; +import com.azure.storage.blob.models.DirectorysCreateResponse; +import com.azure.storage.blob.models.DirectorysDeleteResponse; +import com.azure.storage.blob.models.DirectorysRenameResponse; +import com.azure.storage.blob.models.LeaseAccessConditions; +import com.azure.storage.blob.models.ModifiedAccessConditions; +import com.azure.storage.blob.models.PathRenameMode; +import com.azure.storage.blob.models.SourceModifiedAccessConditions; +import java.time.OffsetDateTime; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * Directorys. + */ +public final class DirectorysImpl { + /** + * The proxy service used to perform REST calls. + */ + private DirectorysService service; + + /** + * The service client containing this operation class. + */ + private AzureBlobStorageImpl client; + + /** + * Initializes an instance of DirectorysImpl. + * + * @param client the instance of the service client containing this operation class. + */ + public DirectorysImpl(AzureBlobStorageImpl client) { + this.service = RestProxy.create(DirectorysService.class, client.getHttpPipeline()); + this.client = client; + } + + /** + * The interface defining all the services for AzureBlobStorageDirectorys + * to be used by the proxy service to perform REST calls. + */ + @Host("{url}") + @ServiceInterface(name = "AzureBlobStorageDirectorys") + private interface DirectorysService { + @Put("{filesystem}/{path}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType(DataLakeStorageErrorException.class) + Mono create(@PathParam("filesystem") String filesystem, @PathParam("path") String path, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-properties") String directoryProperties, @HeaderParam("x-ms-permissions") String posixPermissions, @HeaderParam("x-ms-umask") String posixUmask, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("resource") String resource, @HeaderParam("x-ms-cache-control") String cacheControl, @HeaderParam("x-ms-content-type") String contentType, @HeaderParam("x-ms-content-encoding") String contentEncoding, @HeaderParam("x-ms-content-language") String contentLanguage, @HeaderParam("x-ms-content-disposition") String contentDisposition, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context); + + @Put("{filesystem}/{path}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType(DataLakeStorageErrorException.class) + Mono rename(@PathParam("filesystem") String filesystem, @PathParam("path") String path, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @QueryParam("continuation") String marker, @QueryParam("mode") PathRenameMode pathRenameMode, @HeaderParam("x-ms-rename-source") String renameSource, @HeaderParam("x-ms-properties") String directoryProperties, @HeaderParam("x-ms-permissions") String posixPermissions, @HeaderParam("x-ms-umask") String posixUmask, @HeaderParam("x-ms-source-lease-id") String sourceLeaseId, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-cache-control") String cacheControl, @HeaderParam("x-ms-content-type") String contentType, @HeaderParam("x-ms-content-encoding") String contentEncoding, @HeaderParam("x-ms-content-language") String contentLanguage, @HeaderParam("x-ms-content-disposition") String contentDisposition, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, @HeaderParam("x-ms-source-if-match") String sourceIfMatch, @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, Context context); + + @Delete("{filesystem}/{path}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DataLakeStorageErrorException.class) + Mono delete(@PathParam("filesystem") String filesystem, @PathParam("path") String path, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @QueryParam("recursive") boolean recursiveDirectoryDelete, @QueryParam("continuation") String marker, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context); + } + + /** + * Create a directory. By default, the destination is overwritten and if the destination already exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). To fail if the destination already exists, use a conditional request with If-None-Match: "*". + * + * @param filesystem The filesystem name. + * @param path The namespace path to a file or directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a Mono which performs the network request upon subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createWithRestResponseAsync(String filesystem, String path, Context context) { + final Integer timeout = null; + final String directoryProperties = null; + final String posixPermissions = null; + final String posixUmask = null; + final String requestId = null; + final String resource = "directory"; + final String cacheControl = null; + final String contentType = null; + final String contentEncoding = null; + final String contentLanguage = null; + final String contentDisposition = null; + final String leaseId = null; + final String ifMatch = null; + final String ifNoneMatch = null; + DateTimeRfc1123 ifModifiedSinceConverted = null; + DateTimeRfc1123 ifUnmodifiedSinceConverted = null; + return service.create(filesystem, path, this.client.getUrl(), timeout, directoryProperties, posixPermissions, posixUmask, this.client.getVersion(), requestId, resource, cacheControl, contentType, contentEncoding, contentLanguage, contentDisposition, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); + } + + /** + * Create a directory. By default, the destination is overwritten and if the destination already exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). To fail if the destination already exists, use a conditional request with If-None-Match: "*". + * + * @param filesystem The filesystem name. + * @param path The namespace path to a file or directory. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. + * @param directoryProperties Optional. User-defined properties to be stored with the file or directory, in the format of a comma-separated list of name and value pairs "n1=v1, n2=v2, ...", where each value is base64 encoded. + * @param posixPermissions Optional and only valid if Hierarchical Namespace is enabled for the account. Sets POSIX access permissions for the file owner, the file owning group, and others. Each class may be granted read, write, or execute permission. The sticky bit is also supported. Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are supported. + * @param posixUmask Only valid if Hierarchical Namespace is enabled for the account. This umask restricts permission settings for file and directory, and will only be applied when default Acl does not exist in parent directory. If the umask bit has set, it means that the corresponding permission will be disabled. Otherwise the corresponding permission will be determined by the permission. A 4-digit octal notation (e.g. 0022) is supported here. If no umask was specified, a default umask - 0027 will be used. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. + * @param directoryHttpHeaders Additional parameters for the operation. + * @param leaseAccessConditions Additional parameters for the operation. + * @param modifiedAccessConditions Additional parameters for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a Mono which performs the network request upon subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createWithRestResponseAsync(String filesystem, String path, Integer timeout, String directoryProperties, String posixPermissions, String posixUmask, String requestId, DirectoryHttpHeaders directoryHttpHeaders, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions, Context context) { + final String resource = "directory"; + String cacheControl = null; + if (directoryHttpHeaders != null) { + cacheControl = directoryHttpHeaders.cacheControl(); + } + String contentType = null; + if (directoryHttpHeaders != null) { + contentType = directoryHttpHeaders.contentType(); + } + String contentEncoding = null; + if (directoryHttpHeaders != null) { + contentEncoding = directoryHttpHeaders.contentEncoding(); + } + String contentLanguage = null; + if (directoryHttpHeaders != null) { + contentLanguage = directoryHttpHeaders.contentLanguage(); + } + String contentDisposition = null; + if (directoryHttpHeaders != null) { + contentDisposition = directoryHttpHeaders.contentDisposition(); + } + String leaseId = null; + if (leaseAccessConditions != null) { + leaseId = leaseAccessConditions.leaseId(); + } + OffsetDateTime ifModifiedSince = null; + if (modifiedAccessConditions != null) { + ifModifiedSince = modifiedAccessConditions.ifModifiedSince(); + } + OffsetDateTime ifUnmodifiedSince = null; + if (modifiedAccessConditions != null) { + ifUnmodifiedSince = modifiedAccessConditions.ifUnmodifiedSince(); + } + String ifMatch = null; + if (modifiedAccessConditions != null) { + ifMatch = modifiedAccessConditions.ifMatch(); + } + String ifNoneMatch = null; + if (modifiedAccessConditions != null) { + ifNoneMatch = modifiedAccessConditions.ifNoneMatch(); + } + DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + return service.create(filesystem, path, this.client.getUrl(), timeout, directoryProperties, posixPermissions, posixUmask, this.client.getVersion(), requestId, resource, cacheControl, contentType, contentEncoding, contentLanguage, contentDisposition, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); + } + + /** + * Rename a directory. By default, the destination is overwritten and if the destination already exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). To fail if the destination already exists, use a conditional request with If-None-Match: "*". + * + * @param filesystem The filesystem name. + * @param path The namespace path to a file or directory. + * @param renameSource The file or directory to be renamed. The value must have the following format: "/{filesysystem}/{path}". If "x-ms-properties" is specified, the properties will overwrite the existing properties; otherwise, the existing properties will be preserved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a Mono which performs the network request upon subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono renameWithRestResponseAsync(String filesystem, String path, String renameSource, Context context) { + final Integer timeout = null; + final String marker = null; + final String directoryProperties = null; + final String posixPermissions = null; + final String posixUmask = null; + final String sourceLeaseId = null; + final String requestId = null; + final String cacheControl = null; + final String contentType = null; + final String contentEncoding = null; + final String contentLanguage = null; + final String contentDisposition = null; + final String leaseId = null; + final String ifMatch = null; + final String ifNoneMatch = null; + final String sourceIfMatch = null; + final String sourceIfNoneMatch = null; + DateTimeRfc1123 ifModifiedSinceConverted = null; + DateTimeRfc1123 ifUnmodifiedSinceConverted = null; + DateTimeRfc1123 sourceIfModifiedSinceConverted = null; + DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = null; + return service.rename(filesystem, path, this.client.getUrl(), timeout, marker, this.client.getPathRenameMode(), renameSource, directoryProperties, posixPermissions, posixUmask, sourceLeaseId, this.client.getVersion(), requestId, cacheControl, contentType, contentEncoding, contentLanguage, contentDisposition, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, context); + } + + /** + * Rename a directory. By default, the destination is overwritten and if the destination already exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). To fail if the destination already exists, use a conditional request with If-None-Match: "*". + * + * @param filesystem The filesystem name. + * @param path The namespace path to a file or directory. + * @param renameSource The file or directory to be renamed. The value must have the following format: "/{filesysystem}/{path}". If "x-ms-properties" is specified, the properties will overwrite the existing properties; otherwise, the existing properties will be preserved. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. + * @param marker When renaming a directory, the number of paths that are renamed with each invocation is limited. If the number of paths to be renamed exceeds this limit, a continuation token is returned in this response header. When a continuation token is returned in the response, it must be specified in a subsequent invocation of the rename operation to continue renaming the directory. + * @param directoryProperties Optional. User-defined properties to be stored with the file or directory, in the format of a comma-separated list of name and value pairs "n1=v1, n2=v2, ...", where each value is base64 encoded. + * @param posixPermissions Optional and only valid if Hierarchical Namespace is enabled for the account. Sets POSIX access permissions for the file owner, the file owning group, and others. Each class may be granted read, write, or execute permission. The sticky bit is also supported. Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are supported. + * @param posixUmask Only valid if Hierarchical Namespace is enabled for the account. This umask restricts permission settings for file and directory, and will only be applied when default Acl does not exist in parent directory. If the umask bit has set, it means that the corresponding permission will be disabled. Otherwise the corresponding permission will be determined by the permission. A 4-digit octal notation (e.g. 0022) is supported here. If no umask was specified, a default umask - 0027 will be used. + * @param sourceLeaseId A lease ID for the source path. If specified, the source path must have an active lease and the leaase ID must match. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. + * @param directoryHttpHeaders Additional parameters for the operation. + * @param leaseAccessConditions Additional parameters for the operation. + * @param modifiedAccessConditions Additional parameters for the operation. + * @param sourceModifiedAccessConditions Additional parameters for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a Mono which performs the network request upon subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono renameWithRestResponseAsync(String filesystem, String path, String renameSource, Integer timeout, String marker, String directoryProperties, String posixPermissions, String posixUmask, String sourceLeaseId, String requestId, DirectoryHttpHeaders directoryHttpHeaders, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions, SourceModifiedAccessConditions sourceModifiedAccessConditions, Context context) { + String cacheControl = null; + if (directoryHttpHeaders != null) { + cacheControl = directoryHttpHeaders.cacheControl(); + } + String contentType = null; + if (directoryHttpHeaders != null) { + contentType = directoryHttpHeaders.contentType(); + } + String contentEncoding = null; + if (directoryHttpHeaders != null) { + contentEncoding = directoryHttpHeaders.contentEncoding(); + } + String contentLanguage = null; + if (directoryHttpHeaders != null) { + contentLanguage = directoryHttpHeaders.contentLanguage(); + } + String contentDisposition = null; + if (directoryHttpHeaders != null) { + contentDisposition = directoryHttpHeaders.contentDisposition(); + } + String leaseId = null; + if (leaseAccessConditions != null) { + leaseId = leaseAccessConditions.leaseId(); + } + OffsetDateTime ifModifiedSince = null; + if (modifiedAccessConditions != null) { + ifModifiedSince = modifiedAccessConditions.ifModifiedSince(); + } + OffsetDateTime ifUnmodifiedSince = null; + if (modifiedAccessConditions != null) { + ifUnmodifiedSince = modifiedAccessConditions.ifUnmodifiedSince(); + } + String ifMatch = null; + if (modifiedAccessConditions != null) { + ifMatch = modifiedAccessConditions.ifMatch(); + } + String ifNoneMatch = null; + if (modifiedAccessConditions != null) { + ifNoneMatch = modifiedAccessConditions.ifNoneMatch(); + } + OffsetDateTime sourceIfModifiedSince = null; + if (sourceModifiedAccessConditions != null) { + sourceIfModifiedSince = sourceModifiedAccessConditions.sourceIfModifiedSince(); + } + OffsetDateTime sourceIfUnmodifiedSince = null; + if (sourceModifiedAccessConditions != null) { + sourceIfUnmodifiedSince = sourceModifiedAccessConditions.sourceIfUnmodifiedSince(); + } + String sourceIfMatch = null; + if (sourceModifiedAccessConditions != null) { + sourceIfMatch = sourceModifiedAccessConditions.sourceIfMatch(); + } + String sourceIfNoneMatch = null; + if (sourceModifiedAccessConditions != null) { + sourceIfNoneMatch = sourceModifiedAccessConditions.sourceIfNoneMatch(); + } + DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + DateTimeRfc1123 sourceIfModifiedSinceConverted = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); + DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); + return service.rename(filesystem, path, this.client.getUrl(), timeout, marker, this.client.getPathRenameMode(), renameSource, directoryProperties, posixPermissions, posixUmask, sourceLeaseId, this.client.getVersion(), requestId, cacheControl, contentType, contentEncoding, contentLanguage, contentDisposition, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, context); + } + + /** + * Deletes the directory. + * + * @param filesystem The filesystem name. + * @param path The namespace path to a file or directory. + * @param recursiveDirectoryDelete If "true", all paths beneath the directory will be deleted. If "false" and the directory is non-empty, an error occurs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a Mono which performs the network request upon subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteWithRestResponseAsync(String filesystem, String path, boolean recursiveDirectoryDelete, Context context) { + final Integer timeout = null; + final String marker = null; + final String requestId = null; + final String leaseId = null; + final String ifMatch = null; + final String ifNoneMatch = null; + DateTimeRfc1123 ifModifiedSinceConverted = null; + DateTimeRfc1123 ifUnmodifiedSinceConverted = null; + return service.delete(filesystem, path, this.client.getUrl(), timeout, recursiveDirectoryDelete, marker, this.client.getVersion(), requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); + } + + /** + * Deletes the directory. + * + * @param filesystem The filesystem name. + * @param path The namespace path to a file or directory. + * @param recursiveDirectoryDelete If "true", all paths beneath the directory will be deleted. If "false" and the directory is non-empty, an error occurs. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. + * @param marker When renaming a directory, the number of paths that are renamed with each invocation is limited. If the number of paths to be renamed exceeds this limit, a continuation token is returned in this response header. When a continuation token is returned in the response, it must be specified in a subsequent invocation of the rename operation to continue renaming the directory. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. + * @param leaseAccessConditions Additional parameters for the operation. + * @param modifiedAccessConditions Additional parameters for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a Mono which performs the network request upon subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteWithRestResponseAsync(String filesystem, String path, boolean recursiveDirectoryDelete, Integer timeout, String marker, String requestId, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions, Context context) { + String leaseId = null; + if (leaseAccessConditions != null) { + leaseId = leaseAccessConditions.leaseId(); + } + OffsetDateTime ifModifiedSince = null; + if (modifiedAccessConditions != null) { + ifModifiedSince = modifiedAccessConditions.ifModifiedSince(); + } + OffsetDateTime ifUnmodifiedSince = null; + if (modifiedAccessConditions != null) { + ifUnmodifiedSince = modifiedAccessConditions.ifUnmodifiedSince(); + } + String ifMatch = null; + if (modifiedAccessConditions != null) { + ifMatch = modifiedAccessConditions.ifMatch(); + } + String ifNoneMatch = null; + if (modifiedAccessConditions != null) { + ifNoneMatch = modifiedAccessConditions.ifNoneMatch(); + } + DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + return service.delete(filesystem, path, this.client.getUrl(), timeout, recursiveDirectoryDelete, marker, this.client.getVersion(), requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java index 97dd44b22bc5..2b171b31339e 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java @@ -22,6 +22,7 @@ import com.azure.core.implementation.util.Base64Util; import com.azure.core.util.Context; import com.azure.storage.blob.models.BlobHTTPHeaders; +import com.azure.storage.blob.models.CustomerProvidedKeyInfo; import com.azure.storage.blob.models.EncryptionAlgorithmType; import com.azure.storage.blob.models.LeaseAccessConditions; import com.azure.storage.blob.models.ModifiedAccessConditions; @@ -80,12 +81,12 @@ private interface PageBlobsService { @Put("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono create(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-meta-") Map metadata, @QueryParam("x-ms-encryption-key") String encryptionKey, @QueryParam("x-ms-encryption-key-sha256") String encryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, @HeaderParam("x-ms-blob-content-length") long blobContentLength, @HeaderParam("x-ms-blob-sequence-number") Long blobSequenceNumber, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-blob-type") String blobType, @HeaderParam("x-ms-blob-content-type") String blobContentType, @HeaderParam("x-ms-blob-content-encoding") String blobContentEncoding, @HeaderParam("x-ms-blob-content-language") String blobContentLanguage, @HeaderParam("x-ms-blob-content-md5") String blobContentMD5, @HeaderParam("x-ms-blob-cache-control") String blobCacheControl, @HeaderParam("x-ms-blob-content-disposition") String blobContentDisposition, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context); + Mono create(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-tags") String tags, @QueryParam("x-ms-encryption-key") String xMsEncryptionKey, @QueryParam("x-ms-encryption-key-sha256") String xMsEncryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType xMsEncryptionAlgorithm, @HeaderParam("x-ms-blob-content-length") long blobContentLength, @HeaderParam("x-ms-blob-sequence-number") Long blobSequenceNumber, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-blob-type") String blobType, @HeaderParam("x-ms-blob-content-type") String blobContentType, @HeaderParam("x-ms-blob-content-encoding") String blobContentEncoding, @HeaderParam("x-ms-blob-content-language") String blobContentLanguage, @HeaderParam("x-ms-blob-content-md5") String blobContentMD5, @HeaderParam("x-ms-blob-cache-control") String blobCacheControl, @HeaderParam("x-ms-blob-content-disposition") String blobContentDisposition, @HeaderParam("x-ms-lease-id") String leaseId, @QueryParam("x-ms-encryption-scope") String encryptionScope, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono uploadPages(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @BodyParam("application/octet-stream") Flux body, @HeaderParam("Content-Length") long contentLength, @HeaderParam("Content-MD5") String transactionalContentMD5, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-range") String range, @QueryParam("x-ms-encryption-key") String encryptionKey, @QueryParam("x-ms-encryption-key-sha256") String encryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-page-write") String pageWrite, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-if-sequence-number-le") Long ifSequenceNumberLessThanOrEqualTo, @HeaderParam("x-ms-if-sequence-number-lt") Long ifSequenceNumberLessThan, @HeaderParam("x-ms-if-sequence-number-eq") Long ifSequenceNumberEqualTo, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context); + Mono uploadPages(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @BodyParam("application/octet-stream") Flux body, @HeaderParam("Content-Length") long contentLength, @HeaderParam("Content-MD5") String transactionalContentMD5, @HeaderParam("x-ms-content-crc64") String transactionalContentCrc64, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-range") String range, @QueryParam("x-ms-encryption-key") String xMsEncryptionKey, @QueryParam("x-ms-encryption-key-sha256") String xMsEncryptionKeySha256, @QueryParam("x-ms-encryption-algorithm") EncryptionAlgorithmType xMsEncryptionAlgorithm, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-page-write") String pageWrite, @HeaderParam("x-ms-lease-id") String leaseId, @QueryParam("x-ms-encryption-scope") String encryptionScope, @HeaderParam("x-ms-if-sequence-number-le") Long ifSequenceNumberLessThanOrEqualTo, @HeaderParam("x-ms-if-sequence-number-lt") Long ifSequenceNumberLessThan, @HeaderParam("x-ms-if-sequence-number-eq") Long ifSequenceNumberEqualTo, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({201}) @@ -95,7 +96,7 @@ private interface PageBlobsService { @Put("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono uploadPagesFromURL(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @HeaderParam("x-ms-copy-source") URL copySource, @HeaderParam("x-ms-source-range") String sourceRange, @HeaderParam("x-ms-source-content-md5") String sourceContentMD5, @HeaderParam("Content-Length") long contentLength, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-page-write") String pageWrite, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-if-sequence-number-le") Long ifSequenceNumberLessThanOrEqualTo, @HeaderParam("x-ms-if-sequence-number-lt") Long ifSequenceNumberLessThan, @HeaderParam("x-ms-if-sequence-number-eq") Long ifSequenceNumberEqualTo, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, @HeaderParam("x-ms-source-if-match") String sourceIfMatch, @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, Context context); + Mono uploadPagesFromURL(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @HeaderParam("x-ms-copy-source") URL copySource, @HeaderParam("x-ms-source-range") String sourceRange, @HeaderParam("x-ms-source-content-md5") String sourceContentMD5, @HeaderParam("x-ms-source-content-crc64") String sourceContentcrc64, @HeaderParam("Content-Length") long contentLength, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-page-write") String pageWrite, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-if-sequence-number-le") Long ifSequenceNumberLessThanOrEqualTo, @HeaderParam("x-ms-if-sequence-number-lt") Long ifSequenceNumberLessThan, @HeaderParam("x-ms-if-sequence-number-eq") Long ifSequenceNumberEqualTo, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, @HeaderParam("x-ms-source-if-match") String sourceIfMatch, @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, Context context); @Get("{containerName}/{blob}") @ExpectedResponses({200}) @@ -138,9 +139,10 @@ private interface PageBlobsService { public Mono createWithRestResponseAsync(String containerName, String blob, long contentLength, long blobContentLength, Context context) { final Integer timeout = null; final Map metadata = null; - final String encryptionKey = null; - final String encryptionKeySha256 = null; - final EncryptionAlgorithmType encryptionAlgorithm = null; + final String tags = null; + final String xMsEncryptionKey = null; + final String xMsEncryptionKeySha256 = null; + final EncryptionAlgorithmType xMsEncryptionAlgorithm = null; final Long blobSequenceNumber = 0L; final String requestId = null; final String blobType = "PageBlob"; @@ -150,12 +152,13 @@ public Mono createWithRestResponseAsync(String containe final String blobCacheControl = null; final String blobContentDisposition = null; final String leaseId = null; + final String encryptionScope = null; final String ifMatch = null; final String ifNoneMatch = null; String blobContentMD5Converted = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.create(containerName, blob, this.client.getUrl(), timeout, contentLength, metadata, encryptionKey, encryptionKeySha256, encryptionAlgorithm, blobContentLength, blobSequenceNumber, this.client.getVersion(), requestId, blobType, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5Converted, blobCacheControl, blobContentDisposition, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); + return service.create(containerName, blob, this.client.getUrl(), timeout, contentLength, metadata, tags, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, blobContentLength, blobSequenceNumber, this.client.getVersion(), requestId, blobType, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5Converted, blobCacheControl, blobContentDisposition, leaseId, encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); } /** @@ -167,20 +170,22 @@ public Mono createWithRestResponseAsync(String containe * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned to a 512-byte boundary. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. - * @param encryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. - * @param encryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. - * @param encryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. + * @param tags Optional. A URL encoded query param string which specifies the tags to be created with the Blob object. e.g. TagName1=TagValue1&TagName2=TagValue2. The x-ms-tags header may contain up to 2kb of tags. + * @param xMsEncryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. + * @param xMsEncryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. + * @param xMsEncryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. * @param blobSequenceNumber Set for page blobs only. The sequence number is a user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. * @param blobHTTPHeaders Additional parameters for the operation. * @param leaseAccessConditions Additional parameters for the operation. + * @param customerProvidedKeyInfo Additional parameters for the operation. * @param modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createWithRestResponseAsync(String containerName, String blob, long contentLength, long blobContentLength, Integer timeout, Map metadata, String encryptionKey, String encryptionKeySha256, EncryptionAlgorithmType encryptionAlgorithm, Long blobSequenceNumber, String requestId, BlobHTTPHeaders blobHTTPHeaders, LeaseAccessConditions leaseAccessConditions, ModifiedAccessConditions modifiedAccessConditions, Context context) { + public Mono createWithRestResponseAsync(String containerName, String blob, long contentLength, long blobContentLength, Integer timeout, Map metadata, String tags, String xMsEncryptionKey, String xMsEncryptionKeySha256, EncryptionAlgorithmType xMsEncryptionAlgorithm, Long blobSequenceNumber, String requestId, BlobHTTPHeaders blobHTTPHeaders, LeaseAccessConditions leaseAccessConditions, CustomerProvidedKeyInfo customerProvidedKeyInfo, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String blobType = "PageBlob"; String blobContentType = null; if (blobHTTPHeaders != null) { @@ -210,6 +215,10 @@ public Mono createWithRestResponseAsync(String containe if (leaseAccessConditions != null) { leaseId = leaseAccessConditions.leaseId(); } + String encryptionScope = null; + if (customerProvidedKeyInfo != null) { + encryptionScope = customerProvidedKeyInfo.encryptionScope(); + } OffsetDateTime ifModifiedSince = null; if (modifiedAccessConditions != null) { ifModifiedSince = modifiedAccessConditions.ifModifiedSince(); @@ -229,7 +238,7 @@ public Mono createWithRestResponseAsync(String containe String blobContentMD5Converted = Base64Util.encodeToString(blobContentMD5); DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.create(containerName, blob, this.client.getUrl(), timeout, contentLength, metadata, encryptionKey, encryptionKeySha256, encryptionAlgorithm, blobContentLength, blobSequenceNumber, this.client.getVersion(), requestId, blobType, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5Converted, blobCacheControl, blobContentDisposition, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); + return service.create(containerName, blob, this.client.getUrl(), timeout, contentLength, metadata, tags, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, blobContentLength, blobSequenceNumber, this.client.getVersion(), requestId, blobType, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5Converted, blobCacheControl, blobContentDisposition, leaseId, encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); } /** @@ -247,22 +256,24 @@ public Mono createWithRestResponseAsync(String containe public Mono uploadPagesWithRestResponseAsync(String containerName, String blob, Flux body, long contentLength, Context context) { final Integer timeout = null; final String range = null; - final String encryptionKey = null; - final String encryptionKeySha256 = null; - final EncryptionAlgorithmType encryptionAlgorithm = null; + final String xMsEncryptionKey = null; + final String xMsEncryptionKeySha256 = null; + final EncryptionAlgorithmType xMsEncryptionAlgorithm = null; final String requestId = null; final String comp = "page"; final String pageWrite = "update"; final String leaseId = null; + final String encryptionScope = null; final Long ifSequenceNumberLessThanOrEqualTo = null; final Long ifSequenceNumberLessThan = null; final Long ifSequenceNumberEqualTo = null; final String ifMatch = null; final String ifNoneMatch = null; String transactionalContentMD5Converted = null; + String transactionalContentCrc64Converted = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.uploadPages(containerName, blob, this.client.getUrl(), body, contentLength, transactionalContentMD5Converted, timeout, range, encryptionKey, encryptionKeySha256, encryptionAlgorithm, this.client.getVersion(), requestId, comp, pageWrite, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); + return service.uploadPages(containerName, blob, this.client.getUrl(), body, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, range, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, this.client.getVersion(), requestId, comp, pageWrite, leaseId, encryptionScope, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); } /** @@ -273,13 +284,15 @@ public Mono uploadPagesWithRestResponseAsync(Strin * @param body Initial data. * @param contentLength The length of the request. * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. + * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. * @param range Return only the bytes of the blob in the specified range. - * @param encryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. - * @param encryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. - * @param encryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. + * @param xMsEncryptionKey Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services. + * @param xMsEncryptionKeySha256 The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided. + * @param xMsEncryptionAlgorithm The algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. Possible values include: 'AES256'. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. * @param leaseAccessConditions Additional parameters for the operation. + * @param customerProvidedKeyInfo Additional parameters for the operation. * @param sequenceNumberAccessConditions Additional parameters for the operation. * @param modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. @@ -287,13 +300,17 @@ public Mono uploadPagesWithRestResponseAsync(Strin * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono uploadPagesWithRestResponseAsync(String containerName, String blob, Flux body, long contentLength, byte[] transactionalContentMD5, Integer timeout, String range, String encryptionKey, String encryptionKeySha256, EncryptionAlgorithmType encryptionAlgorithm, String requestId, LeaseAccessConditions leaseAccessConditions, SequenceNumberAccessConditions sequenceNumberAccessConditions, ModifiedAccessConditions modifiedAccessConditions, Context context) { + public Mono uploadPagesWithRestResponseAsync(String containerName, String blob, Flux body, long contentLength, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Integer timeout, String range, String xMsEncryptionKey, String xMsEncryptionKeySha256, EncryptionAlgorithmType xMsEncryptionAlgorithm, String requestId, LeaseAccessConditions leaseAccessConditions, CustomerProvidedKeyInfo customerProvidedKeyInfo, SequenceNumberAccessConditions sequenceNumberAccessConditions, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String comp = "page"; final String pageWrite = "update"; String leaseId = null; if (leaseAccessConditions != null) { leaseId = leaseAccessConditions.leaseId(); } + String encryptionScope = null; + if (customerProvidedKeyInfo != null) { + encryptionScope = customerProvidedKeyInfo.encryptionScope(); + } Long ifSequenceNumberLessThanOrEqualTo = null; if (sequenceNumberAccessConditions != null) { ifSequenceNumberLessThanOrEqualTo = sequenceNumberAccessConditions.ifSequenceNumberLessThanOrEqualTo(); @@ -323,9 +340,10 @@ public Mono uploadPagesWithRestResponseAsync(Strin ifNoneMatch = modifiedAccessConditions.ifNoneMatch(); } String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); + String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.uploadPages(containerName, blob, this.client.getUrl(), body, contentLength, transactionalContentMD5Converted, timeout, range, encryptionKey, encryptionKeySha256, encryptionAlgorithm, this.client.getVersion(), requestId, comp, pageWrite, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); + return service.uploadPages(containerName, blob, this.client.getUrl(), body, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, range, xMsEncryptionKey, xMsEncryptionKeySha256, xMsEncryptionAlgorithm, this.client.getVersion(), requestId, comp, pageWrite, leaseId, encryptionScope, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, context); } /** @@ -441,11 +459,12 @@ public Mono uploadPagesFromURLWithRestRespo final String sourceIfMatch = null; final String sourceIfNoneMatch = null; String sourceContentMD5Converted = null; + String sourceContentcrc64Converted = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; DateTimeRfc1123 sourceIfModifiedSinceConverted = null; DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = null; - return service.uploadPagesFromURL(containerName, blob, this.client.getUrl(), sourceUrl, sourceRange, sourceContentMD5Converted, contentLength, timeout, range, this.client.getVersion(), requestId, comp, pageWrite, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, context); + return service.uploadPagesFromURL(containerName, blob, this.client.getUrl(), sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, contentLength, timeout, range, this.client.getVersion(), requestId, comp, pageWrite, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, context); } /** @@ -458,6 +477,7 @@ public Mono uploadPagesFromURLWithRestRespo * @param contentLength The length of the request. * @param range The range of bytes to which the source range would be written. The range should be 512 aligned and range-end is required. * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. + * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy source. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. * @param leaseAccessConditions Additional parameters for the operation. @@ -469,7 +489,7 @@ public Mono uploadPagesFromURLWithRestRespo * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono uploadPagesFromURLWithRestResponseAsync(String containerName, String blob, URL sourceUrl, String sourceRange, long contentLength, String range, byte[] sourceContentMD5, Integer timeout, String requestId, LeaseAccessConditions leaseAccessConditions, SequenceNumberAccessConditions sequenceNumberAccessConditions, ModifiedAccessConditions modifiedAccessConditions, SourceModifiedAccessConditions sourceModifiedAccessConditions, Context context) { + public Mono uploadPagesFromURLWithRestResponseAsync(String containerName, String blob, URL sourceUrl, String sourceRange, long contentLength, String range, byte[] sourceContentMD5, byte[] sourceContentcrc64, Integer timeout, String requestId, LeaseAccessConditions leaseAccessConditions, SequenceNumberAccessConditions sequenceNumberAccessConditions, ModifiedAccessConditions modifiedAccessConditions, SourceModifiedAccessConditions sourceModifiedAccessConditions, Context context) { final String comp = "page"; final String pageWrite = "update"; String leaseId = null; @@ -521,11 +541,12 @@ public Mono uploadPagesFromURLWithRestRespo sourceIfNoneMatch = sourceModifiedAccessConditions.sourceIfNoneMatch(); } String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); + String sourceContentcrc64Converted = Base64Util.encodeToString(sourceContentcrc64); DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 sourceIfModifiedSinceConverted = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - return service.uploadPagesFromURL(containerName, blob, this.client.getUrl(), sourceUrl, sourceRange, sourceContentMD5Converted, contentLength, timeout, range, this.client.getVersion(), requestId, comp, pageWrite, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, context); + return service.uploadPagesFromURL(containerName, blob, this.client.getUrl(), sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, contentLength, timeout, range, this.client.getVersion(), requestId, comp, pageWrite, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, context); } /** diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ServicesImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ServicesImpl.java index 5d77ec9bcee0..c3cddbd66fa2 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ServicesImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ServicesImpl.java @@ -21,6 +21,7 @@ import com.azure.core.util.Context; import com.azure.storage.blob.models.KeyInfo; import com.azure.storage.blob.models.ListContainersIncludeType; +import com.azure.storage.blob.models.ServicesFilterBlobsResponse; import com.azure.storage.blob.models.ServicesGetAccountInfoResponse; import com.azure.storage.blob.models.ServicesGetPropertiesResponse; import com.azure.storage.blob.models.ServicesGetStatisticsResponse; @@ -81,7 +82,7 @@ private interface ServicesService { @Get("") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono listContainersSegment(@HostParam("url") String url, @QueryParam("prefix") String prefix, @QueryParam("marker") String marker, @QueryParam("maxresults") Integer maxresults, @QueryParam("include") ListContainersIncludeType include, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, Context context); + Mono listContainersSegment(@HostParam("url") String url, @QueryParam("prefix") String prefix, @QueryParam("marker") String marker1, @QueryParam("maxresults") Integer maxresults, @QueryParam("include") ListContainersIncludeType include, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, Context context); @Post("") @ExpectedResponses({200}) @@ -92,6 +93,11 @@ private interface ServicesService { @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) Mono getAccountInfo(@HostParam("url") String url, @HeaderParam("x-ms-version") String version, @QueryParam("restype") String restype, @QueryParam("comp") String comp, Context context); + + @Get("") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageErrorException.class) + Mono filterBlobs(@HostParam("url") String url, @QueryParam("marker") String marker1, @QueryParam("maxresults") Integer maxresults, @QueryParam("filter") String filter, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, Context context); } /** @@ -277,4 +283,38 @@ public Mono getAccountInfoWithRestResponseAsync( final String comp = "properties"; return service.getAccountInfo(this.client.getUrl(), this.client.getVersion(), restype, comp, context); } + + /** + * The Filter Blobs operation enables callers to list blobs in an account whose tags match a given search expression. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a Mono which performs the network request upon subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono filterBlobsWithRestResponseAsync(Context context) { + final String marker = null; + final Integer maxresults = null; + final Integer timeout = null; + final String requestId = null; + final String comp = "blobs"; + return service.filterBlobs(this.client.getUrl(), marker, maxresults, this.client.getFilter(), timeout, this.client.getVersion(), requestId, comp, context); + } + + /** + * The Filter Blobs operation enables callers to list blobs in an account whose tags match a given search expression. + * + * @param marker A string value that identifies the portion of the list of containers to be returned with the next listing operation. The operation returns the NextMarker value within the response body if the listing operation did not return all containers remaining to be listed with the current page. The NextMarker value can be used as the value for the marker parameter in a subsequent call to request the next page of list items. The marker value is opaque to the client. + * @param maxresults Specifies the maximum number of containers to return. If the request does not specify maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the listing operation crosses a partition boundary, then the service will return a continuation token for retrieving the remainder of the results. For this reason, it is possible that the service will return fewer results than specified by maxresults, or than the default of 5000. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a Mono which performs the network request upon subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono filterBlobsWithRestResponseAsync(String marker, Integer maxresults, Integer timeout, String requestId, Context context) { + final String comp = "blobs"; + return service.filterBlobs(this.client.getUrl(), marker, maxresults, this.client.getFilter(), timeout, this.client.getVersion(), requestId, comp, context); + } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AccessTierOptional.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AccessTierOptional.java new file mode 100644 index 000000000000..55a3a7703d98 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AccessTierOptional.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines values for AccessTierOptional. + */ +public final class AccessTierOptional extends ExpandableStringEnum { + /** + * Static value Hot for AccessTierOptional. + */ + public static final AccessTierOptional HOT = fromString("Hot"); + + /** + * Static value Cool for AccessTierOptional. + */ + public static final AccessTierOptional COOL = fromString("Cool"); + + /** + * Static value Archive for AccessTierOptional. + */ + public static final AccessTierOptional ARCHIVE = fromString("Archive"); + + /** + * Creates or finds a AccessTierOptional from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessTierOptional. + */ + @JsonCreator + public static AccessTierOptional fromString(String name) { + return fromString(name, AccessTierOptional.class); + } + + /** + * @return known AccessTierOptional values. + */ + public static Collection values() { + return values(AccessTierOptional.class); + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AccessTierRequired.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AccessTierRequired.java new file mode 100644 index 000000000000..821302c1cd83 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AccessTierRequired.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines values for AccessTierRequired. + */ +public final class AccessTierRequired extends ExpandableStringEnum { + /** + * Static value P4 for AccessTierRequired. + */ + public static final AccessTierRequired P4 = fromString("P4"); + + /** + * Static value P6 for AccessTierRequired. + */ + public static final AccessTierRequired P6 = fromString("P6"); + + /** + * Static value P10 for AccessTierRequired. + */ + public static final AccessTierRequired P10 = fromString("P10"); + + /** + * Static value P20 for AccessTierRequired. + */ + public static final AccessTierRequired P20 = fromString("P20"); + + /** + * Static value P30 for AccessTierRequired. + */ + public static final AccessTierRequired P30 = fromString("P30"); + + /** + * Static value P40 for AccessTierRequired. + */ + public static final AccessTierRequired P40 = fromString("P40"); + + /** + * Static value P50 for AccessTierRequired. + */ + public static final AccessTierRequired P50 = fromString("P50"); + + /** + * Static value Hot for AccessTierRequired. + */ + public static final AccessTierRequired HOT = fromString("Hot"); + + /** + * Static value Cool for AccessTierRequired. + */ + public static final AccessTierRequired COOL = fromString("Cool"); + + /** + * Static value Archive for AccessTierRequired. + */ + public static final AccessTierRequired ARCHIVE = fromString("Archive"); + + /** + * Creates or finds a AccessTierRequired from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessTierRequired. + */ + @JsonCreator + public static AccessTierRequired fromString(String name) { + return fromString(name, AccessTierRequired.class); + } + + /** + * @return known AccessTierRequired values. + */ + public static Collection values() { + return values(AccessTierRequired.class); + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AppendBlobAppendBlockFromUrlHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AppendBlobAppendBlockFromUrlHeaders.java index 8dcea49cd76c..509acba0c155 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AppendBlobAppendBlockFromUrlHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AppendBlobAppendBlockFromUrlHeaders.java @@ -41,6 +41,14 @@ public final class AppendBlobAppendBlockFromUrlHeaders { @JsonProperty(value = "Content-MD5") private byte[] contentMD5; + /* + * This header is returned so that the client can check for message content + * integrity. The value of this header is computed by the Blob service; it + * is not necessarily the same value specified in the request headers. + */ + @JsonProperty(value = "x-ms-content-crc64") + private byte[] xMsContentCrc64; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -164,6 +172,32 @@ public AppendBlobAppendBlockFromUrlHeaders contentMD5(byte[] contentMD5) { return this; } + /** + * Get the xMsContentCrc64 property: This header is returned so that the + * client can check for message content integrity. The value of this header + * is computed by the Blob service; it is not necessarily the same value + * specified in the request headers. + * + * @return the xMsContentCrc64 value. + */ + public byte[] xMsContentCrc64() { + return ImplUtils.clone(this.xMsContentCrc64); + } + + /** + * Set the xMsContentCrc64 property: This header is returned so that the + * client can check for message content integrity. The value of this header + * is computed by the Blob service; it is not necessarily the same value + * specified in the request headers. + * + * @param xMsContentCrc64 the xMsContentCrc64 value to set. + * @return the AppendBlobAppendBlockFromUrlHeaders object itself. + */ + public AppendBlobAppendBlockFromUrlHeaders xMsContentCrc64(byte[] xMsContentCrc64) { + this.xMsContentCrc64 = ImplUtils.clone(xMsContentCrc64); + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AppendBlobAppendBlockHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AppendBlobAppendBlockHeaders.java index a12cefa924e6..61d2450a114d 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AppendBlobAppendBlockHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AppendBlobAppendBlockHeaders.java @@ -41,6 +41,21 @@ public final class AppendBlobAppendBlockHeaders { @JsonProperty(value = "Content-MD5") private byte[] contentMD5; + /* + * This header is returned so that the client can check for message content + * integrity. The value of this header is computed by the Blob service; it + * is not necessarily the same value specified in the request headers. + */ + @JsonProperty(value = "x-ms-content-crc64") + private byte[] xMsContentCrc64; + + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -93,6 +108,14 @@ public final class AppendBlobAppendBlockHeaders { @JsonProperty(value = "x-ms-encryption-key-sha256") private String encryptionKeySha256; + /* + * The encryption scope used to encrypt the block. This header is only + * returned when the block was encrypted with customer specified + * encryption. + */ + @JsonProperty(value = "x-ms-encryption-scope") + private String encryptionScope; + /* * The errorCode property. */ @@ -180,6 +203,56 @@ public AppendBlobAppendBlockHeaders contentMD5(byte[] contentMD5) { return this; } + /** + * Get the xMsContentCrc64 property: This header is returned so that the + * client can check for message content integrity. The value of this header + * is computed by the Blob service; it is not necessarily the same value + * specified in the request headers. + * + * @return the xMsContentCrc64 value. + */ + public byte[] xMsContentCrc64() { + return ImplUtils.clone(this.xMsContentCrc64); + } + + /** + * Set the xMsContentCrc64 property: This header is returned so that the + * client can check for message content integrity. The value of this header + * is computed by the Blob service; it is not necessarily the same value + * specified in the request headers. + * + * @param xMsContentCrc64 the xMsContentCrc64 value to set. + * @return the AppendBlobAppendBlockHeaders object itself. + */ + public AppendBlobAppendBlockHeaders xMsContentCrc64(byte[] xMsContentCrc64) { + this.xMsContentCrc64 = ImplUtils.clone(xMsContentCrc64); + return this; + } + + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the AppendBlobAppendBlockHeaders object itself. + */ + public AppendBlobAppendBlockHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. @@ -349,6 +422,30 @@ public AppendBlobAppendBlockHeaders encryptionKeySha256(String encryptionKeySha2 return this; } + /** + * Get the encryptionScope property: The encryption scope used to encrypt + * the block. This header is only returned when the block was encrypted + * with customer specified encryption. + * + * @return the encryptionScope value. + */ + public String encryptionScope() { + return this.encryptionScope; + } + + /** + * Set the encryptionScope property: The encryption scope used to encrypt + * the block. This header is only returned when the block was encrypted + * with customer specified encryption. + * + * @param encryptionScope the encryptionScope value to set. + * @return the AppendBlobAppendBlockHeaders object itself. + */ + public AppendBlobAppendBlockHeaders encryptionScope(String encryptionScope) { + this.encryptionScope = encryptionScope; + return this; + } + /** * Get the errorCode property: The errorCode property. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AppendBlobCreateHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AppendBlobCreateHeaders.java index c2e5a3e0929e..77af78187b8e 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AppendBlobCreateHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AppendBlobCreateHeaders.java @@ -41,6 +41,13 @@ public final class AppendBlobCreateHeaders { @JsonProperty(value = "Content-MD5") private byte[] contentMD5; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -87,6 +94,13 @@ public final class AppendBlobCreateHeaders { @JsonProperty(value = "x-ms-encryption-key-sha256") private String encryptionKeySha256; + /* + * The encryption scope used to encrypt the blob. This header is only + * returned when the blob was encrypted with customer specified encryption. + */ + @JsonProperty(value = "x-ms-encryption-scope") + private String encryptionScope; + /* * The errorCode property. */ @@ -174,6 +188,30 @@ public AppendBlobCreateHeaders contentMD5(byte[] contentMD5) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the AppendBlobCreateHeaders object itself. + */ + public AppendBlobCreateHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. @@ -321,6 +359,30 @@ public AppendBlobCreateHeaders encryptionKeySha256(String encryptionKeySha256) { return this; } + /** + * Get the encryptionScope property: The encryption scope used to encrypt + * the blob. This header is only returned when the blob was encrypted with + * customer specified encryption. + * + * @return the encryptionScope value. + */ + public String encryptionScope() { + return this.encryptionScope; + } + + /** + * Set the encryptionScope property: The encryption scope used to encrypt + * the blob. This header is only returned when the blob was encrypted with + * customer specified encryption. + * + * @param encryptionScope the encryptionScope value to set. + * @return the AppendBlobCreateHeaders object itself. + */ + public AppendBlobCreateHeaders encryptionScope(String encryptionScope) { + this.encryptionScope = encryptionScope; + return this; + } + /** * Get the errorCode property: The errorCode property. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobAbortCopyFromURLHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobAbortCopyFromURLHeaders.java index c27f9fcac790..0dc5cbb43392 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobAbortCopyFromURLHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobAbortCopyFromURLHeaders.java @@ -16,6 +16,13 @@ @JacksonXmlRootElement(localName = "Blob-AbortCopyFromURL-Headers") @Fluent public final class BlobAbortCopyFromURLHeaders { + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -44,6 +51,30 @@ public final class BlobAbortCopyFromURLHeaders { @JsonProperty(value = "x-ms-error-code") private String errorCode; + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlobAbortCopyFromURLHeaders object itself. + */ + public BlobAbortCopyFromURLHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobAcquireLeaseHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobAcquireLeaseHeaders.java index d4649062bc60..0d986bc95d22 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobAcquireLeaseHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobAcquireLeaseHeaders.java @@ -38,6 +38,13 @@ public final class BlobAcquireLeaseHeaders { @JsonProperty(value = "x-ms-lease-id") private String leaseId; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -143,6 +150,30 @@ public BlobAcquireLeaseHeaders leaseId(String leaseId) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlobAcquireLeaseHeaders object itself. + */ + public BlobAcquireLeaseHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobBreakLeaseHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobBreakLeaseHeaders.java index 504b7201befe..ba1ba989e108 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobBreakLeaseHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobBreakLeaseHeaders.java @@ -38,6 +38,13 @@ public final class BlobBreakLeaseHeaders { @JsonProperty(value = "x-ms-lease-time") private Integer leaseTime; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -145,6 +152,30 @@ public BlobBreakLeaseHeaders leaseTime(Integer leaseTime) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlobBreakLeaseHeaders object itself. + */ + public BlobBreakLeaseHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobChangeLeaseHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobChangeLeaseHeaders.java index 67d6971d9ff3..e8ffbec32efd 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobChangeLeaseHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobChangeLeaseHeaders.java @@ -32,6 +32,13 @@ public final class BlobChangeLeaseHeaders { @JsonProperty(value = "Last-Modified") private DateTimeRfc1123 lastModified; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -123,6 +130,30 @@ public BlobChangeLeaseHeaders lastModified(OffsetDateTime lastModified) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlobChangeLeaseHeaders object itself. + */ + public BlobChangeLeaseHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobCopyFromURLHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobCopyFromURLHeaders.java index 140b771f8cd6..c584184a7a0c 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobCopyFromURLHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobCopyFromURLHeaders.java @@ -32,6 +32,13 @@ public final class BlobCopyFromURLHeaders { @JsonProperty(value = "Last-Modified") private DateTimeRfc1123 lastModified; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -138,6 +145,30 @@ public BlobCopyFromURLHeaders lastModified(OffsetDateTime lastModified) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlobCopyFromURLHeaders object itself. + */ + public BlobCopyFromURLHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobCreateSnapshotHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobCreateSnapshotHeaders.java index e27c4fde4964..7d4778cd49df 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobCreateSnapshotHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobCreateSnapshotHeaders.java @@ -39,6 +39,13 @@ public final class BlobCreateSnapshotHeaders { @JsonProperty(value = "Last-Modified") private DateTimeRfc1123 lastModified; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -86,6 +93,14 @@ public final class BlobCreateSnapshotHeaders { @JsonProperty(value = "x-ms-encryption-key-sha256") private String encryptionKeySha256; + /* + * The encryption scope used to encrypt the source blob. This header is + * only returned when the blob was encrypted with customer specified + * encryption. + */ + @JsonProperty(value = "x-ms-encryption-scope") + private String encryptionScope; + /* * The errorCode property. */ @@ -173,6 +188,30 @@ public BlobCreateSnapshotHeaders lastModified(OffsetDateTime lastModified) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlobCreateSnapshotHeaders object itself. + */ + public BlobCreateSnapshotHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. @@ -324,6 +363,30 @@ public BlobCreateSnapshotHeaders encryptionKeySha256(String encryptionKeySha256) return this; } + /** + * Get the encryptionScope property: The encryption scope used to encrypt + * the source blob. This header is only returned when the blob was + * encrypted with customer specified encryption. + * + * @return the encryptionScope value. + */ + public String encryptionScope() { + return this.encryptionScope; + } + + /** + * Set the encryptionScope property: The encryption scope used to encrypt + * the source blob. This header is only returned when the blob was + * encrypted with customer specified encryption. + * + * @param encryptionScope the encryptionScope value to set. + * @return the BlobCreateSnapshotHeaders object itself. + */ + public BlobCreateSnapshotHeaders encryptionScope(String encryptionScope) { + this.encryptionScope = encryptionScope; + return this; + } + /** * Get the errorCode property: The errorCode property. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobDeleteHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobDeleteHeaders.java index 95e6289c3e40..0e4c48ffc536 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobDeleteHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobDeleteHeaders.java @@ -16,6 +16,13 @@ @JacksonXmlRootElement(localName = "Blob-Delete-Headers") @Fluent public final class BlobDeleteHeaders { + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -44,6 +51,30 @@ public final class BlobDeleteHeaders { @JsonProperty(value = "x-ms-error-code") private String errorCode; + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlobDeleteHeaders object itself. + */ + public BlobDeleteHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobDownloadHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobDownloadHeaders.java index 4e9e2997ebab..255b428f1e8e 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobDownloadHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobDownloadHeaders.java @@ -196,6 +196,13 @@ public final class BlobDownloadHeaders { @JsonProperty(value = "x-ms-lease-status") private LeaseStatusType leaseStatus; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -248,6 +255,13 @@ public final class BlobDownloadHeaders { @JsonProperty(value = "x-ms-encryption-key-sha256") private String encryptionKeySha256; + /* + * The encryption scope used to encrypt the blob. This header is only + * returned when the blob was encrypted with customer specified encryption. + */ + @JsonProperty(value = "x-ms-encryption-scope") + private String encryptionScope; + /* * If the blob has a MD5 hash, and if request contains range header (Range * or x-ms-range), this response header is returned with the value of the @@ -258,6 +272,22 @@ public final class BlobDownloadHeaders { @JsonProperty(value = "x-ms-blob-content-md5") private byte[] blobContentMD5; + /* + * The number of tags corresponding to the blob. + */ + @JsonProperty(value = "x-ms-tag-count") + private Integer tagCount; + + /* + * If the request is to read a specified range and the + * x-ms-range-get-content-crc64 is set to true, then the request returns a + * crc64 for the range, as long as the range size is less than or equal to + * 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 + * is specified in the same request, it will fail with 400(Bad Request) + */ + @JsonProperty(value = "x-ms-content-crc64") + private byte[] contentCrc64; + /* * The errorCode property. */ @@ -824,6 +854,30 @@ public BlobDownloadHeaders leaseStatus(LeaseStatusType leaseStatus) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlobDownloadHeaders object itself. + */ + public BlobDownloadHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. @@ -995,6 +1049,30 @@ public BlobDownloadHeaders encryptionKeySha256(String encryptionKeySha256) { return this; } + /** + * Get the encryptionScope property: The encryption scope used to encrypt + * the blob. This header is only returned when the blob was encrypted with + * customer specified encryption. + * + * @return the encryptionScope value. + */ + public String encryptionScope() { + return this.encryptionScope; + } + + /** + * Set the encryptionScope property: The encryption scope used to encrypt + * the blob. This header is only returned when the blob was encrypted with + * customer specified encryption. + * + * @param encryptionScope the encryptionScope value to set. + * @return the BlobDownloadHeaders object itself. + */ + public BlobDownloadHeaders encryptionScope(String encryptionScope) { + this.encryptionScope = encryptionScope; + return this; + } + /** * Get the blobContentMD5 property: If the blob has a MD5 hash, and if * request contains range header (Range or x-ms-range), this response @@ -1023,6 +1101,56 @@ public BlobDownloadHeaders blobContentMD5(byte[] blobContentMD5) { return this; } + /** + * Get the tagCount property: The number of tags corresponding to the blob. + * + * @return the tagCount value. + */ + public Integer tagCount() { + return this.tagCount; + } + + /** + * Set the tagCount property: The number of tags corresponding to the blob. + * + * @param tagCount the tagCount value to set. + * @return the BlobDownloadHeaders object itself. + */ + public BlobDownloadHeaders tagCount(Integer tagCount) { + this.tagCount = tagCount; + return this; + } + + /** + * Get the contentCrc64 property: If the request is to read a specified + * range and the x-ms-range-get-content-crc64 is set to true, then the + * request returns a crc64 for the range, as long as the range size is less + * than or equal to 4 MB. If both x-ms-range-get-content-crc64 & + * x-ms-range-get-content-md5 is specified in the same request, it will + * fail with 400(Bad Request). + * + * @return the contentCrc64 value. + */ + public byte[] contentCrc64() { + return ImplUtils.clone(this.contentCrc64); + } + + /** + * Set the contentCrc64 property: If the request is to read a specified + * range and the x-ms-range-get-content-crc64 is set to true, then the + * request returns a crc64 for the range, as long as the range size is less + * than or equal to 4 MB. If both x-ms-range-get-content-crc64 & + * x-ms-range-get-content-md5 is specified in the same request, it will + * fail with 400(Bad Request). + * + * @param contentCrc64 the contentCrc64 value to set. + * @return the BlobDownloadHeaders object itself. + */ + public BlobDownloadHeaders contentCrc64(byte[] contentCrc64) { + this.contentCrc64 = ImplUtils.clone(contentCrc64); + return this; + } + /** * Get the errorCode property: The errorCode property. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobGetAccountInfoHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobGetAccountInfoHeaders.java index 21243aaac732..61acd7944cc9 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobGetAccountInfoHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobGetAccountInfoHeaders.java @@ -16,6 +16,13 @@ @JacksonXmlRootElement(localName = "Blob-GetAccountInfo-Headers") @Fluent public final class BlobGetAccountInfoHeaders { + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -59,6 +66,30 @@ public final class BlobGetAccountInfoHeaders { @JsonProperty(value = "x-ms-error-code") private String errorCode; + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlobGetAccountInfoHeaders object itself. + */ + public BlobGetAccountInfoHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobGetPropertiesHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobGetPropertiesHeaders.java index 728ae5fd9e1e..a09003611a5f 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobGetPropertiesHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobGetPropertiesHeaders.java @@ -209,6 +209,13 @@ public final class BlobGetPropertiesHeaders { @JsonProperty(value = "x-ms-blob-sequence-number") private Long blobSequenceNumber; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -261,6 +268,14 @@ public final class BlobGetPropertiesHeaders { @JsonProperty(value = "x-ms-encryption-key-sha256") private String encryptionKeySha256; + /* + * The encryption scope used to encrypt the metadata. This header is only + * returned when the metadata was encrypted with customer specified + * encryption. + */ + @JsonProperty(value = "x-ms-encryption-scope") + private String encryptionScope; + /* * The tier of page blob on a premium storage account or tier of block blob * on blob storage LRS accounts. For a list of allowed premium page blob @@ -295,6 +310,12 @@ public final class BlobGetPropertiesHeaders { @JsonProperty(value = "x-ms-access-tier-change-time") private DateTimeRfc1123 accessTierChangeTime; + /* + * The number of tags corresponding to the blob. + */ + @JsonProperty(value = "x-ms-tag-count") + private Integer tagCount; + /* * The errorCode property. */ @@ -914,6 +935,30 @@ public BlobGetPropertiesHeaders blobSequenceNumber(Long blobSequenceNumber) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlobGetPropertiesHeaders object itself. + */ + public BlobGetPropertiesHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. @@ -1085,6 +1130,30 @@ public BlobGetPropertiesHeaders encryptionKeySha256(String encryptionKeySha256) return this; } + /** + * Get the encryptionScope property: The encryption scope used to encrypt + * the metadata. This header is only returned when the metadata was + * encrypted with customer specified encryption. + * + * @return the encryptionScope value. + */ + public String encryptionScope() { + return this.encryptionScope; + } + + /** + * Set the encryptionScope property: The encryption scope used to encrypt + * the metadata. This header is only returned when the metadata was + * encrypted with customer specified encryption. + * + * @param encryptionScope the encryptionScope value to set. + * @return the BlobGetPropertiesHeaders object itself. + */ + public BlobGetPropertiesHeaders encryptionScope(String encryptionScope) { + this.encryptionScope = encryptionScope; + return this; + } + /** * Get the accessTier property: The tier of page blob on a premium storage * account or tier of block blob on blob storage LRS accounts. For a list @@ -1198,6 +1267,26 @@ public BlobGetPropertiesHeaders accessTierChangeTime(OffsetDateTime accessTierCh return this; } + /** + * Get the tagCount property: The number of tags corresponding to the blob. + * + * @return the tagCount value. + */ + public Integer tagCount() { + return this.tagCount; + } + + /** + * Set the tagCount property: The number of tags corresponding to the blob. + * + * @param tagCount the tagCount value to set. + * @return the BlobGetPropertiesHeaders object itself. + */ + public BlobGetPropertiesHeaders tagCount(Integer tagCount) { + this.tagCount = tagCount; + return this; + } + /** * Get the errorCode property: The errorCode property. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobGetTagsHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobGetTagsHeaders.java new file mode 100644 index 000000000000..62de1e897127 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobGetTagsHeaders.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.implementation.DateTimeRfc1123; +import com.azure.core.implementation.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.time.OffsetDateTime; + +/** + * Defines headers for GetTags operation. + */ +@JacksonXmlRootElement(localName = "Blob-GetTags-Headers") +@Fluent +public final class BlobGetTagsHeaders { + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + + /* + * This header uniquely identifies the request that was made and can be + * used for troubleshooting the request. + */ + @JsonProperty(value = "x-ms-request-id") + private String requestId; + + /* + * Indicates the version of the Blob service used to execute the request. + * This header is returned for requests made against version 2009-09-19 and + * above. + */ + @JsonProperty(value = "x-ms-version") + private String version; + + /* + * UTC date/time value generated by the service that indicates the time at + * which the response was initiated + */ + @JsonProperty(value = "Date") + private DateTimeRfc1123 dateProperty; + + /* + * The errorCode property. + */ + @JsonProperty(value = "x-ms-error-code") + private String errorCode; + + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlobGetTagsHeaders object itself. + */ + public BlobGetTagsHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + + /** + * Get the requestId property: This header uniquely identifies the request + * that was made and can be used for troubleshooting the request. + * + * @return the requestId value. + */ + public String requestId() { + return this.requestId; + } + + /** + * Set the requestId property: This header uniquely identifies the request + * that was made and can be used for troubleshooting the request. + * + * @param requestId the requestId value to set. + * @return the BlobGetTagsHeaders object itself. + */ + public BlobGetTagsHeaders requestId(String requestId) { + this.requestId = requestId; + return this; + } + + /** + * Get the version property: Indicates the version of the Blob service used + * to execute the request. This header is returned for requests made + * against version 2009-09-19 and above. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Indicates the version of the Blob service used + * to execute the request. This header is returned for requests made + * against version 2009-09-19 and above. + * + * @param version the version value to set. + * @return the BlobGetTagsHeaders object itself. + */ + public BlobGetTagsHeaders version(String version) { + this.version = version; + return this; + } + + /** + * Get the dateProperty property: UTC date/time value generated by the + * service that indicates the time at which the response was initiated. + * + * @return the dateProperty value. + */ + public OffsetDateTime dateProperty() { + if (this.dateProperty == null) { + return null; + } + return this.dateProperty.dateTime(); + } + + /** + * Set the dateProperty property: UTC date/time value generated by the + * service that indicates the time at which the response was initiated. + * + * @param dateProperty the dateProperty value to set. + * @return the BlobGetTagsHeaders object itself. + */ + public BlobGetTagsHeaders dateProperty(OffsetDateTime dateProperty) { + if (dateProperty == null) { + this.dateProperty = null; + } else { + this.dateProperty = new DateTimeRfc1123(dateProperty); + } + return this; + } + + /** + * Get the errorCode property: The errorCode property. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: The errorCode property. + * + * @param errorCode the errorCode value to set. + * @return the BlobGetTagsHeaders object itself. + */ + public BlobGetTagsHeaders errorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItem.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItem.java index 3d777a4b2e38..41b8d278c7e4 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItem.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItem.java @@ -51,6 +51,12 @@ public final class BlobItem { @JsonProperty(value = "Metadata") private Map metadata; + /* + * The tags property. + */ + @JsonProperty(value = "Tags") + private BlobTags tags; + /* * The isPrefix property. */ @@ -177,6 +183,26 @@ public BlobItem metadata(Map metadata) { return this; } + /** + * Get the tags property: The tags property. + * + * @return the tags value. + */ + public BlobTags tags() { + return this.tags; + } + + /** + * Set the tags property: The tags property. + * + * @param tags the tags value to set. + * @return the BlobItem object itself. + */ + public BlobItem tags(BlobTags tags) { + this.tags = tags; + return this; + } + /** * Get the isPrefix property: The isPrefix property. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobProperties.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobProperties.java index d5bad7b9996e..0438f3f441f6 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobProperties.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobProperties.java @@ -200,12 +200,24 @@ public final class BlobProperties { @JsonProperty(value = "CustomerProvidedKeySha256") private String customerProvidedKeySha256; + /* + * The encryptionScope property. + */ + @JsonProperty(value = "EncryptionScope") + private String encryptionScope; + /* * The accessTierChangeTime property. */ @JsonProperty(value = "AccessTierChangeTime") private DateTimeRfc1123 accessTierChangeTime; + /* + * The number of tags corresponding to the blob. + */ + @JsonProperty(value = "TagCount", required = true) + private int tagCount; + /** * Get the creationTime property: The creationTime property. * @@ -855,6 +867,26 @@ public BlobProperties customerProvidedKeySha256(String customerProvidedKeySha256 return this; } + /** + * Get the encryptionScope property: The encryptionScope property. + * + * @return the encryptionScope value. + */ + public String encryptionScope() { + return this.encryptionScope; + } + + /** + * Set the encryptionScope property: The encryptionScope property. + * + * @param encryptionScope the encryptionScope value to set. + * @return the BlobProperties object itself. + */ + public BlobProperties encryptionScope(String encryptionScope) { + this.encryptionScope = encryptionScope; + return this; + } + /** * Get the accessTierChangeTime property: The accessTierChangeTime * property. @@ -883,4 +915,24 @@ public BlobProperties accessTierChangeTime(OffsetDateTime accessTierChangeTime) } return this; } + + /** + * Get the tagCount property: The number of tags corresponding to the blob. + * + * @return the tagCount value. + */ + public int tagCount() { + return this.tagCount; + } + + /** + * Set the tagCount property: The number of tags corresponding to the blob. + * + * @param tagCount the tagCount value to set. + * @return the BlobProperties object itself. + */ + public BlobProperties tagCount(int tagCount) { + this.tagCount = tagCount; + return this; + } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobReleaseLeaseHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobReleaseLeaseHeaders.java index f503b9ab6d30..d90443f43ec1 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobReleaseLeaseHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobReleaseLeaseHeaders.java @@ -32,6 +32,13 @@ public final class BlobReleaseLeaseHeaders { @JsonProperty(value = "Last-Modified") private DateTimeRfc1123 lastModified; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -117,6 +124,30 @@ public BlobReleaseLeaseHeaders lastModified(OffsetDateTime lastModified) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlobReleaseLeaseHeaders object itself. + */ + public BlobReleaseLeaseHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobRenameHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobRenameHeaders.java new file mode 100644 index 000000000000..7c293db887cd --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobRenameHeaders.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.implementation.DateTimeRfc1123; +import com.azure.core.implementation.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.time.OffsetDateTime; + +/** + * Defines headers for Rename operation. + */ +@JacksonXmlRootElement(localName = "Blob-Rename-Headers") +@Fluent +public final class BlobRenameHeaders { + /* + * An HTTP entity tag associated with the file or directory. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /* + * The data and time the file or directory was last modified. Write + * operations on the file or directory update the last modified time. + */ + @JsonProperty(value = "Last-Modified") + private DateTimeRfc1123 lastModified; + + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + + /* + * A server-generated UUID recorded in the analytics logs for + * troubleshooting and correlation. + */ + @JsonProperty(value = "x-ms-request-id") + private String requestId; + + /* + * The version of the REST protocol used to process the request. + */ + @JsonProperty(value = "x-ms-version") + private String version; + + /* + * The size of the resource in bytes. + */ + @JsonProperty(value = "Content-Length") + private Long contentLength; + + /* + * A UTC date/time value generated by the service that indicates the time + * at which the response was initiated. + */ + @JsonProperty(value = "Date") + private DateTimeRfc1123 dateProperty; + + /** + * Get the eTag property: An HTTP entity tag associated with the file or + * directory. + * + * @return the eTag value. + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the eTag property: An HTTP entity tag associated with the file or + * directory. + * + * @param eTag the eTag value to set. + * @return the BlobRenameHeaders object itself. + */ + public BlobRenameHeaders eTag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get the lastModified property: The data and time the file or directory + * was last modified. Write operations on the file or directory update the + * last modified time. + * + * @return the lastModified value. + */ + public OffsetDateTime lastModified() { + if (this.lastModified == null) { + return null; + } + return this.lastModified.dateTime(); + } + + /** + * Set the lastModified property: The data and time the file or directory + * was last modified. Write operations on the file or directory update the + * last modified time. + * + * @param lastModified the lastModified value to set. + * @return the BlobRenameHeaders object itself. + */ + public BlobRenameHeaders lastModified(OffsetDateTime lastModified) { + if (lastModified == null) { + this.lastModified = null; + } else { + this.lastModified = new DateTimeRfc1123(lastModified); + } + return this; + } + + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlobRenameHeaders object itself. + */ + public BlobRenameHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + + /** + * Get the requestId property: A server-generated UUID recorded in the + * analytics logs for troubleshooting and correlation. + * + * @return the requestId value. + */ + public String requestId() { + return this.requestId; + } + + /** + * Set the requestId property: A server-generated UUID recorded in the + * analytics logs for troubleshooting and correlation. + * + * @param requestId the requestId value to set. + * @return the BlobRenameHeaders object itself. + */ + public BlobRenameHeaders requestId(String requestId) { + this.requestId = requestId; + return this; + } + + /** + * Get the version property: The version of the REST protocol used to + * process the request. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of the REST protocol used to + * process the request. + * + * @param version the version value to set. + * @return the BlobRenameHeaders object itself. + */ + public BlobRenameHeaders version(String version) { + this.version = version; + return this; + } + + /** + * Get the contentLength property: The size of the resource in bytes. + * + * @return the contentLength value. + */ + public Long contentLength() { + return this.contentLength; + } + + /** + * Set the contentLength property: The size of the resource in bytes. + * + * @param contentLength the contentLength value to set. + * @return the BlobRenameHeaders object itself. + */ + public BlobRenameHeaders contentLength(Long contentLength) { + this.contentLength = contentLength; + return this; + } + + /** + * Get the dateProperty property: A UTC date/time value generated by the + * service that indicates the time at which the response was initiated. + * + * @return the dateProperty value. + */ + public OffsetDateTime dateProperty() { + if (this.dateProperty == null) { + return null; + } + return this.dateProperty.dateTime(); + } + + /** + * Set the dateProperty property: A UTC date/time value generated by the + * service that indicates the time at which the response was initiated. + * + * @param dateProperty the dateProperty value to set. + * @return the BlobRenameHeaders object itself. + */ + public BlobRenameHeaders dateProperty(OffsetDateTime dateProperty) { + if (dateProperty == null) { + this.dateProperty = null; + } else { + this.dateProperty = new DateTimeRfc1123(dateProperty); + } + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobRenewLeaseHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobRenewLeaseHeaders.java index 863157cf8a42..f7115f510628 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobRenewLeaseHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobRenewLeaseHeaders.java @@ -38,6 +38,13 @@ public final class BlobRenewLeaseHeaders { @JsonProperty(value = "x-ms-lease-id") private String leaseId; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -143,6 +150,30 @@ public BlobRenewLeaseHeaders leaseId(String leaseId) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlobRenewLeaseHeaders object itself. + */ + public BlobRenewLeaseHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobSetHTTPHeadersHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobSetHTTPHeadersHeaders.java index ed539d644bc1..b926fb245980 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobSetHTTPHeadersHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobSetHTTPHeadersHeaders.java @@ -39,6 +39,13 @@ public final class BlobSetHTTPHeadersHeaders { @JsonProperty(value = "x-ms-blob-sequence-number") private Long blobSequenceNumber; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -146,6 +153,30 @@ public BlobSetHTTPHeadersHeaders blobSequenceNumber(Long blobSequenceNumber) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlobSetHTTPHeadersHeaders object itself. + */ + public BlobSetHTTPHeadersHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobSetMetadataHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobSetMetadataHeaders.java index 5b3898194287..56704d9b8419 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobSetMetadataHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobSetMetadataHeaders.java @@ -32,6 +32,13 @@ public final class BlobSetMetadataHeaders { @JsonProperty(value = "Last-Modified") private DateTimeRfc1123 lastModified; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -70,6 +77,14 @@ public final class BlobSetMetadataHeaders { @JsonProperty(value = "x-ms-encryption-key-sha256") private String encryptionKeySha256; + /* + * The encryption scope used to encrypt the metadata. This header is only + * returned when the when the metadata was with customer specified + * encryption. + */ + @JsonProperty(value = "x-ms-encryption-scope") + private String encryptionScope; + /* * The errorCode property. */ @@ -133,6 +148,30 @@ public BlobSetMetadataHeaders lastModified(OffsetDateTime lastModified) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlobSetMetadataHeaders object itself. + */ + public BlobSetMetadataHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. @@ -256,6 +295,30 @@ public BlobSetMetadataHeaders encryptionKeySha256(String encryptionKeySha256) { return this; } + /** + * Get the encryptionScope property: The encryption scope used to encrypt + * the metadata. This header is only returned when the when the metadata + * was with customer specified encryption. + * + * @return the encryptionScope value. + */ + public String encryptionScope() { + return this.encryptionScope; + } + + /** + * Set the encryptionScope property: The encryption scope used to encrypt + * the metadata. This header is only returned when the when the metadata + * was with customer specified encryption. + * + * @param encryptionScope the encryptionScope value to set. + * @return the BlobSetMetadataHeaders object itself. + */ + public BlobSetMetadataHeaders encryptionScope(String encryptionScope) { + this.encryptionScope = encryptionScope; + return this; + } + /** * Get the errorCode property: The errorCode property. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobSetTagsHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobSetTagsHeaders.java new file mode 100644 index 000000000000..58da7c6edbfb --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobSetTagsHeaders.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.implementation.DateTimeRfc1123; +import com.azure.core.implementation.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.time.OffsetDateTime; + +/** + * Defines headers for SetTags operation. + */ +@JacksonXmlRootElement(localName = "Blob-SetTags-Headers") +@Fluent +public final class BlobSetTagsHeaders { + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + + /* + * This header uniquely identifies the request that was made and can be + * used for troubleshooting the request. + */ + @JsonProperty(value = "x-ms-request-id") + private String requestId; + + /* + * Indicates the version of the Blob service used to execute the request. + * This header is returned for requests made against version 2009-09-19 and + * above. + */ + @JsonProperty(value = "x-ms-version") + private String version; + + /* + * UTC date/time value generated by the service that indicates the time at + * which the response was initiated + */ + @JsonProperty(value = "Date") + private DateTimeRfc1123 dateProperty; + + /* + * The errorCode property. + */ + @JsonProperty(value = "x-ms-error-code") + private String errorCode; + + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlobSetTagsHeaders object itself. + */ + public BlobSetTagsHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + + /** + * Get the requestId property: This header uniquely identifies the request + * that was made and can be used for troubleshooting the request. + * + * @return the requestId value. + */ + public String requestId() { + return this.requestId; + } + + /** + * Set the requestId property: This header uniquely identifies the request + * that was made and can be used for troubleshooting the request. + * + * @param requestId the requestId value to set. + * @return the BlobSetTagsHeaders object itself. + */ + public BlobSetTagsHeaders requestId(String requestId) { + this.requestId = requestId; + return this; + } + + /** + * Get the version property: Indicates the version of the Blob service used + * to execute the request. This header is returned for requests made + * against version 2009-09-19 and above. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Indicates the version of the Blob service used + * to execute the request. This header is returned for requests made + * against version 2009-09-19 and above. + * + * @param version the version value to set. + * @return the BlobSetTagsHeaders object itself. + */ + public BlobSetTagsHeaders version(String version) { + this.version = version; + return this; + } + + /** + * Get the dateProperty property: UTC date/time value generated by the + * service that indicates the time at which the response was initiated. + * + * @return the dateProperty value. + */ + public OffsetDateTime dateProperty() { + if (this.dateProperty == null) { + return null; + } + return this.dateProperty.dateTime(); + } + + /** + * Set the dateProperty property: UTC date/time value generated by the + * service that indicates the time at which the response was initiated. + * + * @param dateProperty the dateProperty value to set. + * @return the BlobSetTagsHeaders object itself. + */ + public BlobSetTagsHeaders dateProperty(OffsetDateTime dateProperty) { + if (dateProperty == null) { + this.dateProperty = null; + } else { + this.dateProperty = new DateTimeRfc1123(dateProperty); + } + return this; + } + + /** + * Get the errorCode property: The errorCode property. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: The errorCode property. + * + * @param errorCode the errorCode value to set. + * @return the BlobSetTagsHeaders object itself. + */ + public BlobSetTagsHeaders errorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobSetTierHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobSetTierHeaders.java index 372b1a09ebc0..0ec7d69471c5 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobSetTierHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobSetTierHeaders.java @@ -14,6 +14,13 @@ @JacksonXmlRootElement(localName = "Blob-SetTier-Headers") @Fluent public final class BlobSetTierHeaders { + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -35,6 +42,30 @@ public final class BlobSetTierHeaders { @JsonProperty(value = "x-ms-error-code") private String errorCode; + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlobSetTierHeaders object itself. + */ + public BlobSetTierHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobStartCopyFromURLHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobStartCopyFromURLHeaders.java index a6b195a6e6dc..f625c74b5250 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobStartCopyFromURLHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobStartCopyFromURLHeaders.java @@ -32,6 +32,13 @@ public final class BlobStartCopyFromURLHeaders { @JsonProperty(value = "Last-Modified") private DateTimeRfc1123 lastModified; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -140,6 +147,30 @@ public BlobStartCopyFromURLHeaders lastModified(OffsetDateTime lastModified) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlobStartCopyFromURLHeaders object itself. + */ + public BlobStartCopyFromURLHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobTags.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobTags.java new file mode 100644 index 000000000000..511b4202d2b6 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobTags.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.implementation.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.ArrayList; +import java.util.List; + +/** + * XML containing key/value pairs representing the tags for the blob. + */ +@JacksonXmlRootElement(localName = "Tags") +@Fluent +public final class BlobTags { + private static final class TagSetWrapper { + @JacksonXmlProperty(localName = "Tag") + private final List items; + + @JsonCreator + private TagSetWrapper(@JacksonXmlProperty(localName = "Tag") List items) { + this.items = items; + } + } + + /* + * The tagSet property. + */ + @JsonProperty(value = "TagSet") + private TagSetWrapper tagSet; + + /** + * Get the tagSet property: The tagSet property. + * + * @return the tagSet value. + */ + public List tagSet() { + if (this.tagSet == null) { + this.tagSet = new TagSetWrapper(new ArrayList()); + } + return this.tagSet.items; + } + + /** + * Set the tagSet property: The tagSet property. + * + * @param tagSet the tagSet value to set. + * @return the BlobTags object itself. + */ + public BlobTags tagSet(List tagSet) { + this.tagSet = new TagSetWrapper(tagSet); + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobUndeleteHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobUndeleteHeaders.java index cd1ea6a55d13..3b11e7dd6632 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobUndeleteHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobUndeleteHeaders.java @@ -16,6 +16,13 @@ @JacksonXmlRootElement(localName = "Blob-Undelete-Headers") @Fluent public final class BlobUndeleteHeaders { + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -44,6 +51,30 @@ public final class BlobUndeleteHeaders { @JsonProperty(value = "x-ms-error-code") private String errorCode; + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlobUndeleteHeaders object itself. + */ + public BlobUndeleteHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobsGetTagsResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobsGetTagsResponse.java new file mode 100644 index 000000000000..e97f1ca848f5 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobsGetTagsResponse.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** + * Contains all response data for the getTags operation. + */ +public final class BlobsGetTagsResponse extends ResponseBase { + /** + * Creates an instance of BlobsGetTagsResponse. + * + * @param request the request which resulted in this BlobsGetTagsResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public BlobsGetTagsResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, BlobTags value, BlobGetTagsHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * @return the deserialized response body. + */ + @Override + public BlobTags value() { + return super.value(); + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobsRenameResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobsRenameResponse.java new file mode 100644 index 000000000000..1be4db789caa --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobsRenameResponse.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** + * Contains all response data for the rename operation. + */ +public final class BlobsRenameResponse extends ResponseBase { + /** + * Creates an instance of BlobsRenameResponse. + * + * @param request the request which resulted in this BlobsRenameResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public BlobsRenameResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, BlobRenameHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobsSetTagsResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobsSetTagsResponse.java new file mode 100644 index 000000000000..58946c96cbb3 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobsSetTagsResponse.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** + * Contains all response data for the setTags operation. + */ +public final class BlobsSetTagsResponse extends ResponseBase { + /** + * Creates an instance of BlobsSetTagsResponse. + * + * @param request the request which resulted in this BlobsSetTagsResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public BlobsSetTagsResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, BlobSetTagsHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobCommitBlockListHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobCommitBlockListHeaders.java index 6bec949d7180..0b2f37e8bc76 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobCommitBlockListHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobCommitBlockListHeaders.java @@ -34,13 +34,28 @@ public final class BlockBlobCommitBlockListHeaders { private DateTimeRfc1123 lastModified; /* - * If the blob has an MD5 hash and this operation is to read the full blob, - * this response header is returned so that the client can check for - * message content integrity. + * This header is returned so that the client can check for message content + * integrity. This header refers to the content of the request, meaning, in + * this case, the list of blocks, and not the content of the blob itself. */ @JsonProperty(value = "Content-MD5") private byte[] contentMD5; + /* + * This header is returned so that the client can check for message content + * integrity. This header refers to the content of the request, meaning, in + * this case, the list of blocks, and not the content of the blob itself. + */ + @JsonProperty(value = "x-ms-content-crc64") + private byte[] xMsContentCrc64; + + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -87,6 +102,13 @@ public final class BlockBlobCommitBlockListHeaders { @JsonProperty(value = "x-ms-encryption-key-sha256") private String encryptionKeySha256; + /* + * The encryption scope used to encrypt the blob. This header is only + * returned when the blob was encrypted with customer specified encryption. + */ + @JsonProperty(value = "x-ms-encryption-scope") + private String encryptionScope; + /* * The errorCode property. */ @@ -151,9 +173,10 @@ public BlockBlobCommitBlockListHeaders lastModified(OffsetDateTime lastModified) } /** - * Get the contentMD5 property: If the blob has an MD5 hash and this - * operation is to read the full blob, this response header is returned so - * that the client can check for message content integrity. + * Get the contentMD5 property: This header is returned so that the client + * can check for message content integrity. This header refers to the + * content of the request, meaning, in this case, the list of blocks, and + * not the content of the blob itself. * * @return the contentMD5 value. */ @@ -162,9 +185,10 @@ public byte[] contentMD5() { } /** - * Set the contentMD5 property: If the blob has an MD5 hash and this - * operation is to read the full blob, this response header is returned so - * that the client can check for message content integrity. + * Set the contentMD5 property: This header is returned so that the client + * can check for message content integrity. This header refers to the + * content of the request, meaning, in this case, the list of blocks, and + * not the content of the blob itself. * * @param contentMD5 the contentMD5 value to set. * @return the BlockBlobCommitBlockListHeaders object itself. @@ -174,6 +198,56 @@ public BlockBlobCommitBlockListHeaders contentMD5(byte[] contentMD5) { return this; } + /** + * Get the xMsContentCrc64 property: This header is returned so that the + * client can check for message content integrity. This header refers to + * the content of the request, meaning, in this case, the list of blocks, + * and not the content of the blob itself. + * + * @return the xMsContentCrc64 value. + */ + public byte[] xMsContentCrc64() { + return ImplUtils.clone(this.xMsContentCrc64); + } + + /** + * Set the xMsContentCrc64 property: This header is returned so that the + * client can check for message content integrity. This header refers to + * the content of the request, meaning, in this case, the list of blocks, + * and not the content of the blob itself. + * + * @param xMsContentCrc64 the xMsContentCrc64 value to set. + * @return the BlockBlobCommitBlockListHeaders object itself. + */ + public BlockBlobCommitBlockListHeaders xMsContentCrc64(byte[] xMsContentCrc64) { + this.xMsContentCrc64 = ImplUtils.clone(xMsContentCrc64); + return this; + } + + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlockBlobCommitBlockListHeaders object itself. + */ + public BlockBlobCommitBlockListHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. @@ -321,6 +395,30 @@ public BlockBlobCommitBlockListHeaders encryptionKeySha256(String encryptionKeyS return this; } + /** + * Get the encryptionScope property: The encryption scope used to encrypt + * the blob. This header is only returned when the blob was encrypted with + * customer specified encryption. + * + * @return the encryptionScope value. + */ + public String encryptionScope() { + return this.encryptionScope; + } + + /** + * Set the encryptionScope property: The encryption scope used to encrypt + * the blob. This header is only returned when the blob was encrypted with + * customer specified encryption. + * + * @param encryptionScope the encryptionScope value to set. + * @return the BlockBlobCommitBlockListHeaders object itself. + */ + public BlockBlobCommitBlockListHeaders encryptionScope(String encryptionScope) { + this.encryptionScope = encryptionScope; + return this; + } + /** * Get the errorCode property: The errorCode property. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobGetBlockListHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobGetBlockListHeaders.java index fa50d846ebef..102d7229c0f1 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobGetBlockListHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobGetBlockListHeaders.java @@ -45,6 +45,13 @@ public final class BlockBlobGetBlockListHeaders { @JsonProperty(value = "x-ms-blob-content-length") private Long blobContentLength; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -172,6 +179,30 @@ public BlockBlobGetBlockListHeaders blobContentLength(Long blobContentLength) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlockBlobGetBlockListHeaders object itself. + */ + public BlockBlobGetBlockListHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobStageBlockFromURLHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobStageBlockFromURLHeaders.java index 88dd3c6346ed..bc26268bf092 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobStageBlockFromURLHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobStageBlockFromURLHeaders.java @@ -18,13 +18,28 @@ @Fluent public final class BlockBlobStageBlockFromURLHeaders { /* - * If the blob has an MD5 hash and this operation is to read the full blob, - * this response header is returned so that the client can check for - * message content integrity. + * This header is returned so that the client can check for message content + * integrity. The value of this header is computed by the Blob service; it + * is not necessarily the same value specified in the request headers. */ @JsonProperty(value = "Content-MD5") private byte[] contentMD5; + /* + * This header is returned so that the client can check for message content + * integrity. The value of this header is computed by the Blob service; it + * is not necessarily the same value specified in the request headers. + */ + @JsonProperty(value = "x-ms-content-crc64") + private byte[] xMsContentCrc64; + + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -63,6 +78,14 @@ public final class BlockBlobStageBlockFromURLHeaders { @JsonProperty(value = "x-ms-encryption-key-sha256") private String encryptionKeySha256; + /* + * The encryption scope used to encrypt the block. This header is only + * returned when the block was encrypted with customer specified + * encryption. + */ + @JsonProperty(value = "x-ms-encryption-scope") + private String encryptionScope; + /* * The errorCode property. */ @@ -70,9 +93,10 @@ public final class BlockBlobStageBlockFromURLHeaders { private String errorCode; /** - * Get the contentMD5 property: If the blob has an MD5 hash and this - * operation is to read the full blob, this response header is returned so - * that the client can check for message content integrity. + * Get the contentMD5 property: This header is returned so that the client + * can check for message content integrity. The value of this header is + * computed by the Blob service; it is not necessarily the same value + * specified in the request headers. * * @return the contentMD5 value. */ @@ -81,9 +105,10 @@ public byte[] contentMD5() { } /** - * Set the contentMD5 property: If the blob has an MD5 hash and this - * operation is to read the full blob, this response header is returned so - * that the client can check for message content integrity. + * Set the contentMD5 property: This header is returned so that the client + * can check for message content integrity. The value of this header is + * computed by the Blob service; it is not necessarily the same value + * specified in the request headers. * * @param contentMD5 the contentMD5 value to set. * @return the BlockBlobStageBlockFromURLHeaders object itself. @@ -93,6 +118,56 @@ public BlockBlobStageBlockFromURLHeaders contentMD5(byte[] contentMD5) { return this; } + /** + * Get the xMsContentCrc64 property: This header is returned so that the + * client can check for message content integrity. The value of this header + * is computed by the Blob service; it is not necessarily the same value + * specified in the request headers. + * + * @return the xMsContentCrc64 value. + */ + public byte[] xMsContentCrc64() { + return ImplUtils.clone(this.xMsContentCrc64); + } + + /** + * Set the xMsContentCrc64 property: This header is returned so that the + * client can check for message content integrity. The value of this header + * is computed by the Blob service; it is not necessarily the same value + * specified in the request headers. + * + * @param xMsContentCrc64 the xMsContentCrc64 value to set. + * @return the BlockBlobStageBlockFromURLHeaders object itself. + */ + public BlockBlobStageBlockFromURLHeaders xMsContentCrc64(byte[] xMsContentCrc64) { + this.xMsContentCrc64 = ImplUtils.clone(xMsContentCrc64); + return this; + } + + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlockBlobStageBlockFromURLHeaders object itself. + */ + public BlockBlobStageBlockFromURLHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. @@ -216,6 +291,30 @@ public BlockBlobStageBlockFromURLHeaders encryptionKeySha256(String encryptionKe return this; } + /** + * Get the encryptionScope property: The encryption scope used to encrypt + * the block. This header is only returned when the block was encrypted + * with customer specified encryption. + * + * @return the encryptionScope value. + */ + public String encryptionScope() { + return this.encryptionScope; + } + + /** + * Set the encryptionScope property: The encryption scope used to encrypt + * the block. This header is only returned when the block was encrypted + * with customer specified encryption. + * + * @param encryptionScope the encryptionScope value to set. + * @return the BlockBlobStageBlockFromURLHeaders object itself. + */ + public BlockBlobStageBlockFromURLHeaders encryptionScope(String encryptionScope) { + this.encryptionScope = encryptionScope; + return this; + } + /** * Get the errorCode property: The errorCode property. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobStageBlockHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobStageBlockHeaders.java index 56ffdfe93700..862aab9c267f 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobStageBlockHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobStageBlockHeaders.java @@ -18,13 +18,20 @@ @Fluent public final class BlockBlobStageBlockHeaders { /* - * If the blob has an MD5 hash and this operation is to read the full blob, - * this response header is returned so that the client can check for - * message content integrity. + * This header is returned so that the client can check for message content + * integrity. The value of this header is computed by the Blob service; it + * is not necessarily the same value specified in the request headers. */ @JsonProperty(value = "Content-MD5") private byte[] contentMD5; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -47,6 +54,14 @@ public final class BlockBlobStageBlockHeaders { @JsonProperty(value = "Date") private DateTimeRfc1123 dateProperty; + /* + * This header is returned so that the client can check for message content + * integrity. The value of this header is computed by the Blob service; it + * is not necessarily the same value specified in the request headers. + */ + @JsonProperty(value = "x-ms-content-crc64") + private byte[] xMsContentCrc64; + /* * The value of this header is set to true if the contents of the request * are successfully encrypted using the specified algorithm, and false @@ -63,6 +78,14 @@ public final class BlockBlobStageBlockHeaders { @JsonProperty(value = "x-ms-encryption-key-sha256") private String encryptionKeySha256; + /* + * The encryption scope used to encrypt the block. This header is only + * returned when the block was encrypted with customer specified + * encryption. + */ + @JsonProperty(value = "x-ms-encryption-scope") + private String encryptionScope; + /* * The errorCode property. */ @@ -70,9 +93,10 @@ public final class BlockBlobStageBlockHeaders { private String errorCode; /** - * Get the contentMD5 property: If the blob has an MD5 hash and this - * operation is to read the full blob, this response header is returned so - * that the client can check for message content integrity. + * Get the contentMD5 property: This header is returned so that the client + * can check for message content integrity. The value of this header is + * computed by the Blob service; it is not necessarily the same value + * specified in the request headers. * * @return the contentMD5 value. */ @@ -81,9 +105,10 @@ public byte[] contentMD5() { } /** - * Set the contentMD5 property: If the blob has an MD5 hash and this - * operation is to read the full blob, this response header is returned so - * that the client can check for message content integrity. + * Set the contentMD5 property: This header is returned so that the client + * can check for message content integrity. The value of this header is + * computed by the Blob service; it is not necessarily the same value + * specified in the request headers. * * @param contentMD5 the contentMD5 value to set. * @return the BlockBlobStageBlockHeaders object itself. @@ -93,6 +118,30 @@ public BlockBlobStageBlockHeaders contentMD5(byte[] contentMD5) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlockBlobStageBlockHeaders object itself. + */ + public BlockBlobStageBlockHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. @@ -168,6 +217,32 @@ public BlockBlobStageBlockHeaders dateProperty(OffsetDateTime dateProperty) { return this; } + /** + * Get the xMsContentCrc64 property: This header is returned so that the + * client can check for message content integrity. The value of this header + * is computed by the Blob service; it is not necessarily the same value + * specified in the request headers. + * + * @return the xMsContentCrc64 value. + */ + public byte[] xMsContentCrc64() { + return ImplUtils.clone(this.xMsContentCrc64); + } + + /** + * Set the xMsContentCrc64 property: This header is returned so that the + * client can check for message content integrity. The value of this header + * is computed by the Blob service; it is not necessarily the same value + * specified in the request headers. + * + * @param xMsContentCrc64 the xMsContentCrc64 value to set. + * @return the BlockBlobStageBlockHeaders object itself. + */ + public BlockBlobStageBlockHeaders xMsContentCrc64(byte[] xMsContentCrc64) { + this.xMsContentCrc64 = ImplUtils.clone(xMsContentCrc64); + return this; + } + /** * Get the isServerEncrypted property: The value of this header is set to * true if the contents of the request are successfully encrypted using the @@ -216,6 +291,30 @@ public BlockBlobStageBlockHeaders encryptionKeySha256(String encryptionKeySha256 return this; } + /** + * Get the encryptionScope property: The encryption scope used to encrypt + * the block. This header is only returned when the block was encrypted + * with customer specified encryption. + * + * @return the encryptionScope value. + */ + public String encryptionScope() { + return this.encryptionScope; + } + + /** + * Set the encryptionScope property: The encryption scope used to encrypt + * the block. This header is only returned when the block was encrypted + * with customer specified encryption. + * + * @param encryptionScope the encryptionScope value to set. + * @return the BlockBlobStageBlockHeaders object itself. + */ + public BlockBlobStageBlockHeaders encryptionScope(String encryptionScope) { + this.encryptionScope = encryptionScope; + return this; + } + /** * Get the errorCode property: The errorCode property. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobUploadHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobUploadHeaders.java index 76c59b2f74d9..feaaeecfd96a 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobUploadHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobUploadHeaders.java @@ -41,6 +41,13 @@ public final class BlockBlobUploadHeaders { @JsonProperty(value = "Content-MD5") private byte[] contentMD5; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -87,6 +94,13 @@ public final class BlockBlobUploadHeaders { @JsonProperty(value = "x-ms-encryption-key-sha256") private String encryptionKeySha256; + /* + * The encryption scope used to encrypt the blob. This header is only + * returned when the blob was encrypted with customer specified encryption. + */ + @JsonProperty(value = "x-ms-encryption-scope") + private String encryptionScope; + /* * The errorCode property. */ @@ -174,6 +188,30 @@ public BlockBlobUploadHeaders contentMD5(byte[] contentMD5) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the BlockBlobUploadHeaders object itself. + */ + public BlockBlobUploadHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. @@ -321,6 +359,30 @@ public BlockBlobUploadHeaders encryptionKeySha256(String encryptionKeySha256) { return this; } + /** + * Get the encryptionScope property: The encryption scope used to encrypt + * the blob. This header is only returned when the blob was encrypted with + * customer specified encryption. + * + * @return the encryptionScope value. + */ + public String encryptionScope() { + return this.encryptionScope; + } + + /** + * Set the encryptionScope property: The encryption scope used to encrypt + * the blob. This header is only returned when the blob was encrypted with + * customer specified encryption. + * + * @param encryptionScope the encryptionScope value to set. + * @return the BlockBlobUploadHeaders object itself. + */ + public BlockBlobUploadHeaders encryptionScope(String encryptionScope) { + this.encryptionScope = encryptionScope; + return this; + } + /** * Get the errorCode property: The errorCode property. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerAcquireLeaseHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerAcquireLeaseHeaders.java index bd6d0580bdcf..15f4938ad8ee 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerAcquireLeaseHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerAcquireLeaseHeaders.java @@ -38,6 +38,13 @@ public final class ContainerAcquireLeaseHeaders { @JsonProperty(value = "x-ms-lease-id") private String leaseId; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -143,6 +150,30 @@ public ContainerAcquireLeaseHeaders leaseId(String leaseId) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the ContainerAcquireLeaseHeaders object itself. + */ + public ContainerAcquireLeaseHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerBreakLeaseHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerBreakLeaseHeaders.java index 4df2a5f3ddef..bea7906493fb 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerBreakLeaseHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerBreakLeaseHeaders.java @@ -38,6 +38,13 @@ public final class ContainerBreakLeaseHeaders { @JsonProperty(value = "x-ms-lease-time") private Integer leaseTime; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -145,6 +152,30 @@ public ContainerBreakLeaseHeaders leaseTime(Integer leaseTime) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the ContainerBreakLeaseHeaders object itself. + */ + public ContainerBreakLeaseHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerChangeLeaseHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerChangeLeaseHeaders.java index 8c5371a5121f..dd16b934a42a 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerChangeLeaseHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerChangeLeaseHeaders.java @@ -38,6 +38,13 @@ public final class ContainerChangeLeaseHeaders { @JsonProperty(value = "x-ms-lease-id") private String leaseId; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -143,6 +150,30 @@ public ContainerChangeLeaseHeaders leaseId(String leaseId) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the ContainerChangeLeaseHeaders object itself. + */ + public ContainerChangeLeaseHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerCreateHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerCreateHeaders.java index 9a22e560ca72..c52bf1b9a1e5 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerCreateHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerCreateHeaders.java @@ -32,6 +32,13 @@ public final class ContainerCreateHeaders { @JsonProperty(value = "Last-Modified") private DateTimeRfc1123 lastModified; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -117,6 +124,30 @@ public ContainerCreateHeaders lastModified(OffsetDateTime lastModified) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the ContainerCreateHeaders object itself. + */ + public ContainerCreateHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerDeleteHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerDeleteHeaders.java index 64af976e0367..4308de71d186 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerDeleteHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerDeleteHeaders.java @@ -16,6 +16,13 @@ @JacksonXmlRootElement(localName = "Container-Delete-Headers") @Fluent public final class ContainerDeleteHeaders { + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -44,6 +51,30 @@ public final class ContainerDeleteHeaders { @JsonProperty(value = "x-ms-error-code") private String errorCode; + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the ContainerDeleteHeaders object itself. + */ + public ContainerDeleteHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerGetAccessPolicyHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerGetAccessPolicyHeaders.java index a1a76b2f57ba..779ffb797e73 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerGetAccessPolicyHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerGetAccessPolicyHeaders.java @@ -39,6 +39,13 @@ public final class ContainerGetAccessPolicyHeaders { @JsonProperty(value = "Last-Modified") private DateTimeRfc1123 lastModified; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -148,6 +155,30 @@ public ContainerGetAccessPolicyHeaders lastModified(OffsetDateTime lastModified) return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the ContainerGetAccessPolicyHeaders object itself. + */ + public ContainerGetAccessPolicyHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerGetAccountInfoHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerGetAccountInfoHeaders.java index 692c4a71fc52..368acb2e4cc4 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerGetAccountInfoHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerGetAccountInfoHeaders.java @@ -16,6 +16,13 @@ @JacksonXmlRootElement(localName = "Container-GetAccountInfo-Headers") @Fluent public final class ContainerGetAccountInfoHeaders { + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -59,6 +66,30 @@ public final class ContainerGetAccountInfoHeaders { @JsonProperty(value = "x-ms-error-code") private String errorCode; + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the ContainerGetAccountInfoHeaders object itself. + */ + public ContainerGetAccountInfoHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerGetPropertiesHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerGetPropertiesHeaders.java index df2d12bbcdb6..85b8d6b73077 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerGetPropertiesHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerGetPropertiesHeaders.java @@ -61,6 +61,13 @@ public final class ContainerGetPropertiesHeaders { @JsonProperty(value = "x-ms-lease-status") private LeaseStatusType leaseStatus; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -90,6 +97,18 @@ public final class ContainerGetPropertiesHeaders { @JsonProperty(value = "x-ms-blob-public-access") private PublicAccessType blobPublicAccess; + /* + * Default encryption scope on this container + */ + @JsonProperty(value = "x-ms-default-encryption-scope") + private String defaultEncryptionScope; + + /* + * Whether to reject the write request with encryption scope + */ + @JsonProperty(value = "x-ms-deny-encryption-scope-override") + private Boolean denyEncryptionScopeOverride; + /* * Indicates whether the container has an immutability policy set on it. */ @@ -253,6 +272,30 @@ public ContainerGetPropertiesHeaders leaseStatus(LeaseStatusType leaseStatus) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the ContainerGetPropertiesHeaders object itself. + */ + public ContainerGetPropertiesHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. @@ -352,6 +395,51 @@ public ContainerGetPropertiesHeaders blobPublicAccess(PublicAccessType blobPubli return this; } + /** + * Get the defaultEncryptionScope property: Default encryption scope on + * this container. + * + * @return the defaultEncryptionScope value. + */ + public String defaultEncryptionScope() { + return this.defaultEncryptionScope; + } + + /** + * Set the defaultEncryptionScope property: Default encryption scope on + * this container. + * + * @param defaultEncryptionScope the defaultEncryptionScope value to set. + * @return the ContainerGetPropertiesHeaders object itself. + */ + public ContainerGetPropertiesHeaders defaultEncryptionScope(String defaultEncryptionScope) { + this.defaultEncryptionScope = defaultEncryptionScope; + return this; + } + + /** + * Get the denyEncryptionScopeOverride property: Whether to reject the + * write request with encryption scope. + * + * @return the denyEncryptionScopeOverride value. + */ + public Boolean denyEncryptionScopeOverride() { + return this.denyEncryptionScopeOverride; + } + + /** + * Set the denyEncryptionScopeOverride property: Whether to reject the + * write request with encryption scope. + * + * @param denyEncryptionScopeOverride the denyEncryptionScopeOverride value + * to set. + * @return the ContainerGetPropertiesHeaders object itself. + */ + public ContainerGetPropertiesHeaders denyEncryptionScopeOverride(Boolean denyEncryptionScopeOverride) { + this.denyEncryptionScopeOverride = denyEncryptionScopeOverride; + return this; + } + /** * Get the hasImmutabilityPolicy property: Indicates whether the container * has an immutability policy set on it. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerListBlobFlatSegmentHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerListBlobFlatSegmentHeaders.java index ef1252a5a8d4..a17ee04d84c1 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerListBlobFlatSegmentHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerListBlobFlatSegmentHeaders.java @@ -23,6 +23,13 @@ public final class ContainerListBlobFlatSegmentHeaders { @JsonProperty(value = "Content-Type") private String contentType; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -73,6 +80,30 @@ public ContainerListBlobFlatSegmentHeaders contentType(String contentType) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the ContainerListBlobFlatSegmentHeaders object itself. + */ + public ContainerListBlobFlatSegmentHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerListBlobHierarchySegmentHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerListBlobHierarchySegmentHeaders.java index d1a671cf7550..44bf89808b3a 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerListBlobHierarchySegmentHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerListBlobHierarchySegmentHeaders.java @@ -23,6 +23,13 @@ public final class ContainerListBlobHierarchySegmentHeaders { @JsonProperty(value = "Content-Type") private String contentType; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -73,6 +80,30 @@ public ContainerListBlobHierarchySegmentHeaders contentType(String contentType) return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the ContainerListBlobHierarchySegmentHeaders object itself. + */ + public ContainerListBlobHierarchySegmentHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerReleaseLeaseHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerReleaseLeaseHeaders.java index 7a8766ab2424..0a33b2b26cbc 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerReleaseLeaseHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerReleaseLeaseHeaders.java @@ -32,6 +32,13 @@ public final class ContainerReleaseLeaseHeaders { @JsonProperty(value = "Last-Modified") private DateTimeRfc1123 lastModified; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -117,6 +124,30 @@ public ContainerReleaseLeaseHeaders lastModified(OffsetDateTime lastModified) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the ContainerReleaseLeaseHeaders object itself. + */ + public ContainerReleaseLeaseHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerRenewLeaseHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerRenewLeaseHeaders.java index a192e95a96c8..5fbbfb2a286b 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerRenewLeaseHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerRenewLeaseHeaders.java @@ -38,6 +38,13 @@ public final class ContainerRenewLeaseHeaders { @JsonProperty(value = "x-ms-lease-id") private String leaseId; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -143,6 +150,30 @@ public ContainerRenewLeaseHeaders leaseId(String leaseId) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the ContainerRenewLeaseHeaders object itself. + */ + public ContainerRenewLeaseHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerSetAccessPolicyHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerSetAccessPolicyHeaders.java index 763e75291800..a38fbf929c42 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerSetAccessPolicyHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerSetAccessPolicyHeaders.java @@ -32,6 +32,13 @@ public final class ContainerSetAccessPolicyHeaders { @JsonProperty(value = "Last-Modified") private DateTimeRfc1123 lastModified; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -117,6 +124,30 @@ public ContainerSetAccessPolicyHeaders lastModified(OffsetDateTime lastModified) return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the ContainerSetAccessPolicyHeaders object itself. + */ + public ContainerSetAccessPolicyHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerSetMetadataHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerSetMetadataHeaders.java index e685322b83ff..ee483bfdde40 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerSetMetadataHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ContainerSetMetadataHeaders.java @@ -32,6 +32,13 @@ public final class ContainerSetMetadataHeaders { @JsonProperty(value = "Last-Modified") private DateTimeRfc1123 lastModified; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -117,6 +124,30 @@ public ContainerSetMetadataHeaders lastModified(OffsetDateTime lastModified) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the ContainerSetMetadataHeaders object itself. + */ + public ContainerSetMetadataHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/CustomerProvidedKeyInfo.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/CustomerProvidedKeyInfo.java new file mode 100644 index 000000000000..3c033adb0ccc --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/CustomerProvidedKeyInfo.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.implementation.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; + +/** + * Additional parameters for a set of operations. + */ +@JacksonXmlRootElement(localName = "customer-provided-key-info") +@Fluent +public final class CustomerProvidedKeyInfo { + /* + * Optional. Specifies the encryption scope to use to encrypt the data + * provided in the request. If not specified, encryption is performed with + * the root account encryption key. For more information, see Encryption + * at Rest for Azure Storage Services. + */ + @JsonProperty(value = "encryptionScope") + private String encryptionScope; + + /** + * Get the encryptionScope property: Optional. Specifies the encryption + * scope to use to encrypt the data provided in the request. If not + * specified, encryption is performed with the root account encryption key. + * For more information, see Encryption at Rest for Azure Storage Services. + * + * @return the encryptionScope value. + */ + public String encryptionScope() { + return this.encryptionScope; + } + + /** + * Set the encryptionScope property: Optional. Specifies the encryption + * scope to use to encrypt the data provided in the request. If not + * specified, encryption is performed with the root account encryption key. + * For more information, see Encryption at Rest for Azure Storage Services. + * + * @param encryptionScope the encryptionScope value to set. + * @return the CustomerProvidedKeyInfo object itself. + */ + public CustomerProvidedKeyInfo encryptionScope(String encryptionScope) { + this.encryptionScope = encryptionScope; + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DataLakeStorageError.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DataLakeStorageError.java new file mode 100644 index 000000000000..d481a91fead8 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DataLakeStorageError.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.implementation.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; + +/** + * The DataLakeStorageError model. + */ +@JacksonXmlRootElement(localName = "DataLakeStorageError") +@Fluent +public final class DataLakeStorageError { + /* + * The service error response object. + */ + @JsonProperty(value = "error") + private DataLakeStorageErrorError error; + + /** + * Get the error property: The service error response object. + * + * @return the error value. + */ + public DataLakeStorageErrorError error() { + return this.error; + } + + /** + * Set the error property: The service error response object. + * + * @param error the error value to set. + * @return the DataLakeStorageError object itself. + */ + public DataLakeStorageError error(DataLakeStorageErrorError error) { + this.error = error; + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DataLakeStorageErrorError.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DataLakeStorageErrorError.java new file mode 100644 index 000000000000..b9c43856709c --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DataLakeStorageErrorError.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.implementation.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; + +/** + * The service error response object. + */ +@JacksonXmlRootElement(localName = "DataLakeStorageError_error") +@Fluent +public final class DataLakeStorageErrorError { + /* + * The service error code. + */ + @JsonProperty(value = "code") + private String code; + + /* + * The service error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the code property: The service error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: The service error code. + * + * @param code the code value to set. + * @return the DataLakeStorageErrorError object itself. + */ + public DataLakeStorageErrorError code(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: The service error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The service error message. + * + * @param message the message value to set. + * @return the DataLakeStorageErrorError object itself. + */ + public DataLakeStorageErrorError message(String message) { + this.message = message; + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DataLakeStorageErrorException.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DataLakeStorageErrorException.java new file mode 100644 index 000000000000..da3d592a3e0d --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DataLakeStorageErrorException.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.HttpResponse; + +/** + * Exception thrown for an invalid response with DataLakeStorageError information. + */ +public final class DataLakeStorageErrorException extends HttpResponseException { + /** + * Initializes a new instance of the DataLakeStorageErrorException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + */ + public DataLakeStorageErrorException(String message, HttpResponse response) { + super(message, response); + } + + /** + * Initializes a new instance of the DataLakeStorageErrorException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + * @param value the deserialized response value. + */ + public DataLakeStorageErrorException(String message, HttpResponse response, DataLakeStorageError value) { + super(message, response, value); + } + + @Override + public DataLakeStorageError value() { + return (DataLakeStorageError) super.value(); + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DirectoryCreateHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DirectoryCreateHeaders.java new file mode 100644 index 000000000000..fc9f5eeaf9d2 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DirectoryCreateHeaders.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.implementation.DateTimeRfc1123; +import com.azure.core.implementation.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.time.OffsetDateTime; + +/** + * Defines headers for Create operation. + */ +@JacksonXmlRootElement(localName = "Directory-Create-Headers") +@Fluent +public final class DirectoryCreateHeaders { + /* + * An HTTP entity tag associated with the file or directory. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /* + * The data and time the file or directory was last modified. Write + * operations on the file or directory update the last modified time. + */ + @JsonProperty(value = "Last-Modified") + private DateTimeRfc1123 lastModified; + + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + + /* + * A server-generated UUID recorded in the analytics logs for + * troubleshooting and correlation. + */ + @JsonProperty(value = "x-ms-request-id") + private String requestId; + + /* + * The version of the REST protocol used to process the request. + */ + @JsonProperty(value = "x-ms-version") + private String version; + + /* + * The size of the resource in bytes. + */ + @JsonProperty(value = "Content-Length") + private Long contentLength; + + /* + * A UTC date/time value generated by the service that indicates the time + * at which the response was initiated. + */ + @JsonProperty(value = "Date") + private DateTimeRfc1123 dateProperty; + + /** + * Get the eTag property: An HTTP entity tag associated with the file or + * directory. + * + * @return the eTag value. + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the eTag property: An HTTP entity tag associated with the file or + * directory. + * + * @param eTag the eTag value to set. + * @return the DirectoryCreateHeaders object itself. + */ + public DirectoryCreateHeaders eTag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get the lastModified property: The data and time the file or directory + * was last modified. Write operations on the file or directory update the + * last modified time. + * + * @return the lastModified value. + */ + public OffsetDateTime lastModified() { + if (this.lastModified == null) { + return null; + } + return this.lastModified.dateTime(); + } + + /** + * Set the lastModified property: The data and time the file or directory + * was last modified. Write operations on the file or directory update the + * last modified time. + * + * @param lastModified the lastModified value to set. + * @return the DirectoryCreateHeaders object itself. + */ + public DirectoryCreateHeaders lastModified(OffsetDateTime lastModified) { + if (lastModified == null) { + this.lastModified = null; + } else { + this.lastModified = new DateTimeRfc1123(lastModified); + } + return this; + } + + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the DirectoryCreateHeaders object itself. + */ + public DirectoryCreateHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + + /** + * Get the requestId property: A server-generated UUID recorded in the + * analytics logs for troubleshooting and correlation. + * + * @return the requestId value. + */ + public String requestId() { + return this.requestId; + } + + /** + * Set the requestId property: A server-generated UUID recorded in the + * analytics logs for troubleshooting and correlation. + * + * @param requestId the requestId value to set. + * @return the DirectoryCreateHeaders object itself. + */ + public DirectoryCreateHeaders requestId(String requestId) { + this.requestId = requestId; + return this; + } + + /** + * Get the version property: The version of the REST protocol used to + * process the request. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of the REST protocol used to + * process the request. + * + * @param version the version value to set. + * @return the DirectoryCreateHeaders object itself. + */ + public DirectoryCreateHeaders version(String version) { + this.version = version; + return this; + } + + /** + * Get the contentLength property: The size of the resource in bytes. + * + * @return the contentLength value. + */ + public Long contentLength() { + return this.contentLength; + } + + /** + * Set the contentLength property: The size of the resource in bytes. + * + * @param contentLength the contentLength value to set. + * @return the DirectoryCreateHeaders object itself. + */ + public DirectoryCreateHeaders contentLength(Long contentLength) { + this.contentLength = contentLength; + return this; + } + + /** + * Get the dateProperty property: A UTC date/time value generated by the + * service that indicates the time at which the response was initiated. + * + * @return the dateProperty value. + */ + public OffsetDateTime dateProperty() { + if (this.dateProperty == null) { + return null; + } + return this.dateProperty.dateTime(); + } + + /** + * Set the dateProperty property: A UTC date/time value generated by the + * service that indicates the time at which the response was initiated. + * + * @param dateProperty the dateProperty value to set. + * @return the DirectoryCreateHeaders object itself. + */ + public DirectoryCreateHeaders dateProperty(OffsetDateTime dateProperty) { + if (dateProperty == null) { + this.dateProperty = null; + } else { + this.dateProperty = new DateTimeRfc1123(dateProperty); + } + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DirectoryDeleteHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DirectoryDeleteHeaders.java new file mode 100644 index 000000000000..921df9072945 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DirectoryDeleteHeaders.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.implementation.DateTimeRfc1123; +import com.azure.core.implementation.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.time.OffsetDateTime; + +/** + * Defines headers for Delete operation. + */ +@JacksonXmlRootElement(localName = "Directory-Delete-Headers") +@Fluent +public final class DirectoryDeleteHeaders { + /* + * When renaming a directory, the number of paths that are renamed with + * each invocation is limited. If the number of paths to be renamed exceeds + * this limit, a continuation token is returned in this response header. + * When a continuation token is returned in the response, it must be + * specified in a subsequent invocation of the rename operation to continue + * renaming the directory. + */ + @JsonProperty(value = "x-ms-continuation") + private String marker; + + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + + /* + * A server-generated UUID recorded in the analytics logs for + * troubleshooting and correlation. + */ + @JsonProperty(value = "x-ms-request-id") + private String requestId; + + /* + * The version of the REST protocol used to process the request. + */ + @JsonProperty(value = "x-ms-version") + private String version; + + /* + * A UTC date/time value generated by the service that indicates the time + * at which the response was initiated. + */ + @JsonProperty(value = "Date") + private DateTimeRfc1123 dateProperty; + + /** + * Get the marker property: When renaming a directory, the number of paths + * that are renamed with each invocation is limited. If the number of paths + * to be renamed exceeds this limit, a continuation token is returned in + * this response header. When a continuation token is returned in the + * response, it must be specified in a subsequent invocation of the rename + * operation to continue renaming the directory. + * + * @return the marker value. + */ + public String marker() { + return this.marker; + } + + /** + * Set the marker property: When renaming a directory, the number of paths + * that are renamed with each invocation is limited. If the number of paths + * to be renamed exceeds this limit, a continuation token is returned in + * this response header. When a continuation token is returned in the + * response, it must be specified in a subsequent invocation of the rename + * operation to continue renaming the directory. + * + * @param marker the marker value to set. + * @return the DirectoryDeleteHeaders object itself. + */ + public DirectoryDeleteHeaders marker(String marker) { + this.marker = marker; + return this; + } + + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the DirectoryDeleteHeaders object itself. + */ + public DirectoryDeleteHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + + /** + * Get the requestId property: A server-generated UUID recorded in the + * analytics logs for troubleshooting and correlation. + * + * @return the requestId value. + */ + public String requestId() { + return this.requestId; + } + + /** + * Set the requestId property: A server-generated UUID recorded in the + * analytics logs for troubleshooting and correlation. + * + * @param requestId the requestId value to set. + * @return the DirectoryDeleteHeaders object itself. + */ + public DirectoryDeleteHeaders requestId(String requestId) { + this.requestId = requestId; + return this; + } + + /** + * Get the version property: The version of the REST protocol used to + * process the request. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of the REST protocol used to + * process the request. + * + * @param version the version value to set. + * @return the DirectoryDeleteHeaders object itself. + */ + public DirectoryDeleteHeaders version(String version) { + this.version = version; + return this; + } + + /** + * Get the dateProperty property: A UTC date/time value generated by the + * service that indicates the time at which the response was initiated. + * + * @return the dateProperty value. + */ + public OffsetDateTime dateProperty() { + if (this.dateProperty == null) { + return null; + } + return this.dateProperty.dateTime(); + } + + /** + * Set the dateProperty property: A UTC date/time value generated by the + * service that indicates the time at which the response was initiated. + * + * @param dateProperty the dateProperty value to set. + * @return the DirectoryDeleteHeaders object itself. + */ + public DirectoryDeleteHeaders dateProperty(OffsetDateTime dateProperty) { + if (dateProperty == null) { + this.dateProperty = null; + } else { + this.dateProperty = new DateTimeRfc1123(dateProperty); + } + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DirectoryHttpHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DirectoryHttpHeaders.java new file mode 100644 index 000000000000..ae0dd3997576 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DirectoryHttpHeaders.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.implementation.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; + +/** + * Additional parameters for a set of operations, such as: Directorys_create, + * Directorys_rename, Blobs_rename. + */ +@JacksonXmlRootElement(localName = "directory-http-headers") +@Fluent +public final class DirectoryHttpHeaders { + /* + * Cache control for given resource + */ + @JsonProperty(value = "cacheControl") + private String cacheControl; + + /* + * Content type for given resource + */ + @JsonProperty(value = "contentType") + private String contentType; + + /* + * Content encoding for given resource + */ + @JsonProperty(value = "contentEncoding") + private String contentEncoding; + + /* + * Content language for given resource + */ + @JsonProperty(value = "contentLanguage") + private String contentLanguage; + + /* + * Content disposition for given resource + */ + @JsonProperty(value = "contentDisposition") + private String contentDisposition; + + /** + * Get the cacheControl property: Cache control for given resource. + * + * @return the cacheControl value. + */ + public String cacheControl() { + return this.cacheControl; + } + + /** + * Set the cacheControl property: Cache control for given resource. + * + * @param cacheControl the cacheControl value to set. + * @return the DirectoryHttpHeaders object itself. + */ + public DirectoryHttpHeaders cacheControl(String cacheControl) { + this.cacheControl = cacheControl; + return this; + } + + /** + * Get the contentType property: Content type for given resource. + * + * @return the contentType value. + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType property: Content type for given resource. + * + * @param contentType the contentType value to set. + * @return the DirectoryHttpHeaders object itself. + */ + public DirectoryHttpHeaders contentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the contentEncoding property: Content encoding for given resource. + * + * @return the contentEncoding value. + */ + public String contentEncoding() { + return this.contentEncoding; + } + + /** + * Set the contentEncoding property: Content encoding for given resource. + * + * @param contentEncoding the contentEncoding value to set. + * @return the DirectoryHttpHeaders object itself. + */ + public DirectoryHttpHeaders contentEncoding(String contentEncoding) { + this.contentEncoding = contentEncoding; + return this; + } + + /** + * Get the contentLanguage property: Content language for given resource. + * + * @return the contentLanguage value. + */ + public String contentLanguage() { + return this.contentLanguage; + } + + /** + * Set the contentLanguage property: Content language for given resource. + * + * @param contentLanguage the contentLanguage value to set. + * @return the DirectoryHttpHeaders object itself. + */ + public DirectoryHttpHeaders contentLanguage(String contentLanguage) { + this.contentLanguage = contentLanguage; + return this; + } + + /** + * Get the contentDisposition property: Content disposition for given + * resource. + * + * @return the contentDisposition value. + */ + public String contentDisposition() { + return this.contentDisposition; + } + + /** + * Set the contentDisposition property: Content disposition for given + * resource. + * + * @param contentDisposition the contentDisposition value to set. + * @return the DirectoryHttpHeaders object itself. + */ + public DirectoryHttpHeaders contentDisposition(String contentDisposition) { + this.contentDisposition = contentDisposition; + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DirectoryRenameHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DirectoryRenameHeaders.java new file mode 100644 index 000000000000..365780542a9c --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DirectoryRenameHeaders.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.implementation.DateTimeRfc1123; +import com.azure.core.implementation.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.time.OffsetDateTime; + +/** + * Defines headers for Rename operation. + */ +@JacksonXmlRootElement(localName = "Directory-Rename-Headers") +@Fluent +public final class DirectoryRenameHeaders { + /* + * When renaming a directory, the number of paths that are renamed with + * each invocation is limited. If the number of paths to be renamed exceeds + * this limit, a continuation token is returned in this response header. + * When a continuation token is returned in the response, it must be + * specified in a subsequent invocation of the rename operation to continue + * renaming the directory. + */ + @JsonProperty(value = "x-ms-continuation") + private String marker; + + /* + * An HTTP entity tag associated with the file or directory. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /* + * The data and time the file or directory was last modified. Write + * operations on the file or directory update the last modified time. + */ + @JsonProperty(value = "Last-Modified") + private DateTimeRfc1123 lastModified; + + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + + /* + * A server-generated UUID recorded in the analytics logs for + * troubleshooting and correlation. + */ + @JsonProperty(value = "x-ms-request-id") + private String requestId; + + /* + * The version of the REST protocol used to process the request. + */ + @JsonProperty(value = "x-ms-version") + private String version; + + /* + * The size of the resource in bytes. + */ + @JsonProperty(value = "Content-Length") + private Long contentLength; + + /* + * A UTC date/time value generated by the service that indicates the time + * at which the response was initiated. + */ + @JsonProperty(value = "Date") + private DateTimeRfc1123 dateProperty; + + /** + * Get the marker property: When renaming a directory, the number of paths + * that are renamed with each invocation is limited. If the number of paths + * to be renamed exceeds this limit, a continuation token is returned in + * this response header. When a continuation token is returned in the + * response, it must be specified in a subsequent invocation of the rename + * operation to continue renaming the directory. + * + * @return the marker value. + */ + public String marker() { + return this.marker; + } + + /** + * Set the marker property: When renaming a directory, the number of paths + * that are renamed with each invocation is limited. If the number of paths + * to be renamed exceeds this limit, a continuation token is returned in + * this response header. When a continuation token is returned in the + * response, it must be specified in a subsequent invocation of the rename + * operation to continue renaming the directory. + * + * @param marker the marker value to set. + * @return the DirectoryRenameHeaders object itself. + */ + public DirectoryRenameHeaders marker(String marker) { + this.marker = marker; + return this; + } + + /** + * Get the eTag property: An HTTP entity tag associated with the file or + * directory. + * + * @return the eTag value. + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the eTag property: An HTTP entity tag associated with the file or + * directory. + * + * @param eTag the eTag value to set. + * @return the DirectoryRenameHeaders object itself. + */ + public DirectoryRenameHeaders eTag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get the lastModified property: The data and time the file or directory + * was last modified. Write operations on the file or directory update the + * last modified time. + * + * @return the lastModified value. + */ + public OffsetDateTime lastModified() { + if (this.lastModified == null) { + return null; + } + return this.lastModified.dateTime(); + } + + /** + * Set the lastModified property: The data and time the file or directory + * was last modified. Write operations on the file or directory update the + * last modified time. + * + * @param lastModified the lastModified value to set. + * @return the DirectoryRenameHeaders object itself. + */ + public DirectoryRenameHeaders lastModified(OffsetDateTime lastModified) { + if (lastModified == null) { + this.lastModified = null; + } else { + this.lastModified = new DateTimeRfc1123(lastModified); + } + return this; + } + + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the DirectoryRenameHeaders object itself. + */ + public DirectoryRenameHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + + /** + * Get the requestId property: A server-generated UUID recorded in the + * analytics logs for troubleshooting and correlation. + * + * @return the requestId value. + */ + public String requestId() { + return this.requestId; + } + + /** + * Set the requestId property: A server-generated UUID recorded in the + * analytics logs for troubleshooting and correlation. + * + * @param requestId the requestId value to set. + * @return the DirectoryRenameHeaders object itself. + */ + public DirectoryRenameHeaders requestId(String requestId) { + this.requestId = requestId; + return this; + } + + /** + * Get the version property: The version of the REST protocol used to + * process the request. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of the REST protocol used to + * process the request. + * + * @param version the version value to set. + * @return the DirectoryRenameHeaders object itself. + */ + public DirectoryRenameHeaders version(String version) { + this.version = version; + return this; + } + + /** + * Get the contentLength property: The size of the resource in bytes. + * + * @return the contentLength value. + */ + public Long contentLength() { + return this.contentLength; + } + + /** + * Set the contentLength property: The size of the resource in bytes. + * + * @param contentLength the contentLength value to set. + * @return the DirectoryRenameHeaders object itself. + */ + public DirectoryRenameHeaders contentLength(Long contentLength) { + this.contentLength = contentLength; + return this; + } + + /** + * Get the dateProperty property: A UTC date/time value generated by the + * service that indicates the time at which the response was initiated. + * + * @return the dateProperty value. + */ + public OffsetDateTime dateProperty() { + if (this.dateProperty == null) { + return null; + } + return this.dateProperty.dateTime(); + } + + /** + * Set the dateProperty property: A UTC date/time value generated by the + * service that indicates the time at which the response was initiated. + * + * @param dateProperty the dateProperty value to set. + * @return the DirectoryRenameHeaders object itself. + */ + public DirectoryRenameHeaders dateProperty(OffsetDateTime dateProperty) { + if (dateProperty == null) { + this.dateProperty = null; + } else { + this.dateProperty = new DateTimeRfc1123(dateProperty); + } + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DirectorysCreateResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DirectorysCreateResponse.java new file mode 100644 index 000000000000..884c526dda38 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DirectorysCreateResponse.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** + * Contains all response data for the create operation. + */ +public final class DirectorysCreateResponse extends ResponseBase { + /** + * Creates an instance of DirectorysCreateResponse. + * + * @param request the request which resulted in this DirectorysCreateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public DirectorysCreateResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, DirectoryCreateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DirectorysDeleteResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DirectorysDeleteResponse.java new file mode 100644 index 000000000000..6e3c9d532875 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DirectorysDeleteResponse.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** + * Contains all response data for the delete operation. + */ +public final class DirectorysDeleteResponse extends ResponseBase { + /** + * Creates an instance of DirectorysDeleteResponse. + * + * @param request the request which resulted in this DirectorysDeleteResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public DirectorysDeleteResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, DirectoryDeleteHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DirectorysRenameResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DirectorysRenameResponse.java new file mode 100644 index 000000000000..afea46a8180b --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DirectorysRenameResponse.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** + * Contains all response data for the rename operation. + */ +public final class DirectorysRenameResponse extends ResponseBase { + /** + * Creates an instance of DirectorysRenameResponse. + * + * @param request the request which resulted in this DirectorysRenameResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public DirectorysRenameResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, DirectoryRenameHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/FilterBlobsItem.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/FilterBlobsItem.java new file mode 100644 index 000000000000..477c3efb3f87 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/FilterBlobsItem.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.implementation.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; + +/** + * The FilterBlobsItem model. + */ +@JacksonXmlRootElement(localName = "Blob") +@Fluent +public final class FilterBlobsItem { + /* + * The name property. + */ + @JsonProperty(value = "Name") + private String name; + + /* + * The containerName property. + */ + @JsonProperty(value = "ContainerName") + private String containerName; + + /* + * The tagValue property. + */ + @JsonProperty(value = "TagValue") + private String tagValue; + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the FilterBlobsItem object itself. + */ + public FilterBlobsItem name(String name) { + this.name = name; + return this; + } + + /** + * Get the containerName property: The containerName property. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: The containerName property. + * + * @param containerName the containerName value to set. + * @return the FilterBlobsItem object itself. + */ + public FilterBlobsItem containerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the tagValue property: The tagValue property. + * + * @return the tagValue value. + */ + public String tagValue() { + return this.tagValue; + } + + /** + * Set the tagValue property: The tagValue property. + * + * @param tagValue the tagValue value to set. + * @return the FilterBlobsItem object itself. + */ + public FilterBlobsItem tagValue(String tagValue) { + this.tagValue = tagValue; + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/FilterBlobsResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/FilterBlobsResponse.java new file mode 100644 index 000000000000..df691b96b781 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/FilterBlobsResponse.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.implementation.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; + +/** + * An enumeration of blobs which matched the filter. + */ +@JacksonXmlRootElement(localName = "EnumerationResults") +@Fluent +public final class FilterBlobsResponse { + /* + * The serviceEndpoint property. + */ + @JacksonXmlProperty(localName = "ServiceEndpoint", isAttribute = true) + private String serviceEndpoint; + + /* + * The filter property. + */ + @JsonProperty(value = "Filter", required = true) + private String filter; + + /* + * The marker property. + */ + @JsonProperty(value = "Marker") + private String marker; + + /* + * The maxResults property. + */ + @JsonProperty(value = "MaxResults") + private Integer maxResults; + + /* + * The segment property. + */ + @JsonProperty(value = "Blobs", required = true) + private FilterBlobsSegment segment; + + /* + * The nextMarker property. + */ + @JsonProperty(value = "NextMarker", required = true) + private String nextMarker; + + /** + * Get the serviceEndpoint property: The serviceEndpoint property. + * + * @return the serviceEndpoint value. + */ + public String serviceEndpoint() { + return this.serviceEndpoint; + } + + /** + * Set the serviceEndpoint property: The serviceEndpoint property. + * + * @param serviceEndpoint the serviceEndpoint value to set. + * @return the FilterBlobsResponse object itself. + */ + public FilterBlobsResponse serviceEndpoint(String serviceEndpoint) { + this.serviceEndpoint = serviceEndpoint; + return this; + } + + /** + * Get the filter property: The filter property. + * + * @return the filter value. + */ + public String filter() { + return this.filter; + } + + /** + * Set the filter property: The filter property. + * + * @param filter the filter value to set. + * @return the FilterBlobsResponse object itself. + */ + public FilterBlobsResponse filter(String filter) { + this.filter = filter; + return this; + } + + /** + * Get the marker property: The marker property. + * + * @return the marker value. + */ + public String marker() { + return this.marker; + } + + /** + * Set the marker property: The marker property. + * + * @param marker the marker value to set. + * @return the FilterBlobsResponse object itself. + */ + public FilterBlobsResponse marker(String marker) { + this.marker = marker; + return this; + } + + /** + * Get the maxResults property: The maxResults property. + * + * @return the maxResults value. + */ + public Integer maxResults() { + return this.maxResults; + } + + /** + * Set the maxResults property: The maxResults property. + * + * @param maxResults the maxResults value to set. + * @return the FilterBlobsResponse object itself. + */ + public FilterBlobsResponse maxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + /** + * Get the segment property: The segment property. + * + * @return the segment value. + */ + public FilterBlobsSegment segment() { + return this.segment; + } + + /** + * Set the segment property: The segment property. + * + * @param segment the segment value to set. + * @return the FilterBlobsResponse object itself. + */ + public FilterBlobsResponse segment(FilterBlobsSegment segment) { + this.segment = segment; + return this; + } + + /** + * Get the nextMarker property: The nextMarker property. + * + * @return the nextMarker value. + */ + public String nextMarker() { + return this.nextMarker; + } + + /** + * Set the nextMarker property: The nextMarker property. + * + * @param nextMarker the nextMarker value to set. + * @return the FilterBlobsResponse object itself. + */ + public FilterBlobsResponse nextMarker(String nextMarker) { + this.nextMarker = nextMarker; + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/FilterBlobsSegment.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/FilterBlobsSegment.java new file mode 100644 index 000000000000..c4daa8b128f6 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/FilterBlobsSegment.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.implementation.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.ArrayList; +import java.util.List; + +/** + * The FilterBlobsSegment model. + */ +@JacksonXmlRootElement(localName = "Blobs") +@Fluent +public final class FilterBlobsSegment { + /* + * The blobItems property. + */ + @JsonProperty("Blob") + private List blobItems = new ArrayList<>(); + + /** + * Get the blobItems property: The blobItems property. + * + * @return the blobItems value. + */ + public List blobItems() { + return this.blobItems; + } + + /** + * Set the blobItems property: The blobItems property. + * + * @param blobItems the blobItems value to set. + * @return the FilterBlobsSegment object itself. + */ + public FilterBlobsSegment blobItems(List blobItems) { + this.blobItems = blobItems; + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ListBlobsIncludeItem.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ListBlobsIncludeItem.java index 47ed4cbfd72f..6da8de210231 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ListBlobsIncludeItem.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ListBlobsIncludeItem.java @@ -31,6 +31,11 @@ public enum ListBlobsIncludeItem { */ SNAPSHOTS("snapshots"), + /** + * Enum value tags. + */ + TAGS("tags"), + /** * Enum value uncommittedblobs. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobClearPagesHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobClearPagesHeaders.java index 543c829bf271..c5c125eda749 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobClearPagesHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobClearPagesHeaders.java @@ -41,12 +41,27 @@ public final class PageBlobClearPagesHeaders { @JsonProperty(value = "Content-MD5") private byte[] contentMD5; + /* + * This header is returned so that the client can check for message content + * integrity. The value of this header is computed by the Blob service; it + * is not necessarily the same value specified in the request headers. + */ + @JsonProperty(value = "x-ms-content-crc64") + private byte[] xMsContentCrc64; + /* * The current sequence number for the page blob. */ @JsonProperty(value = "x-ms-blob-sequence-number") private Long blobSequenceNumber; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -156,6 +171,32 @@ public PageBlobClearPagesHeaders contentMD5(byte[] contentMD5) { return this; } + /** + * Get the xMsContentCrc64 property: This header is returned so that the + * client can check for message content integrity. The value of this header + * is computed by the Blob service; it is not necessarily the same value + * specified in the request headers. + * + * @return the xMsContentCrc64 value. + */ + public byte[] xMsContentCrc64() { + return ImplUtils.clone(this.xMsContentCrc64); + } + + /** + * Set the xMsContentCrc64 property: This header is returned so that the + * client can check for message content integrity. The value of this header + * is computed by the Blob service; it is not necessarily the same value + * specified in the request headers. + * + * @param xMsContentCrc64 the xMsContentCrc64 value to set. + * @return the PageBlobClearPagesHeaders object itself. + */ + public PageBlobClearPagesHeaders xMsContentCrc64(byte[] xMsContentCrc64) { + this.xMsContentCrc64 = ImplUtils.clone(xMsContentCrc64); + return this; + } + /** * Get the blobSequenceNumber property: The current sequence number for the * page blob. @@ -178,6 +219,30 @@ public PageBlobClearPagesHeaders blobSequenceNumber(Long blobSequenceNumber) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the PageBlobClearPagesHeaders object itself. + */ + public PageBlobClearPagesHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobCopyIncrementalHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobCopyIncrementalHeaders.java index 7e9aa95c1ff3..2447b0c346b0 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobCopyIncrementalHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobCopyIncrementalHeaders.java @@ -32,6 +32,13 @@ public final class PageBlobCopyIncrementalHeaders { @JsonProperty(value = "Last-Modified") private DateTimeRfc1123 lastModified; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -132,6 +139,30 @@ public PageBlobCopyIncrementalHeaders lastModified(OffsetDateTime lastModified) return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the PageBlobCopyIncrementalHeaders object itself. + */ + public PageBlobCopyIncrementalHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobCreateHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobCreateHeaders.java index 6c4192fe4806..19b603ab7b6e 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobCreateHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobCreateHeaders.java @@ -41,6 +41,13 @@ public final class PageBlobCreateHeaders { @JsonProperty(value = "Content-MD5") private byte[] contentMD5; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -87,6 +94,13 @@ public final class PageBlobCreateHeaders { @JsonProperty(value = "x-ms-encryption-key-sha256") private String encryptionKeySha256; + /* + * The encryption scope used to encrypt the blob. This header is only + * returned when the blob was encrypted with customer specified encryption. + */ + @JsonProperty(value = "x-ms-encryption-scope") + private String encryptionScope; + /* * The errorCode property. */ @@ -174,6 +188,30 @@ public PageBlobCreateHeaders contentMD5(byte[] contentMD5) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the PageBlobCreateHeaders object itself. + */ + public PageBlobCreateHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. @@ -321,6 +359,30 @@ public PageBlobCreateHeaders encryptionKeySha256(String encryptionKeySha256) { return this; } + /** + * Get the encryptionScope property: The encryption scope used to encrypt + * the blob. This header is only returned when the blob was encrypted with + * customer specified encryption. + * + * @return the encryptionScope value. + */ + public String encryptionScope() { + return this.encryptionScope; + } + + /** + * Set the encryptionScope property: The encryption scope used to encrypt + * the blob. This header is only returned when the blob was encrypted with + * customer specified encryption. + * + * @param encryptionScope the encryptionScope value to set. + * @return the PageBlobCreateHeaders object itself. + */ + public PageBlobCreateHeaders encryptionScope(String encryptionScope) { + this.encryptionScope = encryptionScope; + return this; + } + /** * Get the errorCode property: The errorCode property. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobGetPageRangesDiffHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobGetPageRangesDiffHeaders.java index c1d14635bf44..da04c9aff1b9 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobGetPageRangesDiffHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobGetPageRangesDiffHeaders.java @@ -38,6 +38,13 @@ public final class PageBlobGetPageRangesDiffHeaders { @JsonProperty(value = "x-ms-blob-content-length") private Long blobContentLength; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -143,6 +150,30 @@ public PageBlobGetPageRangesDiffHeaders blobContentLength(Long blobContentLength return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the PageBlobGetPageRangesDiffHeaders object itself. + */ + public PageBlobGetPageRangesDiffHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobGetPageRangesHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobGetPageRangesHeaders.java index 32b37ef1452c..90a9a9add17d 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobGetPageRangesHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobGetPageRangesHeaders.java @@ -38,6 +38,13 @@ public final class PageBlobGetPageRangesHeaders { @JsonProperty(value = "x-ms-blob-content-length") private Long blobContentLength; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -143,6 +150,30 @@ public PageBlobGetPageRangesHeaders blobContentLength(Long blobContentLength) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the PageBlobGetPageRangesHeaders object itself. + */ + public PageBlobGetPageRangesHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobResizeHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobResizeHeaders.java index e03c8720d2b6..43470469598d 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobResizeHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobResizeHeaders.java @@ -39,6 +39,13 @@ public final class PageBlobResizeHeaders { @JsonProperty(value = "x-ms-blob-sequence-number") private Long blobSequenceNumber; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -146,6 +153,30 @@ public PageBlobResizeHeaders blobSequenceNumber(Long blobSequenceNumber) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the PageBlobResizeHeaders object itself. + */ + public PageBlobResizeHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobUpdateSequenceNumberHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobUpdateSequenceNumberHeaders.java index 5f606b24c262..52a2b49532c9 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobUpdateSequenceNumberHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobUpdateSequenceNumberHeaders.java @@ -39,6 +39,13 @@ public final class PageBlobUpdateSequenceNumberHeaders { @JsonProperty(value = "x-ms-blob-sequence-number") private Long blobSequenceNumber; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -146,6 +153,30 @@ public PageBlobUpdateSequenceNumberHeaders blobSequenceNumber(Long blobSequenceN return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the PageBlobUpdateSequenceNumberHeaders object itself. + */ + public PageBlobUpdateSequenceNumberHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobUploadPagesFromURLHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobUploadPagesFromURLHeaders.java index cebeb20842e3..d80a0eb276cd 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobUploadPagesFromURLHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobUploadPagesFromURLHeaders.java @@ -41,6 +41,14 @@ public final class PageBlobUploadPagesFromURLHeaders { @JsonProperty(value = "Content-MD5") private byte[] contentMD5; + /* + * This header is returned so that the client can check for message content + * integrity. The value of this header is computed by the Blob service; it + * is not necessarily the same value specified in the request headers. + */ + @JsonProperty(value = "x-ms-content-crc64") + private byte[] xMsContentCrc64; + /* * The current sequence number for the page blob. */ @@ -164,6 +172,32 @@ public PageBlobUploadPagesFromURLHeaders contentMD5(byte[] contentMD5) { return this; } + /** + * Get the xMsContentCrc64 property: This header is returned so that the + * client can check for message content integrity. The value of this header + * is computed by the Blob service; it is not necessarily the same value + * specified in the request headers. + * + * @return the xMsContentCrc64 value. + */ + public byte[] xMsContentCrc64() { + return ImplUtils.clone(this.xMsContentCrc64); + } + + /** + * Set the xMsContentCrc64 property: This header is returned so that the + * client can check for message content integrity. The value of this header + * is computed by the Blob service; it is not necessarily the same value + * specified in the request headers. + * + * @param xMsContentCrc64 the xMsContentCrc64 value to set. + * @return the PageBlobUploadPagesFromURLHeaders object itself. + */ + public PageBlobUploadPagesFromURLHeaders xMsContentCrc64(byte[] xMsContentCrc64) { + this.xMsContentCrc64 = ImplUtils.clone(xMsContentCrc64); + return this; + } + /** * Get the blobSequenceNumber property: The current sequence number for the * page blob. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobUploadPagesHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobUploadPagesHeaders.java index 7dd8eb12ae72..ed9c5a3191a9 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobUploadPagesHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobUploadPagesHeaders.java @@ -41,12 +41,27 @@ public final class PageBlobUploadPagesHeaders { @JsonProperty(value = "Content-MD5") private byte[] contentMD5; + /* + * This header is returned so that the client can check for message content + * integrity. The value of this header is computed by the Blob service; it + * is not necessarily the same value specified in the request headers. + */ + @JsonProperty(value = "x-ms-content-crc64") + private byte[] xMsContentCrc64; + /* * The current sequence number for the page blob. */ @JsonProperty(value = "x-ms-blob-sequence-number") private Long blobSequenceNumber; + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -85,6 +100,14 @@ public final class PageBlobUploadPagesHeaders { @JsonProperty(value = "x-ms-encryption-key-sha256") private String encryptionKeySha256; + /* + * The encryption scope used to encrypt the pages. This header is only + * returned when the pages were encrypted with customer specified + * encryption. + */ + @JsonProperty(value = "x-ms-encryption-scope") + private String encryptionScope; + /* * The errorCode property. */ @@ -172,6 +195,32 @@ public PageBlobUploadPagesHeaders contentMD5(byte[] contentMD5) { return this; } + /** + * Get the xMsContentCrc64 property: This header is returned so that the + * client can check for message content integrity. The value of this header + * is computed by the Blob service; it is not necessarily the same value + * specified in the request headers. + * + * @return the xMsContentCrc64 value. + */ + public byte[] xMsContentCrc64() { + return ImplUtils.clone(this.xMsContentCrc64); + } + + /** + * Set the xMsContentCrc64 property: This header is returned so that the + * client can check for message content integrity. The value of this header + * is computed by the Blob service; it is not necessarily the same value + * specified in the request headers. + * + * @param xMsContentCrc64 the xMsContentCrc64 value to set. + * @return the PageBlobUploadPagesHeaders object itself. + */ + public PageBlobUploadPagesHeaders xMsContentCrc64(byte[] xMsContentCrc64) { + this.xMsContentCrc64 = ImplUtils.clone(xMsContentCrc64); + return this; + } + /** * Get the blobSequenceNumber property: The current sequence number for the * page blob. @@ -194,6 +243,30 @@ public PageBlobUploadPagesHeaders blobSequenceNumber(Long blobSequenceNumber) { return this; } + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the PageBlobUploadPagesHeaders object itself. + */ + public PageBlobUploadPagesHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. @@ -317,6 +390,30 @@ public PageBlobUploadPagesHeaders encryptionKeySha256(String encryptionKeySha256 return this; } + /** + * Get the encryptionScope property: The encryption scope used to encrypt + * the pages. This header is only returned when the pages were encrypted + * with customer specified encryption. + * + * @return the encryptionScope value. + */ + public String encryptionScope() { + return this.encryptionScope; + } + + /** + * Set the encryptionScope property: The encryption scope used to encrypt + * the pages. This header is only returned when the pages were encrypted + * with customer specified encryption. + * + * @param encryptionScope the encryptionScope value to set. + * @return the PageBlobUploadPagesHeaders object itself. + */ + public PageBlobUploadPagesHeaders encryptionScope(String encryptionScope) { + this.encryptionScope = encryptionScope; + return this; + } + /** * Get the errorCode property: The errorCode property. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PathRenameMode.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PathRenameMode.java new file mode 100644 index 000000000000..a63e11af27c3 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PathRenameMode.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for PathRenameMode. + */ +public enum PathRenameMode { + /** + * Enum value legacy. + */ + LEGACY("legacy"), + + /** + * Enum value posix. + */ + POSIX("posix"); + + /** + * The actual serialized value for a PathRenameMode instance. + */ + private final String value; + + PathRenameMode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PathRenameMode instance. + * + * @param value the serialized value to parse. + * @return the parsed PathRenameMode object, or null if unable to parse. + */ + @JsonCreator + public static PathRenameMode fromString(String value) { + PathRenameMode[] items = PathRenameMode.values(); + for (PathRenameMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/RehydratePriority.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/RehydratePriority.java new file mode 100644 index 000000000000..8fc928767f37 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/RehydratePriority.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines values for RehydratePriority. + */ +public final class RehydratePriority extends ExpandableStringEnum { + /** + * Static value High for RehydratePriority. + */ + public static final RehydratePriority HIGH = fromString("High"); + + /** + * Static value Standard for RehydratePriority. + */ + public static final RehydratePriority STANDARD = fromString("Standard"); + + /** + * Creates or finds a RehydratePriority from its string representation. + * + * @param name a name to look for. + * @return the corresponding RehydratePriority. + */ + @JsonCreator + public static RehydratePriority fromString(String name) { + return fromString(name, RehydratePriority.class); + } + + /** + * @return known RehydratePriority values. + */ + public static Collection values() { + return values(RehydratePriority.class); + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceFilterBlobsHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceFilterBlobsHeaders.java new file mode 100644 index 000000000000..ca07c5d37ffb --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceFilterBlobsHeaders.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.implementation.DateTimeRfc1123; +import com.azure.core.implementation.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.time.OffsetDateTime; + +/** + * Defines headers for FilterBlobs operation. + */ +@JacksonXmlRootElement(localName = "Service-FilterBlobs-Headers") +@Fluent +public final class ServiceFilterBlobsHeaders { + /* + * The media type of the body of the response. For Filter Blobs this is + * 'application/xml' + */ + @JsonProperty(value = "Content-Type") + private String contentType; + + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + + /* + * This header uniquely identifies the request that was made and can be + * used for troubleshooting the request. + */ + @JsonProperty(value = "x-ms-request-id") + private String requestId; + + /* + * Indicates the version of the Blob service used to execute the request. + * This header is returned for requests made against version 2009-09-19 and + * above. + */ + @JsonProperty(value = "x-ms-version") + private String version; + + /* + * UTC date/time value generated by the service that indicates the time at + * which the response was initiated + */ + @JsonProperty(value = "Date") + private DateTimeRfc1123 dateProperty; + + /* + * The errorCode property. + */ + @JsonProperty(value = "x-ms-error-code") + private String errorCode; + + /** + * Get the contentType property: The media type of the body of the + * response. For Filter Blobs this is 'application/xml'. + * + * @return the contentType value. + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType property: The media type of the body of the + * response. For Filter Blobs this is 'application/xml'. + * + * @param contentType the contentType value to set. + * @return the ServiceFilterBlobsHeaders object itself. + */ + public ServiceFilterBlobsHeaders contentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the ServiceFilterBlobsHeaders object itself. + */ + public ServiceFilterBlobsHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + + /** + * Get the requestId property: This header uniquely identifies the request + * that was made and can be used for troubleshooting the request. + * + * @return the requestId value. + */ + public String requestId() { + return this.requestId; + } + + /** + * Set the requestId property: This header uniquely identifies the request + * that was made and can be used for troubleshooting the request. + * + * @param requestId the requestId value to set. + * @return the ServiceFilterBlobsHeaders object itself. + */ + public ServiceFilterBlobsHeaders requestId(String requestId) { + this.requestId = requestId; + return this; + } + + /** + * Get the version property: Indicates the version of the Blob service used + * to execute the request. This header is returned for requests made + * against version 2009-09-19 and above. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Indicates the version of the Blob service used + * to execute the request. This header is returned for requests made + * against version 2009-09-19 and above. + * + * @param version the version value to set. + * @return the ServiceFilterBlobsHeaders object itself. + */ + public ServiceFilterBlobsHeaders version(String version) { + this.version = version; + return this; + } + + /** + * Get the dateProperty property: UTC date/time value generated by the + * service that indicates the time at which the response was initiated. + * + * @return the dateProperty value. + */ + public OffsetDateTime dateProperty() { + if (this.dateProperty == null) { + return null; + } + return this.dateProperty.dateTime(); + } + + /** + * Set the dateProperty property: UTC date/time value generated by the + * service that indicates the time at which the response was initiated. + * + * @param dateProperty the dateProperty value to set. + * @return the ServiceFilterBlobsHeaders object itself. + */ + public ServiceFilterBlobsHeaders dateProperty(OffsetDateTime dateProperty) { + if (dateProperty == null) { + this.dateProperty = null; + } else { + this.dateProperty = new DateTimeRfc1123(dateProperty); + } + return this; + } + + /** + * Get the errorCode property: The errorCode property. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: The errorCode property. + * + * @param errorCode the errorCode value to set. + * @return the ServiceFilterBlobsHeaders object itself. + */ + public ServiceFilterBlobsHeaders errorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceGetAccountInfoHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceGetAccountInfoHeaders.java index 88fa50830518..aab5284aa123 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceGetAccountInfoHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceGetAccountInfoHeaders.java @@ -16,6 +16,13 @@ @JacksonXmlRootElement(localName = "Service-GetAccountInfo-Headers") @Fluent public final class ServiceGetAccountInfoHeaders { + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -59,6 +66,30 @@ public final class ServiceGetAccountInfoHeaders { @JsonProperty(value = "x-ms-error-code") private String errorCode; + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the ServiceGetAccountInfoHeaders object itself. + */ + public ServiceGetAccountInfoHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceGetPropertiesHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceGetPropertiesHeaders.java index 3b5b06ab3259..4fec9f3c872d 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceGetPropertiesHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceGetPropertiesHeaders.java @@ -14,6 +14,13 @@ @JacksonXmlRootElement(localName = "Service-GetProperties-Headers") @Fluent public final class ServiceGetPropertiesHeaders { + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -35,6 +42,30 @@ public final class ServiceGetPropertiesHeaders { @JsonProperty(value = "x-ms-error-code") private String errorCode; + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the ServiceGetPropertiesHeaders object itself. + */ + public ServiceGetPropertiesHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceGetStatisticsHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceGetStatisticsHeaders.java index 55dda9cc8ddb..a10d852f62cd 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceGetStatisticsHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceGetStatisticsHeaders.java @@ -16,6 +16,13 @@ @JacksonXmlRootElement(localName = "Service-GetStatistics-Headers") @Fluent public final class ServiceGetStatisticsHeaders { + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -44,6 +51,30 @@ public final class ServiceGetStatisticsHeaders { @JsonProperty(value = "x-ms-error-code") private String errorCode; + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the ServiceGetStatisticsHeaders object itself. + */ + public ServiceGetStatisticsHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceGetUserDelegationKeyHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceGetUserDelegationKeyHeaders.java index 4a74086587af..f10866c90c55 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceGetUserDelegationKeyHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceGetUserDelegationKeyHeaders.java @@ -16,6 +16,13 @@ @JacksonXmlRootElement(localName = "Service-GetUserDelegationKey-Headers") @Fluent public final class ServiceGetUserDelegationKeyHeaders { + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -44,6 +51,30 @@ public final class ServiceGetUserDelegationKeyHeaders { @JsonProperty(value = "x-ms-error-code") private String errorCode; + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the ServiceGetUserDelegationKeyHeaders object itself. + */ + public ServiceGetUserDelegationKeyHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceListContainersSegmentHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceListContainersSegmentHeaders.java index 94908506ede7..93e1c98ec97a 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceListContainersSegmentHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceListContainersSegmentHeaders.java @@ -14,6 +14,13 @@ @JacksonXmlRootElement(localName = "Service-ListContainersSegment-Headers") @Fluent public final class ServiceListContainersSegmentHeaders { + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -35,6 +42,30 @@ public final class ServiceListContainersSegmentHeaders { @JsonProperty(value = "x-ms-error-code") private String errorCode; + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the ServiceListContainersSegmentHeaders object itself. + */ + public ServiceListContainersSegmentHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceSetPropertiesHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceSetPropertiesHeaders.java index df15cc766400..b7ea86bc9fdb 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceSetPropertiesHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServiceSetPropertiesHeaders.java @@ -14,6 +14,13 @@ @JacksonXmlRootElement(localName = "Service-SetProperties-Headers") @Fluent public final class ServiceSetPropertiesHeaders { + /* + * If a client request id header is sent in the request, this header will + * be present in the response with the same value. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String clientRequestId; + /* * This header uniquely identifies the request that was made and can be * used for troubleshooting the request. @@ -35,6 +42,30 @@ public final class ServiceSetPropertiesHeaders { @JsonProperty(value = "x-ms-error-code") private String errorCode; + /** + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @return the clientRequestId value. + */ + public String clientRequestId() { + return this.clientRequestId; + } + + /** + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. + * + * @param clientRequestId the clientRequestId value to set. + * @return the ServiceSetPropertiesHeaders object itself. + */ + public ServiceSetPropertiesHeaders clientRequestId(String clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + /** * Get the requestId property: This header uniquely identifies the request * that was made and can be used for troubleshooting the request. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServicesFilterBlobsResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServicesFilterBlobsResponse.java new file mode 100644 index 000000000000..1ab8de38f430 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ServicesFilterBlobsResponse.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** + * Contains all response data for the filterBlobs operation. + */ +public final class ServicesFilterBlobsResponse extends ResponseBase { + /** + * Creates an instance of ServicesFilterBlobsResponse. + * + * @param request the request which resulted in this ServicesFilterBlobsResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ServicesFilterBlobsResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, FilterBlobsResponse value, ServiceFilterBlobsHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * @return the deserialized response body. + */ + @Override + public FilterBlobsResponse value() { + return super.value(); + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/StorageError.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/StorageError.java index 2f8f01f4f6f9..34b97f155d7d 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/StorageError.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/StorageError.java @@ -14,38 +14,12 @@ @JacksonXmlRootElement(localName = "StorageError") @Fluent public final class StorageError { - /* - * The code property. - */ - @JsonProperty(value = "Code") - private String code; - /* * The message property. */ @JsonProperty(value = "Message") private String message; - /** - * Get the code property: The code property. - * - * @return the code value. - */ - public String code() { - return this.code; - } - - /** - * Set the code property: The code property. - * - * @param code the code value to set. - * @return the StorageError object itself. - */ - public StorageError code(String code) { - this.code = code; - return this; - } - /** * Get the message property: The message property. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/StorageErrorCode.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/StorageErrorCode.java index 5ef1a7209dee..36fc044b9211 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/StorageErrorCode.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/StorageErrorCode.java @@ -32,11 +32,6 @@ public final class StorageErrorCode extends ExpandableStringEnum see https://aka.ms/autorest + +### Setup +```ps +cd C:\work +git clone --recursive https://github.com/Azure/autorest.java/ +cd autorest.java +git checkout v3 +npm install +cd .. +git clone --recursive https://github.com/jianghaolu/autorest.modeler/ +cd autorest.modeler +git checkout headerprefixfix +npm install +``` + +### Generation +```ps +cd +autorest --use=C:/work/autorest.java --use=C:/work/autorest.modeler --version=2.0.4280 +``` + +Due to limitations, after generation has completed add the `@JsonDeserialize(using = CustomHierarchicalListingDeserializer.class)` annotation to `BlobHierarchyListSegment`. + +### Code generation settings +``` yaml +input-file: ./blob-2019-02-02.json +java: true +output-folder: ../ +namespace: com.azure.storage.blob +enable-xml: true +generate-client-interfaces: false +sync-methods: none +license-header: MICROSOFT_MIT_SMALL +add-context-parameter: true +``` + +### /{containerName}?restype=container +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}?restype=container"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/ContainerName"); + $.put.parameters.splice(0, 0, { "$ref": path }); + $.get.parameters.splice(0, 0, { "$ref": path }); + $.delete.parameters.splice(0, 0, { "$ref": path }); + } +``` + +### /{containerName}?restype=container&comp=metadata +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}?restype=container&comp=metadata"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/ContainerName"); + $.put.parameters.splice(0, 0, { "$ref": path }); + } +``` + +### /{containerName}?restype=container&comp=acl +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}?restype=container&comp=acl"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/ContainerName"); + $.put.parameters.splice(0, 0, { "$ref": path }); + $.get.parameters.splice(0, 0, { "$ref": path }); + } +``` + +### /{containerName}?comp=lease&restype=container&acquire +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}?comp=lease&restype=container&acquire"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/ContainerName"); + $.put.parameters.splice(0, 0, { "$ref": path }); + } +``` + +### /{containerName}?comp=lease&restype=container&release +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}?comp=lease&restype=container&release"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/ContainerName"); + $.put.parameters.splice(0, 0, { "$ref": path }); + } +``` + +### /{containerName}?comp=lease&restype=container&renew +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}?comp=lease&restype=container&renew"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/ContainerName"); + $.put.parameters.splice(0, 0, { "$ref": path }); + } +``` + +### /{containerName}?comp=lease&restype=container&break +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}?comp=lease&restype=container&break"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/ContainerName"); + $.put.parameters.splice(0, 0, { "$ref": path }); + } +``` + +### /{containerName}?comp=lease&restype=container&change +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}?comp=lease&restype=container&change"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/ContainerName"); + $.put.parameters.splice(0, 0, { "$ref": path }); + } +``` + +### /{containerName}?restype=container&comp=list&flat +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}?restype=container&comp=list&flat"] + transform: > + let param = $.get.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/ContainerName"); + $.get.parameters.splice(0, 0, { "$ref": path }); + } +``` + +### /{containerName}?restype=container&comp=list&hierarchy +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}?restype=container&comp=list&hierarchy"] + transform: > + let param = $.get.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/ContainerName"); + $.get.parameters.splice(0, 0, { "$ref": path }); + } +``` + +### /{containerName}?restype=account&comp=properties +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}?restype=account&comp=properties"] + transform: > + let param = $.get.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/ContainerName"); + $.get.parameters.splice(0, 0, { "$ref": path }); + } +``` + +### /{containerName}/{blob} +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}"] + transform: > + let param = $.get.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.get.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.get.parameters.splice(1, 0, { "$ref": path + "Blob" }); + $.get.description = "The Download operation reads or downloads a blob from the system, including its metadata and properties. You can also call Download to read a snapshot or version."; + $.head.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.head.parameters.splice(1, 0, { "$ref": path + "Blob" }); + $.delete.description = "If the storage account's soft delete feature is disabled then, when a blob is deleted, it is permanently removed from the storage account. If the storage account's soft delete feature is enabled, then, when a blob is deleted, it is marked for deletion and becomes inaccessible immediately. However, the blob service retains the blob or snapshot for the number of days specified by the DeleteRetentionPolicy section of [Storage service properties] (Set-Blob-Service-Properties.md). After the specified number of days has passed, the blob's data is permanently removed from the storage account. Note that you continue to be charged for the soft-deleted blob's storage until it is permanently removed. Use the List Blobs API and specify the \"include=deleted\" query parameter to discover which blobs and snapshots have been soft deleted. You can then use the Undelete Blob API to restore a soft-deleted blob. All other operations on a soft-deleted blob or snapshot causes the service to return an HTTP status code of 404 (ResourceNotFound). If the storage account's automatic snapshot feature is enabled, then, when a blob is deleted, an automatic snapshot is created. The blob becomes inaccessible immediately. All other operations on the blob causes the service to return an HTTP status code of 404 (ResourceNotFound). You can access automatic snapshot using snapshot timestamp or version id. You can restore the blob by calling Put or Copy Blob API with automatic snapshot as source. Deleting automatic snapshot requires shared key or special SAS/RBAC permissions."; + $.delete.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.delete.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?PageBlob +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?PageBlob"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?AppendBlob +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?AppendBlob"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=appendblock +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=appendblock"] + transform: > + $.put.consumes = ["application/octet-stream"]; +``` + +### /{containerName}/{blob}?BlockBlob +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?BlockBlob"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=undelete +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=undelete"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=properties&SetHTTPHeaders +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=properties&SetHTTPHeaders"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=metadata +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=metadata"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=lease&acquire +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=lease&acquire"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=lease&release +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=lease&release"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=lease&renew +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=lease&renew"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=lease&change +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=lease&change"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=lease&break +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=lease&break"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=snapshot +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=snapshot"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=copy +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=copy"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + $.put.responses["202"].headers["x-ms-version-id"] = { + "x-ms-client-name": "VersionId", + "type": "string", + "description": "UTC date/time value generated by the service that identifies the version of the blob. This header is returned for requests made against version 2018-11-09 and above." + }; + } +``` + +### /{containerName}/{blob}?comp=copy&sync +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=copy&sync"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + $.put.responses["202"].headers["x-ms-version-id"] = { + "x-ms-client-name": "VersionId", + "type": "string", + "description": "UTC date/time value generated by the service that identifies the version of the blob. This header is returned for requests made against version 2018-11-09 and above." + }; + } +``` + +### /{containerName}/{blob}?comp=copy©id={CopyId} +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=copy©id={CopyId}"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=tier +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=tier"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?restype=account&comp=properties +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?restype=account&comp=properties"] + transform: > + let param = $.get.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.get.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.get.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=block +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=block"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=block&fromURL +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=block&fromURL"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=blocklist +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=blocklist"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + $.get.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.get.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=page&update +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=page&update"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=page&clear +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=page&clear"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=page&clear +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=page&clear"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=page&update&fromUrl +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=page&update&fromUrl"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=pagelist +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=pagelist"] + transform: > + let param = $.get.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.get.description = "The Get Page Ranges operation returns the list of valid page ranges for a page blob, version or snapshot of a page blob"; + $.get.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.get.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=pagelist&diff +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=pagelist&diff"] + transform: > + let param = $.get.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.get.description = "[Update] The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were changed between target blob and previous snapshot or version."; + $.get.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.get.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=properties&Resize +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=properties&Resize"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=properties&UpdateSequenceNumber +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=properties&UpdateSequenceNumber"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=incrementalcopy +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=incrementalcopy"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=appendblock +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=appendblock"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{containerName}/{blob}?comp=appendblock&fromUrl +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=appendblock&fromUrl"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### BlobItem +``` yaml +directive: +- from: swagger-document + where: $.definitions.BlobItem + transform: > + if (!$.required.includes("VersionId")) { + $.required.push("VersionId"); + $.properties.Metadata.type = "object"; + $.properties.Metadata.additionalProperties = { "type": "string" }; + delete $.properties.Metadata.$ref; + $.properties.VersionId = { "type": "string" }; + } + $.properties.IsPrefix = { "type": "boolean" }; +``` + +### BlobMetadata +Deleting out Encryption until https://github.com/Azure/azure-sdk-for-java/issues/5000 is determined. +``` yaml +directive: +- from: swagger-document + where: $.definitions.BlobMetadata + transform: > + delete $.properties +``` + +### BlobProperties +``` yaml +directive: +- from: swagger-document + where: $.definitions.BlobProperties + transform: > + $.properties.CustomerProvidedKeySha256 = { "type": "string" } +``` + +### ListBlobsFlatSegmentResponse +``` yaml +directive: +- from: swagger-document + where: $.definitions.ListBlobsFlatSegmentResponse + transform: > + if (!$.required.includes("Prefix")) { + $.required.push("Prefix"); + $.required.push("Marker"); + $.required.push("MaxResults"); + $.required.push("Delimiter"); + $.required.push("NextMarker"); + } +``` + +### ListBlobsHierarchySegmentResponse +``` yaml +directive: +- from: swagger-document + where: $.definitions.ListBlobsHierarchySegmentResponse + transform: > + if (!$.required.includes("Prefix")) { + $.required.push("Prefix"); + $.required.push("Marker"); + $.required.push("MaxResults"); + $.required.push("Delimiter"); + $.required.push("NextMarker"); + } +``` + +### ListContainersSegmentResponse +``` yaml +directive: +- from: swagger-document + where: $.definitions.ListContainersSegmentResponse + transform: > + if (!$.required.includes("Prefix")) { + $.required.push("Prefix"); + $.required.push("MaxResults"); + $.required.push("NextMarker"); + } +``` + +### SignedIdentifier +``` yaml +directive: +- from: swagger-document + where: $.definitions.SignedIdentifier + transform: > + if ($.xml) { + delete $.xml; + } +- from: swagger-document + where: $.definitions.SignedIdentifiers + transform: > + $.items.xml = { "name": "SignedIdentifier" } +``` + +### KeyInfo +``` yaml +directive: +- from: swagger-document + where: $.parameters.KeyInfo + transform: > + if ($["x-ms-parameter-location"]) { + delete $["x-ms-parameter-location"]; + } +``` + +### Make AccessTier Unique +autorest.python complains that the same enum has different values +``` yaml +directive: +- from: swagger-document + where: $.parameters.AccessTierRequired + transform: > + $["x-ms-enum"].name = "AccessTierRequired"; +- from: swagger-document + where: $.parameters.AccessTierOptional + transform: > + $["x-ms-enum"].name = "AccessTierOptional"; +``` + +### Extra parameters +``` yaml +directive: +- from: swagger-document + where: $.parameters + transform: > + if (!$.CacheControl) { + $.CacheControl = { + "name": "Cache-Control", + "x-ms-client-name": "cacheControl", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Cache control for given resource" + }; + } +``` + +### /{containerName}/{blob}?comp=tags +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=tags"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ContainerName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Blob" }); + $.get.parameters.splice(0, 0, { "$ref": path + "ContainerName" }); + $.get.parameters.splice(1, 0, { "$ref": path + "Blob" }); + } +``` + +### /{filesystem}/{path}?resource=directory&Create +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{filesystem}/{path}?resource=directory&Create"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("Filesystem")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "Filesystem" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Path" }); + } +``` + +### /{filesystem}/{path}?DirectoryRename +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{filesystem}/{path}?DirectoryRename"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("Filesystem")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "Filesystem" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Path" }); + } +``` + +### /{filesystem}/{path}?DirectoryDelete +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{filesystem}/{path}?DirectoryDelete"] + transform: > + let param = $.delete.parameters[0]; + if (!param["$ref"].endsWith("Filesystem")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.delete.parameters.splice(0, 0, { "$ref": path + "Filesystem" }); + $.delete.parameters.splice(1, 0, { "$ref": path + "Path" }); + } +``` + +### /{filesystem}/{path}?FileRename +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{filesystem}/{path}?FileRename"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("Filesystem")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/"); + $.put.parameters.splice(0, 0, { "$ref": path + "Filesystem" }); + $.put.parameters.splice(1, 0, { "$ref": path + "Path" }); + } +``` diff --git a/sdk/storage/azure-storage-blob/swagger/blob-2018-11-09.json b/sdk/storage/azure-storage-blob/swagger/blob-2018-11-09.json new file mode 100644 index 000000000000..0c15ff232003 --- /dev/null +++ b/sdk/storage/azure-storage-blob/swagger/blob-2018-11-09.json @@ -0,0 +1,8010 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Blob Storage", + "version": "2018-11-09", + "x-ms-code-generation-settings": { + "header": "MIT", + "strictSpecAdherence": false + } + }, + "x-ms-parameterized-host": { + "hostTemplate": "{url}", + "useSchemePrefix": false, + "positionInOperation": "first", + "parameters": [ + { + "$ref": "#/parameters/Url" + } + ] + }, + "securityDefinitions": { + "blob_shared_key": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + } + }, + "schemes": [ + "https" + ], + "consumes": [ + "application/xml" + ], + "produces": [ + "application/xml" + ], + "paths": {}, + "x-ms-paths": { + "/?restype=service&comp=properties": { + "put": { + "tags": [ + "service" + ], + "operationId": "Service_SetProperties", + "description": "Sets properties for a storage account's Blob service endpoint, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules", + "parameters": [ + { + "$ref": "#/parameters/StorageServiceProperties" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "Success (Accepted)", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "get": { + "tags": [ + "service" + ], + "operationId": "Service_GetProperties", + "description": "gets the properties of a storage account's Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + } + }, + "schema": { + "$ref": "#/definitions/StorageServiceProperties" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "service" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/?restype=service&comp=stats": { + "get": { + "tags": [ + "service" + ], + "operationId": "Service_GetStatistics", + "description": "Retrieves statistics related to replication for the Blob service. It is only available on the secondary location endpoint when read-access geo-redundant replication is enabled for the storage account.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/StorageServiceStats" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "service" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "stats" + ] + } + ] + }, + "/?comp=list": { + "get": { + "tags": [ + "service" + ], + "operationId": "Service_ListContainersSegment", + "description": "The List Containers Segment operation returns a list of the containers under the specified account", + "parameters": [ + { + "$ref": "#/parameters/Prefix" + }, + { + "$ref": "#/parameters/Marker" + }, + { + "$ref": "#/parameters/MaxResults" + }, + { + "$ref": "#/parameters/ListContainersInclude" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + } + }, + "schema": { + "$ref": "#/definitions/ListContainersSegmentResponse" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "NextMarker" + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "list" + ] + } + ] + }, + "/?restype=service&comp=userdelegationkey": { + "post": { + "tags": [ + "service" + ], + "operationId": "Service_GetUserDelegationKey", + "description": "Retrieves a user delgation key for the Blob service. This is only a valid operation when using bearer token authentication.", + "parameters": [ + { + "$ref": "#/parameters/KeyInfo" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/UserDelegationKey" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "service" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "userdelegationkey" + ] + } + ] + }, + "/?restype=account&comp=properties": { + "get": { + "tags": [ + "service" + ], + "operationId": "Service_GetAccountInfo", + "description": "Returns the sku name and account kind ", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success (OK)", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-sku-name": { + "x-ms-client-name": "SkuName", + "type": "string", + "enum": [ + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" + ], + "x-ms-enum": { + "name": "SkuName", + "modelAsString": false + }, + "description": "Identifies the sku name of the account" + }, + "x-ms-account-kind": { + "x-ms-client-name": "AccountKind", + "type": "string", + "enum": [ + "Storage", + "BlobStorage", + "StorageV2" + ], + "x-ms-enum": { + "name": "AccountKind", + "modelAsString": false + }, + "description": "Identifies the account kind" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "account" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{containerName}?restype=container": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_Create", + "description": "creates a new container under the specified account. If the container with the same name already exists, the operation fails", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/BlobPublicAccess" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "Success, Container created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "get": { + "tags": [ + "container" + ], + "operationId": "Container_GetProperties", + "description": "returns all user-defined metadata and system properties for the specified container. The data returned does not include the container's list of blobs", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "x-ms-meta": { + "type": "string", + "x-ms-client-name": "Metadata", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-duration": { + "x-ms-client-name": "LeaseDuration", + "description": "When a blob is leased, specifies whether the lease is of infinite or fixed duration.", + "type": "string", + "enum": [ + "infinite", + "fixed" + ], + "x-ms-enum": { + "name": "LeaseDurationType", + "modelAsString": false + } + }, + "x-ms-lease-state": { + "x-ms-client-name": "LeaseState", + "description": "Lease state of the blob.", + "type": "string", + "enum": [ + "available", + "leased", + "expired", + "breaking", + "broken" + ], + "x-ms-enum": { + "name": "LeaseStateType", + "modelAsString": false + } + }, + "x-ms-lease-status": { + "x-ms-client-name": "LeaseStatus", + "description": "The current lease status of the blob.", + "type": "string", + "enum": [ + "locked", + "unlocked" + ], + "x-ms-enum": { + "name": "LeaseStatusType", + "modelAsString": false + } + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-blob-public-access": { + "x-ms-client-name": "BlobPublicAccess", + "description": "Indicated whether data in the container may be accessed publicly and the level of access", + "type": "string", + "enum": [ + "container", + "blob" + ], + "x-ms-enum": { + "name": "PublicAccessType", + "modelAsString": true + } + }, + "x-ms-has-immutability-policy": { + "x-ms-client-name": "HasImmutabilityPolicy", + "description": "Indicates whether the container has an immutability policy set on it.", + "type": "boolean" + }, + "x-ms-has-legal-hold": { + "x-ms-client-name": "HasLegalHold", + "description": "Indicates whether the container has a legal hold.", + "type": "boolean" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "delete": { + "tags": [ + "container" + ], + "operationId": "Container_Delete", + "description": "operation marks the specified container for deletion. The container and any blobs contained within it are later deleted during garbage collection", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "Accepted", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + } + ] + }, + "/{containerName}?restype=container&comp=metadata": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_SetMetadata", + "description": "operation sets one or more user-defined name-value pairs for the specified container.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "metadata" + ] + } + ] + }, + "/{containerName}?restype=container&comp=acl": { + "get": { + "tags": [ + "container" + ], + "operationId": "Container_GetAccessPolicy", + "description": "gets the permissions for the specified container. The permissions indicate whether container data may be accessed publicly.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "x-ms-blob-public-access": { + "x-ms-client-name": "BlobPublicAccess", + "description": "Indicated whether data in the container may be accessed publicly and the level of access", + "type": "string", + "enum": [ + "container", + "blob" + ], + "x-ms-enum": { + "name": "PublicAccessType", + "modelAsString": true + } + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/SignedIdentifiers" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "put": { + "tags": [ + "container" + ], + "operationId": "Container_SetAccessPolicy", + "description": "sets the permissions for the specified container. The permissions indicate whether blobs in a container may be accessed publicly.", + "parameters": [ + { + "$ref": "#/parameters/ContainerAcl" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobPublicAccess" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "acl" + ] + } + ] + }, + "/{containerName}?comp=lease&restype=container&acquire": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_AcquireLease", + "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseDuration" + }, + { + "$ref": "#/parameters/ProposedLeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The Acquire operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a container's lease" + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "acquire" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}?comp=lease&restype=container&release": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_ReleaseLease", + "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Release operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "release" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}?comp=lease&restype=container&renew": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_RenewLease", + "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Renew operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a container's lease" + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "renew" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}?comp=lease&restype=container&break": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_BreakLease", + "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseBreakPeriod" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The Break operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-time": { + "x-ms-client-name": "LeaseTime", + "type": "integer", + "description": "Approximate time remaining in the lease period, in seconds." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "break" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}?comp=lease&restype=container&change": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_ChangeLease", + "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/ProposedLeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Change operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a container's lease" + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "change" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}?restype=container&comp=list&flat": { + "get": { + "tags": [ + "containers" + ], + "operationId": "Container_ListBlobFlatSegment", + "description": "[Update] The List Blobs operation returns a list of the blobs under the specified container", + "parameters": [ + { + "$ref": "#/parameters/Prefix" + }, + { + "$ref": "#/parameters/Marker" + }, + { + "$ref": "#/parameters/MaxResults" + }, + { + "$ref": "#/parameters/ListBlobsInclude" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "Content-Type": { + "type": "string", + "description": "The media type of the body of the response. For List Blobs this is 'application/xml'" + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/ListBlobsFlatSegmentResponse" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "NextMarker" + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "list" + ] + } + ] + }, + "/{containerName}?restype=container&comp=list&hierarchy": { + "get": { + "tags": [ + "containers" + ], + "operationId": "Container_ListBlobHierarchySegment", + "description": "[Update] The List Blobs operation returns a list of the blobs under the specified container", + "parameters": [ + { + "$ref": "#/parameters/Prefix" + }, + { + "$ref": "#/parameters/Delimiter" + }, + { + "$ref": "#/parameters/Marker" + }, + { + "$ref": "#/parameters/MaxResults" + }, + { + "$ref": "#/parameters/ListBlobsInclude" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "Content-Type": { + "type": "string", + "description": "The media type of the body of the response. For List Blobs this is 'application/xml'" + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/ListBlobsHierarchySegmentResponse" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "NextMarker" + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "list" + ] + } + ] + }, + "/{containerName}?restype=account&comp=properties": { + "get": { + "tags": [ + "container" + ], + "operationId": "Container_GetAccountInfo", + "description": "Returns the sku name and account kind ", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success (OK)", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-sku-name": { + "x-ms-client-name": "SkuName", + "type": "string", + "enum": [ + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" + ], + "x-ms-enum": { + "name": "SkuName", + "modelAsString": false + }, + "description": "Identifies the sku name of the account" + }, + "x-ms-account-kind": { + "x-ms-client-name": "AccountKind", + "type": "string", + "enum": [ + "Storage", + "BlobStorage", + "StorageV2" + ], + "x-ms-enum": { + "name": "AccountKind", + "modelAsString": false + }, + "description": "Identifies the account kind" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "account" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{containerName}/{blob}": { + "get": { + "tags": [ + "blob" + ], + "operationId": "Blob_Download", + "description": "The Download operation reads or downloads a blob from the system, including its metadata and properties. You can also call Download to read a snapshot.", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Range" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/GetRangeContentMD5" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Returns the content of the entire blob.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-meta": { + "type": "string", + "x-ms-client-name": "Metadata", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "The number of bytes present in the response body." + }, + "Content-Type": { + "type": "string", + "description": "The media type of the body of the response. For Download Blob this is 'application/octet-stream'" + }, + "Content-Range": { + "type": "string", + "description": "Indicates the range of bytes returned in the event that the client requested a subset of the blob by setting the 'Range' request header." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "Content-Encoding": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Encoding request header" + }, + "Cache-Control": { + "type": "string", + "description": "This header is returned if it was previously specified for the blob." + }, + "Content-Disposition": { + "type": "string", + "description": "This header returns the value that was specified for the 'x-ms-blob-content-disposition' header. The Content-Disposition response header field conveys additional information about how to process the response payload, and also can be used to attach additional metadata. For example, if set to attachment, it indicates that the user-agent should not display the response, but instead show a Save As dialog with a filename other than the blob name specified." + }, + "Content-Language": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Language request header." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-blob-type": { + "x-ms-client-name": "BlobType", + "description": "The blob's type.", + "type": "string", + "enum": [ + "BlockBlob", + "PageBlob", + "AppendBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + }, + "x-ms-copy-completion-time": { + "x-ms-client-name": "CopyCompletionTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Conclusion time of the last attempted Copy Blob operation where this blob was the destination blob. This value can specify the time of a completed, aborted, or failed copy attempt. This header does not appear if a copy is pending, if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status-description": { + "x-ms-client-name": "CopyStatusDescription", + "type": "string", + "description": "Only appears when x-ms-copy-status is failed or pending. Describes the cause of the last fatal or non-fatal copy operation failure. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." + }, + "x-ms-copy-progress": { + "x-ms-client-name": "CopyProgress", + "type": "string", + "description": "Contains the number of bytes copied and the total bytes in the source in the last attempted Copy Blob operation where this blob was the destination blob. Can show between 0 and Content-Length bytes copied. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-source": { + "x-ms-client-name": "CopySource", + "type": "string", + "description": "URL up to 2 KB in length that specifies the source blob or file used in the last attempted Copy Blob operation where this blob was the destination blob. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + }, + "x-ms-lease-duration": { + "x-ms-client-name": "LeaseDuration", + "description": "When a blob is leased, specifies whether the lease is of infinite or fixed duration.", + "type": "string", + "enum": [ + "infinite", + "fixed" + ], + "x-ms-enum": { + "name": "LeaseDurationType", + "modelAsString": false + } + }, + "x-ms-lease-state": { + "x-ms-client-name": "LeaseState", + "description": "Lease state of the blob.", + "type": "string", + "enum": [ + "available", + "leased", + "expired", + "breaking", + "broken" + ], + "x-ms-enum": { + "name": "LeaseStateType", + "modelAsString": false + } + }, + "x-ms-lease-status": { + "x-ms-client-name": "LeaseStatus", + "description": "The current lease status of the blob.", + "type": "string", + "enum": [ + "locked", + "unlocked" + ], + "x-ms-enum": { + "name": "LeaseStatusType", + "modelAsString": false + } + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Accept-Ranges": { + "type": "string", + "description": "Indicates that the service supports requests for partial blob content." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-blob-committed-block-count": { + "x-ms-client-name": "BlobCommittedBlockCount", + "type": "integer", + "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." + }, + "x-ms-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the blob data and application metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the blob is unencrypted, or if only parts of the blob/application metadata are encrypted)." + }, + "x-ms-blob-content-md5": { + "x-ms-client-name": "BlobContentMD5", + "type": "string", + "format": "byte", + "description": "If the blob has a MD5 hash, and if request contains range header (Range or x-ms-range), this response header is returned with the value of the whole blob's MD5 value. This value may or may not be equal to the value returned in Content-MD5 header, with the latter calculated from the requested range" + } + }, + "schema": { + "type": "object", + "format": "file" + } + }, + "206": { + "description": "Returns the content of a specified range of the blob.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-meta": { + "type": "string", + "x-ms-client-name": "Metadata", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "The number of bytes present in the response body." + }, + "Content-Type": { + "type": "string", + "description": "The media type of the body of the response. For Download Blob this is 'application/octet-stream'" + }, + "Content-Range": { + "type": "string", + "description": "Indicates the range of bytes returned in the event that the client requested a subset of the blob by setting the 'Range' request header." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "Content-Encoding": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Encoding request header" + }, + "Cache-Control": { + "type": "string", + "description": "This header is returned if it was previously specified for the blob." + }, + "Content-Disposition": { + "type": "string", + "description": "This header returns the value that was specified for the 'x-ms-blob-content-disposition' header. The Content-Disposition response header field conveys additional information about how to process the response payload, and also can be used to attach additional metadata. For example, if set to attachment, it indicates that the user-agent should not display the response, but instead show a Save As dialog with a filename other than the blob name specified." + }, + "Content-Language": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Language request header." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-blob-type": { + "x-ms-client-name": "BlobType", + "description": "The blob's type.", + "type": "string", + "enum": [ + "BlockBlob", + "PageBlob", + "AppendBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + }, + "x-ms-copy-completion-time": { + "x-ms-client-name": "CopyCompletionTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Conclusion time of the last attempted Copy Blob operation where this blob was the destination blob. This value can specify the time of a completed, aborted, or failed copy attempt. This header does not appear if a copy is pending, if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status-description": { + "x-ms-client-name": "CopyStatusDescription", + "type": "string", + "description": "Only appears when x-ms-copy-status is failed or pending. Describes the cause of the last fatal or non-fatal copy operation failure. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." + }, + "x-ms-copy-progress": { + "x-ms-client-name": "CopyProgress", + "type": "string", + "description": "Contains the number of bytes copied and the total bytes in the source in the last attempted Copy Blob operation where this blob was the destination blob. Can show between 0 and Content-Length bytes copied. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-source": { + "x-ms-client-name": "CopySource", + "type": "string", + "description": "URL up to 2 KB in length that specifies the source blob or file used in the last attempted Copy Blob operation where this blob was the destination blob. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + }, + "x-ms-lease-duration": { + "x-ms-client-name": "LeaseDuration", + "description": "When a blob is leased, specifies whether the lease is of infinite or fixed duration.", + "type": "string", + "enum": [ + "infinite", + "fixed" + ], + "x-ms-enum": { + "name": "LeaseDurationType", + "modelAsString": false + } + }, + "x-ms-lease-state": { + "x-ms-client-name": "LeaseState", + "description": "Lease state of the blob.", + "type": "string", + "enum": [ + "available", + "leased", + "expired", + "breaking", + "broken" + ], + "x-ms-enum": { + "name": "LeaseStateType", + "modelAsString": false + } + }, + "x-ms-lease-status": { + "x-ms-client-name": "LeaseStatus", + "description": "The current lease status of the blob.", + "type": "string", + "enum": [ + "locked", + "unlocked" + ], + "x-ms-enum": { + "name": "LeaseStatusType", + "modelAsString": false + } + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Accept-Ranges": { + "type": "string", + "description": "Indicates that the service supports requests for partial blob content." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-blob-committed-block-count": { + "x-ms-client-name": "BlobCommittedBlockCount", + "type": "integer", + "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." + }, + "x-ms-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the blob data and application metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the blob is unencrypted, or if only parts of the blob/application metadata are encrypted)." + }, + "x-ms-blob-content-md5": { + "x-ms-client-name": "BlobContentMD5", + "type": "string", + "format": "byte", + "description": "If the blob has a MD5 hash, and if request contains range header (Range or x-ms-range), this response header is returned with the value of the whole blob's MD5 value. This value may or may not be equal to the value returned in Content-MD5 header, with the latter calculated from the requested range" + } + }, + "schema": { + "type": "object", + "format": "file" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "head": { + "tags": [ + "blob" + ], + "operationId": "Blob_GetProperties", + "description": "The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties for the blob. It does not return the content of the blob.", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Returns the properties of the blob.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-creation-time": { + "x-ms-client-name": "CreationTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was created." + }, + "x-ms-meta": { + "type": "string", + "x-ms-client-name": "Metadata", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "x-ms-blob-type": { + "x-ms-client-name": "BlobType", + "description": "The blob's type.", + "type": "string", + "enum": [ + "BlockBlob", + "PageBlob", + "AppendBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + }, + "x-ms-copy-completion-time": { + "x-ms-client-name": "CopyCompletionTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Conclusion time of the last attempted Copy Blob operation where this blob was the destination blob. This value can specify the time of a completed, aborted, or failed copy attempt. This header does not appear if a copy is pending, if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status-description": { + "x-ms-client-name": "CopyStatusDescription", + "type": "string", + "description": "Only appears when x-ms-copy-status is failed or pending. Describes the cause of the last fatal or non-fatal copy operation failure. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." + }, + "x-ms-copy-progress": { + "x-ms-client-name": "CopyProgress", + "type": "string", + "description": "Contains the number of bytes copied and the total bytes in the source in the last attempted Copy Blob operation where this blob was the destination blob. Can show between 0 and Content-Length bytes copied. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-source": { + "x-ms-client-name": "CopySource", + "type": "string", + "description": "URL up to 2 KB in length that specifies the source blob or file used in the last attempted Copy Blob operation where this blob was the destination blob. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + }, + "x-ms-incremental-copy": { + "x-ms-client-name": "IsIncrementalCopy", + "type": "boolean", + "description": "Included if the blob is incremental copy blob." + }, + "x-ms-copy-destination-snapshot": { + "x-ms-client-name": "DestinationSnapshot", + "type": "string", + "description": "Included if the blob is incremental copy blob or incremental copy snapshot, if x-ms-copy-status is success. Snapshot time of the last successful incremental copy snapshot for this blob." + }, + "x-ms-lease-duration": { + "x-ms-client-name": "LeaseDuration", + "description": "When a blob is leased, specifies whether the lease is of infinite or fixed duration.", + "type": "string", + "enum": [ + "infinite", + "fixed" + ], + "x-ms-enum": { + "name": "LeaseDurationType", + "modelAsString": false + } + }, + "x-ms-lease-state": { + "x-ms-client-name": "LeaseState", + "description": "Lease state of the blob.", + "type": "string", + "enum": [ + "available", + "leased", + "expired", + "breaking", + "broken" + ], + "x-ms-enum": { + "name": "LeaseStateType", + "modelAsString": false + } + }, + "x-ms-lease-status": { + "x-ms-client-name": "LeaseStatus", + "description": "The current lease status of the blob.", + "type": "string", + "enum": [ + "locked", + "unlocked" + ], + "x-ms-enum": { + "name": "LeaseStatusType", + "modelAsString": false + } + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "The number of bytes present in the response body." + }, + "Content-Type": { + "type": "string", + "description": "The content type specified for the blob. The default content type is 'application/octet-stream'" + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "Content-Encoding": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Encoding request header" + }, + "Content-Disposition": { + "type": "string", + "description": "This header returns the value that was specified for the 'x-ms-blob-content-disposition' header. The Content-Disposition response header field conveys additional information about how to process the response payload, and also can be used to attach additional metadata. For example, if set to attachment, it indicates that the user-agent should not display the response, but instead show a Save As dialog with a filename other than the blob name specified." + }, + "Content-Language": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Language request header." + }, + "Cache-Control": { + "type": "string", + "description": "This header is returned if it was previously specified for the blob." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "Accept-Ranges": { + "type": "string", + "description": "Indicates that the service supports requests for partial blob content." + }, + "x-ms-blob-committed-block-count": { + "x-ms-client-name": "BlobCommittedBlockCount", + "type": "integer", + "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." + }, + "x-ms-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the blob data and application metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the blob is unencrypted, or if only parts of the blob/application metadata are encrypted)." + }, + "x-ms-access-tier": { + "x-ms-client-name": "AccessTier", + "type": "string", + "description": "The tier of page blob on a premium storage account or tier of block blob on blob storage LRS accounts. For a list of allowed premium page blob tiers, see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/premium-storage#features. For blob storage LRS accounts, valid values are Hot/Cool/Archive." + }, + "x-ms-access-tier-inferred": { + "x-ms-client-name": "AccessTierInferred", + "type": "boolean", + "description": "For page blobs on a premium storage account only. If the access tier is not explicitly set on the blob, the tier is inferred based on its content length and this header will be returned with true value." + }, + "x-ms-archive-status": { + "x-ms-client-name": "ArchiveStatus", + "type": "string", + "description": "For blob storage LRS accounts, valid values are rehydrate-pending-to-hot/rehydrate-pending-to-cool. If the blob is being rehydrated and is not complete then this header is returned indicating that rehydrate is pending and also tells the destination tier." + }, + "x-ms-access-tier-change-time": { + "x-ms-client-name": "AccessTierChangeTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "The time the tier was changed on the object. This is only returned if the tier on the block blob was ever set." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "delete": { + "tags": [ + "blob" + ], + "operationId": "Blob_Delete", + "description": "If the storage account's soft delete feature is disabled then, when a blob is deleted, it is permanently removed from the storage account. If the storage account's soft delete feature is enabled, then, when a blob is deleted, it is marked for deletion and becomes inaccessible immediately. However, the blob service retains the blob or snapshot for the number of days specified by the DeleteRetentionPolicy section of [Storage service properties] (Set-Blob-Service-Properties.md). After the specified number of days has passed, the blob's data is permanently removed from the storage account. Note that you continue to be charged for the soft-deleted blob's storage until it is permanently removed. Use the List Blobs API and specify the \"include=deleted\" query parameter to discover which blobs and snapshots have been soft deleted. You can then use the Undelete Blob API to restore a soft-deleted blob. All other operations on a soft-deleted blob or snapshot causes the service to return an HTTP status code of 404 (ResourceNotFound).", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/DeleteSnapshots" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The delete request was accepted and the blob will be deleted.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + } + }, + "/{containerName}/{blob}?PageBlob": { + "put": { + "tags": [ + "blob" + ], + "operationId": "PageBlob_Create", + "description": "The Create operation creates a new page blob.", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/BlobContentType" + }, + { + "$ref": "#/parameters/BlobContentEncoding" + }, + { + "$ref": "#/parameters/BlobContentLanguage" + }, + { + "$ref": "#/parameters/BlobContentMD5" + }, + { + "$ref": "#/parameters/BlobCacheControl" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobContentDisposition" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/BlobContentLengthRequired" + }, + { + "$ref": "#/parameters/BlobSequenceNumber" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The blob was created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "x-ms-blob-type", + "x-ms-client-name": "blobType", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Specifies the type of blob to create: block blob, page blob, or append blob.", + "type": "string", + "enum": [ + "PageBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?AppendBlob": { + "put": { + "tags": [ + "blob" + ], + "operationId": "AppendBlob_Create", + "description": "The Create Append Blob operation creates a new append blob.", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/BlobContentType" + }, + { + "$ref": "#/parameters/BlobContentEncoding" + }, + { + "$ref": "#/parameters/BlobContentLanguage" + }, + { + "$ref": "#/parameters/BlobContentMD5" + }, + { + "$ref": "#/parameters/BlobCacheControl" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobContentDisposition" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The blob was created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "x-ms-blob-type", + "x-ms-client-name": "blobType", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Specifies the type of blob to create: block blob, page blob, or append blob.", + "type": "string", + "enum": [ + "AppendBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?BlockBlob": { + "put": { + "tags": [ + "blob" + ], + "operationId": "BlockBlob_Upload", + "description": "The Upload Block Blob operation updates the content of an existing block blob. Updating an existing block blob overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; the content of the existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a block blob, use the Put Block List operation.", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Body" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/BlobContentType" + }, + { + "$ref": "#/parameters/BlobContentEncoding" + }, + { + "$ref": "#/parameters/BlobContentLanguage" + }, + { + "$ref": "#/parameters/BlobContentMD5" + }, + { + "$ref": "#/parameters/BlobCacheControl" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobContentDisposition" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The blob was updated.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "x-ms-blob-type", + "x-ms-client-name": "blobType", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Specifies the type of blob to create: block blob, page blob, or append blob.", + "type": "string", + "enum": [ + "BlockBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?comp=undelete": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_Undelete", + "description": "Undelete a blob that was previously soft deleted", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The blob was undeleted successfully.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "undelete" + ] + } + ] + }, + "/{containerName}/{blob}?comp=properties&SetHTTPHeaders": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_SetHTTPHeaders", + "description": "The Set HTTP Headers operation sets system properties on the blob", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/BlobCacheControl" + }, + { + "$ref": "#/parameters/BlobContentType" + }, + { + "$ref": "#/parameters/BlobContentMD5" + }, + { + "$ref": "#/parameters/BlobContentEncoding" + }, + { + "$ref": "#/parameters/BlobContentLanguage" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/BlobContentDisposition" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The properties were set successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{containerName}/{blob}?comp=metadata": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_SetMetadata", + "description": "The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more name-value pairs", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The metadata was set successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "metadata" + ] + } + ] + }, + "/{containerName}/{blob}?comp=lease&acquire": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_AcquireLease", + "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseDuration" + }, + { + "$ref": "#/parameters/ProposedLeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The Acquire operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a blobs's lease" + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "acquire" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}/{blob}?comp=lease&release": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_ReleaseLease", + "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Release operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "release" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}/{blob}?comp=lease&renew": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_RenewLease", + "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Renew operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a blobs's lease" + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "renew" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}/{blob}?comp=lease&change": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_ChangeLease", + "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/ProposedLeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Change operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a blobs's lease" + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "change" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}/{blob}?comp=lease&break": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_BreakLease", + "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseBreakPeriod" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The Break operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-time": { + "x-ms-client-name": "LeaseTime", + "type": "integer", + "description": "Approximate time remaining in the lease period, in seconds." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "break" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}/{blob}?comp=snapshot": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_CreateSnapshot", + "description": "The Create Snapshot operation creates a read-only snapshot of a blob", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The snaptshot was taken successfully.", + "headers": { + "x-ms-snapshot": { + "x-ms-client-name": "Snapshot", + "type": "string", + "description": "Uniquely identifies the snapshot and indicates the snapshot version. It may be used in subsequent requests to access the snapshot" + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "snapshot" + ] + } + ] + }, + "/{containerName}/{blob}?comp=copy": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_StartCopyFromURL", + "description": "The Start Copy From URL operation copies a blob or an internet resource to a new blob.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/CopySource" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The copy blob has been accepted with the specified copy status.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [] + }, + "/{containerName}/{blob}?comp=copy&sync": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_CopyFromURL", + "description": "The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response until the copy is complete.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/CopySource" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The copy has completed.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "success" + ], + "x-ms-enum": { + "name": "SyncCopyStatusType", + "modelAsString": false + } + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "x-ms-requires-sync", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "true" + ] + } + ] + }, + "/{containerName}/{blob}?comp=copy©id={CopyId}": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_AbortCopyFromURL", + "description": "The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination blob with zero length and full metadata.", + "parameters": [ + { + "$ref": "#/parameters/CopyId" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "204": { + "description": "The delete request was accepted and the blob will be deleted.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "copy" + ] + }, + { + "name": "x-ms-copy-action", + "x-ms-client-name": "copyActionAbortConstant", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "abort" + ], + "x-ms-parameter-location": "method" + } + ] + }, + "/{containerName}/{blob}?comp=tier": { + "put": { + "tags": [ + "blobs" + ], + "operationId": "Blob_SetTier", + "description": "The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium storage account and on a block blob in a blob storage account (locally redundant storage only). A premium page blob's tier determines the allowed size, IOPS, and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive storage type. This operation does not update the blob's ETag.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/AccessTier" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + } + ], + "responses": { + "200": { + "description": "The new tier will take effect immediately.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and newer." + } + } + }, + "202": { + "description": "The transition to the new tier is pending.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and newer." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "tier" + ] + } + ] + }, + "/{containerName}/{blob}?restype=account&comp=properties": { + "get": { + "tags": [ + "blob" + ], + "operationId": "Blob_GetAccountInfo", + "description": "Returns the sku name and account kind ", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success (OK)", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-sku-name": { + "x-ms-client-name": "SkuName", + "type": "string", + "enum": [ + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" + ], + "x-ms-enum": { + "name": "SkuName", + "modelAsString": false + }, + "description": "Identifies the sku name of the account" + }, + "x-ms-account-kind": { + "x-ms-client-name": "AccountKind", + "type": "string", + "enum": [ + "Storage", + "BlobStorage", + "StorageV2" + ], + "x-ms-enum": { + "name": "AccountKind", + "modelAsString": false + }, + "description": "Identifies the account kind" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "account" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{containerName}/{blob}?comp=block": { + "put": { + "tags": [ + "blockblob" + ], + "operationId": "BlockBlob_StageBlock", + "description": "The Stage Block operation creates a new block to be committed as part of a blob", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/BlockId" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/ContentMD5" + }, + { + "$ref": "#/parameters/Body" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The block was created.", + "headers": { + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "block" + ] + } + ] + }, + "/{containerName}/{blob}?comp=block&fromURL": { + "put": { + "tags": [ + "blockblob" + ], + "operationId": "BlockBlob_StageBlockFromURL", + "description": "The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from a URL.", + "parameters": [ + { + "$ref": "#/parameters/BlockId" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/SourceUrl" + }, + { + "$ref": "#/parameters/SourceRange" + }, + { + "$ref": "#/parameters/SourceContentMD5" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The block was created.", + "headers": { + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "block" + ] + } + ] + }, + "/{containerName}/{blob}?comp=blocklist": { + "put": { + "tags": [ + "blockblob" + ], + "operationId": "BlockBlob_CommitBlockList", + "description": "The Commit Block List operation writes a blob by specifying the list of block IDs that make up the blob. In order to be written as part of a blob, a block must have been successfully written to the server in a prior Put Block operation. You can call Put Block List to update a blob by uploading only those blocks that have changed, then committing the new and existing blocks together. You can do this by specifying whether to commit a block from the committed block list or from the uncommitted block list, or to commit the most recently uploaded version of the block, whichever list it may belong to.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/BlobCacheControl" + }, + { + "$ref": "#/parameters/BlobContentType" + }, + { + "$ref": "#/parameters/BlobContentEncoding" + }, + { + "$ref": "#/parameters/BlobContentLanguage" + }, + { + "$ref": "#/parameters/BlobContentMD5" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobContentDisposition" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "name": "blocks", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BlockLookupList" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The block list was recorded.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "get": { + "tags": [ + "blockblob" + ], + "operationId": "BlockBlob_GetBlockList", + "description": "The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block blob", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/BlockListType" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The page range was written.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Content-Type": { + "type": "string", + "description": "The media type of the body of the response. For Get Block List this is 'application/xml'" + }, + "x-ms-blob-content-length": { + "x-ms-client-name": "BlobContentLength", + "type": "integer", + "format": "int64", + "description": "The size of the blob in bytes." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/BlockList" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "blocklist" + ] + } + ] + }, + "/{containerName}/{blob}?comp=page&update": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_UploadPages", + "description": "The Upload Pages operation writes a range of pages to a page blob", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Body" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/ContentMD5" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Range" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThanOrEqualTo" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThan" + }, + { + "$ref": "#/parameters/IfSequenceNumberEqualTo" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The page range was written.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for the page blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "page" + ] + }, + { + "name": "x-ms-page-write", + "x-ms-client-name": "pageWrite", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Required. You may specify one of the following options:\n - Update: Writes the bytes specified by the request body into the specified range. The Range and Content-Length headers must match to perform the update.\n - Clear: Clears the specified range and releases the space used in storage for that range. To clear a range, set the Content-Length header to zero, and the Range header to a value that indicates the range to clear, up to maximum blob size.", + "type": "string", + "enum": [ + "update" + ], + "x-ms-enum": { + "name": "PageWriteType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?comp=page&clear": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_ClearPages", + "description": "The Clear Pages operation clears a set of pages from a page blob", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Range" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThanOrEqualTo" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThan" + }, + { + "$ref": "#/parameters/IfSequenceNumberEqualTo" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The page range was cleared.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for the page blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "page" + ] + }, + { + "name": "x-ms-page-write", + "x-ms-client-name": "pageWrite", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Required. You may specify one of the following options:\n - Update: Writes the bytes specified by the request body into the specified range. The Range and Content-Length headers must match to perform the update.\n - Clear: Clears the specified range and releases the space used in storage for that range. To clear a range, set the Content-Length header to zero, and the Range header to a value that indicates the range to clear, up to maximum blob size.", + "type": "string", + "enum": [ + "clear" + ], + "x-ms-enum": { + "name": "PageWriteType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?comp=page&update&fromUrl": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_UploadPagesFromURL", + "description": "The Upload Pages operation writes a range of pages to a page blob where the contents are read from a URL", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/SourceUrl" + }, + { + "$ref": "#/parameters/SourceRangeRequiredPutPageFromUrl" + }, + { + "$ref": "#/parameters/SourceContentMD5" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/RangeRequiredPutPageFromUrl" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThanOrEqualTo" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThan" + }, + { + "$ref": "#/parameters/IfSequenceNumberEqualTo" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The page range was written.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for the page blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "page" + ] + }, + { + "name": "x-ms-page-write", + "x-ms-client-name": "pageWrite", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Required. You may specify one of the following options:\n - Update: Writes the bytes specified by the request body into the specified range. The Range and Content-Length headers must match to perform the update.\n - Clear: Clears the specified range and releases the space used in storage for that range. To clear a range, set the Content-Length header to zero, and the Range header to a value that indicates the range to clear, up to maximum blob size.", + "type": "string", + "enum": [ + "update" + ], + "x-ms-enum": { + "name": "PageWriteType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?comp=pagelist": { + "get": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_GetPageRanges", + "description": "The Get Page Ranges operation returns the list of valid page ranges for a page blob or snapshot of a page blob", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Range" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Information on the page blob was found.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "x-ms-blob-content-length": { + "x-ms-client-name": "BlobContentLength", + "type": "integer", + "format": "int64", + "description": "The size of the blob in bytes." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/PageList" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "pagelist" + ] + } + ] + }, + "/{containerName}/{blob}?comp=pagelist&diff": { + "get": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_GetPageRangesDiff", + "description": "The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were changed between target blob and previous snapshot.", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/PrevSnapshot" + }, + { + "$ref": "#/parameters/Range" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Information on the page blob was found.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "x-ms-blob-content-length": { + "x-ms-client-name": "BlobContentLength", + "type": "integer", + "format": "int64", + "description": "The size of the blob in bytes." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/PageList" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "pagelist" + ] + } + ] + }, + "/{containerName}/{blob}?comp=properties&Resize": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_Resize", + "description": "Resize the Blob", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/BlobContentLengthRequired" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Blob was resized successfully", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{containerName}/{blob}?comp=properties&UpdateSequenceNumber": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_UpdateSequenceNumber", + "description": "Update the sequence number of the blob", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/SequenceNumberAction" + }, + { + "$ref": "#/parameters/BlobSequenceNumber" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The sequence numbers were updated successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{containerName}/{blob}?comp=incrementalcopy": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_CopyIncremental", + "description": "The Copy Incremental operation copies a snapshot of the source page blob to a destination page blob. The snapshot is copied such that only the differential changes between the previously copied snapshot are transferred to the destination. The copied snapshots are complete copies of the original snapshot and can be read or copied from as usual. This API is supported since REST version 2016-05-31.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/CopySource" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The blob was copied.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "incrementalcopy" + ] + } + ] + }, + "/{containerName}/{blob}?comp=appendblock": { + "put": { + "tags": [ + "appendblob" + ], + "consumes": [ + "application/octet-stream" + ], + "operationId": "AppendBlob_AppendBlock", + "description": "The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later.", + "parameters": [ + { + "$ref": "#/parameters/Body" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/ContentMD5" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobConditionMaxSize" + }, + { + "$ref": "#/parameters/BlobConditionAppendPos" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The block was created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-blob-append-offset": { + "x-ms-client-name": "BlobAppendOffset", + "type": "string", + "description": "This response header is returned only for append operations. It returns the offset at which the block was committed, in bytes." + }, + "x-ms-blob-committed-block-count": { + "x-ms-client-name": "BlobCommittedBlockCount", + "type": "integer", + "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "appendblock" + ] + } + ] + }, + "/{containerName}/{blob}?comp=appendblock&fromUrl": { + "put": { + "tags": [ + "appendblob" + ], + "operationId": "AppendBlob_AppendBlockFromUrl", + "description": "The Append Block operation commits a new block of data to the end of an existing append blob where the contents are read from a source url. The Append Block operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later.", + "parameters": [ + { + "$ref": "#/parameters/SourceUrl" + }, + { + "$ref": "#/parameters/SourceRange" + }, + { + "$ref": "#/parameters/SourceContentMD5" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobConditionMaxSize" + }, + { + "$ref": "#/parameters/BlobConditionAppendPos" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The block was created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-blob-append-offset": { + "x-ms-client-name": "BlobAppendOffset", + "type": "string", + "description": "This response header is returned only for append operations. It returns the offset at which the block was committed, in bytes." + }, + "x-ms-blob-committed-block-count": { + "x-ms-client-name": "BlobCommittedBlockCount", + "type": "integer", + "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "appendblock" + ] + } + ] + } + }, + "definitions": { + "KeyInfo": { + "type": "object", + "required": [ + "Start", + "Expiry" + ], + "description": "Key information", + "properties": { + "Start": { + "description": "The date-time the key is active in ISO 8601 UTC time", + "type": "string" + }, + "Expiry": { + "description": "The date-time the key expires in ISO 8601 UTC time", + "type": "string" + } + } + }, + "UserDelegationKey": { + "type": "object", + "required": [ + "SignedOid", + "SignedTid", + "SignedStart", + "SignedExpiry", + "SignedService", + "SignedVersion", + "Value" + ], + "description": "A user delegation key", + "properties": { + "SignedOid": { + "description": "The Azure Active Directory object ID in GUID format.", + "type": "string" + }, + "SignedTid": { + "description": "The Azure Active Directory tenant ID in GUID format", + "type": "string" + }, + "SignedStart": { + "description": "The date-time the key is active", + "type": "string", + "format": "date-time" + }, + "SignedExpiry": { + "description": "The date-time the key expires", + "type": "string", + "format": "date-time" + }, + "SignedService": { + "description": "Abbreviation of the Azure Storage service that accepts the key", + "type": "string" + }, + "SignedVersion": { + "description": "The service version that created the key", + "type": "string" + }, + "Value": { + "description": "The key as a base64 string", + "type": "string" + } + } + }, + "PublicAccessType": { + "type": "string", + "enum": [ + "container", + "blob" + ], + "x-ms-enum": { + "name": "PublicAccessType", + "modelAsString": true + } + }, + "CopyStatus": { + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + }, + "LeaseDuration": { + "type": "string", + "enum": [ + "infinite", + "fixed" + ], + "x-ms-enum": { + "name": "LeaseDurationType", + "modelAsString": false + } + }, + "LeaseState": { + "type": "string", + "enum": [ + "available", + "leased", + "expired", + "breaking", + "broken" + ], + "x-ms-enum": { + "name": "LeaseStateType", + "modelAsString": false + } + }, + "LeaseStatus": { + "type": "string", + "enum": [ + "locked", + "unlocked" + ], + "x-ms-enum": { + "name": "LeaseStatusType", + "modelAsString": false + } + }, + "StorageError": { + "type": "object", + "properties": { + "Code": { + "type": "string" + }, + "Message": { + "type": "string" + } + } + }, + "AccessPolicy": { + "type": "object", + "required": [ + "Start", + "Expiry", + "Permission" + ], + "description": "An Access policy", + "properties": { + "Start": { + "description": "the date-time the policy is active", + "type": "string", + "format": "date-time" + }, + "Expiry": { + "description": "the date-time the policy expires", + "type": "string", + "format": "date-time" + }, + "Permission": { + "description": "the permissions for the acl policy", + "type": "string" + } + } + }, + "AccessTier": { + "type": "string", + "enum": [ + "P4", + "P6", + "P10", + "P20", + "P30", + "P40", + "P50", + "Hot", + "Cool", + "Archive" + ], + "x-ms-enum": { + "name": "AccessTier", + "modelAsString": true + } + }, + "ArchiveStatus": { + "type": "string", + "enum": [ + "rehydrate-pending-to-hot", + "rehydrate-pending-to-cool" + ], + "x-ms-enum": { + "name": "ArchiveStatus", + "modelAsString": true + } + }, + "BlobItem": { + "xml": { + "name": "Blob" + }, + "description": "An Azure Storage blob", + "type": "object", + "required": [ + "Name", + "Deleted", + "Snapshot", + "Properties" + ], + "properties": { + "Name": { + "type": "string" + }, + "Deleted": { + "type": "boolean" + }, + "Snapshot": { + "type": "string" + }, + "Properties": { + "$ref": "#/definitions/BlobProperties" + }, + "Metadata": { + "$ref": "#/definitions/Metadata" + } + } + }, + "BlobProperties": { + "xml": { + "name": "Properties" + }, + "description": "Properties of a blob", + "type": "object", + "required": [ + "Etag", + "Last-Modified" + ], + "properties": { + "Creation-Time": { + "type": "string", + "format": "date-time-rfc1123" + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123" + }, + "Etag": { + "type": "string", + "format": "etag" + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "Size in bytes" + }, + "Content-Type": { + "type": "string" + }, + "Content-Encoding": { + "type": "string" + }, + "Content-Language": { + "type": "string" + }, + "Content-MD5": { + "type": "string", + "format": "byte" + }, + "Content-Disposition": { + "type": "string" + }, + "Cache-Control": { + "type": "string" + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "blobSequenceNumber", + "type": "integer", + "format": "int64" + }, + "BlobType": { + "type": "string", + "enum": [ + "BlockBlob", + "PageBlob", + "AppendBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + }, + "LeaseStatus": { + "$ref": "#/definitions/LeaseStatus" + }, + "LeaseState": { + "$ref": "#/definitions/LeaseState" + }, + "LeaseDuration": { + "$ref": "#/definitions/LeaseDuration" + }, + "CopyId": { + "type": "string" + }, + "CopyStatus": { + "$ref": "#/definitions/CopyStatus" + }, + "CopySource": { + "type": "string" + }, + "CopyProgress": { + "type": "string" + }, + "CopyCompletionTime": { + "type": "string", + "format": "date-time-rfc1123" + }, + "CopyStatusDescription": { + "type": "string" + }, + "ServerEncrypted": { + "type": "boolean" + }, + "IncrementalCopy": { + "type": "boolean" + }, + "DestinationSnapshot": { + "type": "string" + }, + "DeletedTime": { + "type": "string", + "format": "date-time-rfc1123" + }, + "RemainingRetentionDays": { + "type": "integer" + }, + "AccessTier": { + "$ref": "#/definitions/AccessTier" + }, + "AccessTierInferred": { + "type": "boolean" + }, + "ArchiveStatus": { + "$ref": "#/definitions/ArchiveStatus" + }, + "AccessTierChangeTime": { + "type": "string", + "format": "date-time-rfc1123" + } + } + }, + "ListBlobsFlatSegmentResponse": { + "xml": { + "name": "EnumerationResults" + }, + "description": "An enumeration of blobs", + "type": "object", + "required": [ + "ServiceEndpoint", + "ContainerName", + "Segment" + ], + "properties": { + "ServiceEndpoint": { + "type": "string", + "xml": { + "attribute": true + } + }, + "ContainerName": { + "type": "string", + "xml": { + "attribute": true + } + }, + "Prefix": { + "type": "string" + }, + "Marker": { + "type": "string" + }, + "MaxResults": { + "type": "integer" + }, + "Delimiter": { + "type": "string" + }, + "Segment": { + "$ref": "#/definitions/BlobFlatListSegment" + }, + "NextMarker": { + "type": "string" + } + } + }, + "ListBlobsHierarchySegmentResponse": { + "xml": { + "name": "EnumerationResults" + }, + "description": "An enumeration of blobs", + "type": "object", + "required": [ + "ServiceEndpoint", + "ContainerName", + "Segment" + ], + "properties": { + "ServiceEndpoint": { + "type": "string", + "xml": { + "attribute": true + } + }, + "ContainerName": { + "type": "string", + "xml": { + "attribute": true + } + }, + "Prefix": { + "type": "string" + }, + "Marker": { + "type": "string" + }, + "MaxResults": { + "type": "integer" + }, + "Delimiter": { + "type": "string" + }, + "Segment": { + "$ref": "#/definitions/BlobHierarchyListSegment" + }, + "NextMarker": { + "type": "string" + } + } + }, + "BlobFlatListSegment": { + "xml": { + "name": "Blobs" + }, + "required": [ + "BlobItems" + ], + "type": "object", + "properties": { + "BlobItems": { + "type": "array", + "items": { + "$ref": "#/definitions/BlobItem" + } + } + } + }, + "BlobHierarchyListSegment": { + "xml": { + "name": "Blobs" + }, + "type": "object", + "required": [ + "BlobItems" + ], + "properties": { + "BlobPrefixes": { + "type": "array", + "items": { + "$ref": "#/definitions/BlobPrefix" + } + }, + "BlobItems": { + "type": "array", + "items": { + "$ref": "#/definitions/BlobItem" + } + } + } + }, + "BlobPrefix": { + "type": "object", + "required": [ + "Name" + ], + "properties": { + "Name": { + "type": "string" + } + } + }, + "Block": { + "type": "object", + "required": [ + "Name", + "Size" + ], + "description": "Represents a single block in a block blob. It describes the block's ID and size.", + "properties": { + "Name": { + "description": "The base64 encoded block ID.", + "type": "string" + }, + "Size": { + "description": "The block size in bytes.", + "type": "integer" + } + } + }, + "BlockList": { + "type": "object", + "properties": { + "CommittedBlocks": { + "xml": { + "wrapped": true + }, + "type": "array", + "items": { + "$ref": "#/definitions/Block" + } + }, + "UncommittedBlocks": { + "xml": { + "wrapped": true + }, + "type": "array", + "items": { + "$ref": "#/definitions/Block" + } + } + } + }, + "BlockLookupList": { + "type": "object", + "properties": { + "Committed": { + "type": "array", + "items": { + "type": "string", + "xml": { + "name": "Committed" + } + } + }, + "Uncommitted": { + "type": "array", + "items": { + "type": "string", + "xml": { + "name": "Uncommitted" + } + } + }, + "Latest": { + "type": "array", + "items": { + "type": "string", + "xml": { + "name": "Latest" + } + } + } + }, + "xml": { + "name": "BlockList" + } + }, + "ContainerItem": { + "xml": { + "name": "Container" + }, + "type": "object", + "required": [ + "Name", + "Properties" + ], + "description": "An Azure Storage container", + "properties": { + "Name": { + "type": "string" + }, + "Properties": { + "$ref": "#/definitions/ContainerProperties" + }, + "Metadata": { + "$ref": "#/definitions/Metadata" + } + } + }, + "ContainerProperties": { + "type": "object", + "required": [ + "Last-Modified", + "Etag" + ], + "description": "Properties of a container", + "properties": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123" + }, + "Etag": { + "type": "string", + "format": "etag" + }, + "LeaseStatus": { + "$ref": "#/definitions/LeaseStatus" + }, + "LeaseState": { + "$ref": "#/definitions/LeaseState" + }, + "LeaseDuration": { + "$ref": "#/definitions/LeaseDuration" + }, + "PublicAccess": { + "$ref": "#/definitions/PublicAccessType" + }, + "HasImmutabilityPolicy": { + "type": "boolean" + }, + "HasLegalHold": { + "type": "boolean" + } + } + }, + "ListContainersSegmentResponse": { + "xml": { + "name": "EnumerationResults" + }, + "description": "An enumeration of containers", + "type": "object", + "required": [ + "ServiceEndpoint", + "ContainerItems" + ], + "properties": { + "ServiceEndpoint": { + "type": "string", + "xml": { + "attribute": true + } + }, + "Prefix": { + "type": "string" + }, + "Marker": { + "type": "string" + }, + "MaxResults": { + "type": "integer" + }, + "ContainerItems": { + "xml": { + "wrapped": true, + "name": "Containers" + }, + "type": "array", + "items": { + "$ref": "#/definitions/ContainerItem" + } + }, + "NextMarker": { + "type": "string" + } + } + }, + "CorsRule": { + "description": "CORS is an HTTP feature that enables a web application running under one domain to access resources in another domain. Web browsers implement a security restriction known as same-origin policy that prevents a web page from calling APIs in a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs in another domain", + "type": "object", + "required": [ + "AllowedOrigins", + "AllowedMethods", + "AllowedHeaders", + "ExposedHeaders", + "MaxAgeInSeconds" + ], + "properties": { + "AllowedOrigins": { + "description": "The origin domains that are permitted to make a request against the storage service via CORS. The origin domain is the domain from which the request originates. Note that the origin must be an exact case-sensitive match with the origin that the user age sends to the service. You can also use the wildcard character '*' to allow all origin domains to make requests via CORS.", + "type": "string" + }, + "AllowedMethods": { + "description": "The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated)", + "type": "string" + }, + "AllowedHeaders": { + "description": "the request headers that the origin domain may specify on the CORS request.", + "type": "string" + }, + "ExposedHeaders": { + "description": "The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer", + "type": "string" + }, + "MaxAgeInSeconds": { + "description": "The maximum amount time that a browser should cache the preflight OPTIONS request.", + "type": "integer", + "minimum": 0 + } + } + }, + "ErrorCode": { + "description": "Error codes returned by the service", + "type": "string", + "enum": [ + "AccountAlreadyExists", + "AccountBeingCreated", + "AccountIsDisabled", + "AuthenticationFailed", + "AuthorizationFailure", + "ConditionHeadersNotSupported", + "ConditionNotMet", + "EmptyMetadataKey", + "InsufficientAccountPermissions", + "InternalError", + "InvalidAuthenticationInfo", + "InvalidHeaderValue", + "InvalidHttpVerb", + "InvalidInput", + "InvalidMd5", + "InvalidMetadata", + "InvalidQueryParameterValue", + "InvalidRange", + "InvalidResourceName", + "InvalidUri", + "InvalidXmlDocument", + "InvalidXmlNodeValue", + "Md5Mismatch", + "MetadataTooLarge", + "MissingContentLengthHeader", + "MissingRequiredQueryParameter", + "MissingRequiredHeader", + "MissingRequiredXmlNode", + "MultipleConditionHeadersNotSupported", + "OperationTimedOut", + "OutOfRangeInput", + "OutOfRangeQueryParameterValue", + "RequestBodyTooLarge", + "ResourceTypeMismatch", + "RequestUrlFailedToParse", + "ResourceAlreadyExists", + "ResourceNotFound", + "ServerBusy", + "UnsupportedHeader", + "UnsupportedXmlNode", + "UnsupportedQueryParameter", + "UnsupportedHttpVerb", + "AppendPositionConditionNotMet", + "BlobAlreadyExists", + "BlobNotFound", + "BlobOverwritten", + "BlobTierInadequateForContentLength", + "BlockCountExceedsLimit", + "BlockListTooLong", + "CannotChangeToLowerTier", + "CannotVerifyCopySource", + "ContainerAlreadyExists", + "ContainerBeingDeleted", + "ContainerDisabled", + "ContainerNotFound", + "ContentLengthLargerThanTierLimit", + "CopyAcrossAccountsNotSupported", + "CopyIdMismatch", + "FeatureVersionMismatch", + "IncrementalCopyBlobMismatch", + "IncrementalCopyOfEralierVersionSnapshotNotAllowed", + "IncrementalCopySourceMustBeSnapshot", + "InfiniteLeaseDurationRequired", + "InvalidBlobOrBlock", + "InvalidBlobTier", + "InvalidBlobType", + "InvalidBlockId", + "InvalidBlockList", + "InvalidOperation", + "InvalidPageRange", + "InvalidSourceBlobType", + "InvalidSourceBlobUrl", + "InvalidVersionForPageBlobOperation", + "LeaseAlreadyPresent", + "LeaseAlreadyBroken", + "LeaseIdMismatchWithBlobOperation", + "LeaseIdMismatchWithContainerOperation", + "LeaseIdMismatchWithLeaseOperation", + "LeaseIdMissing", + "LeaseIsBreakingAndCannotBeAcquired", + "LeaseIsBreakingAndCannotBeChanged", + "LeaseIsBrokenAndCannotBeRenewed", + "LeaseLost", + "LeaseNotPresentWithBlobOperation", + "LeaseNotPresentWithContainerOperation", + "LeaseNotPresentWithLeaseOperation", + "MaxBlobSizeConditionNotMet", + "NoPendingCopyOperation", + "OperationNotAllowedOnIncrementalCopyBlob", + "PendingCopyOperation", + "PreviousSnapshotCannotBeNewer", + "PreviousSnapshotNotFound", + "PreviousSnapshotOperationNotSupported", + "SequenceNumberConditionNotMet", + "SequenceNumberIncrementTooLarge", + "SnapshotCountExceeded", + "SnaphotOperationRateExceeded", + "SnapshotsPresent", + "SourceConditionNotMet", + "SystemInUse", + "TargetConditionNotMet", + "UnauthorizedBlobOverwrite", + "BlobBeingRehydrated", + "BlobArchived", + "BlobNotArchived" + ], + "x-ms-enum": { + "name": "StorageErrorCode", + "modelAsString": true + } + }, + "GeoReplication": { + "description": "Geo-Replication information for the Secondary Storage Service", + "type": "object", + "required": [ + "Status", + "LastSyncTime" + ], + "properties": { + "Status": { + "description": "The status of the secondary location", + "type": "string", + "enum": [ + "live", + "bootstrap", + "unavailable" + ], + "x-ms-enum": { + "name": "GeoReplicationStatusType", + "modelAsString": true + } + }, + "LastSyncTime": { + "description": "A GMT date/time value, to the second. All primary writes preceding this value are guaranteed to be available for read operations at the secondary. Primary writes after this point in time may or may not be available for reads.", + "type": "string", + "format": "date-time-rfc1123" + } + } + }, + "Logging": { + "description": "Azure Analytics Logging settings.", + "type": "object", + "required": [ + "Version", + "Delete", + "Read", + "Write", + "RetentionPolicy" + ], + "properties": { + "Version": { + "description": "The version of Storage Analytics to configure.", + "type": "string" + }, + "Delete": { + "description": "Indicates whether all delete requests should be logged.", + "type": "boolean" + }, + "Read": { + "description": "Indicates whether all read requests should be logged.", + "type": "boolean" + }, + "Write": { + "description": "Indicates whether all write requests should be logged.", + "type": "boolean" + }, + "RetentionPolicy": { + "$ref": "#/definitions/RetentionPolicy" + } + } + }, + "Metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Metrics": { + "description": "a summary of request statistics grouped by API in hour or minute aggregates for blobs", + "required": [ + "Enabled" + ], + "properties": { + "Version": { + "description": "The version of Storage Analytics to configure.", + "type": "string" + }, + "Enabled": { + "description": "Indicates whether metrics are enabled for the Blob service.", + "type": "boolean" + }, + "IncludeAPIs": { + "description": "Indicates whether metrics should generate summary statistics for called API operations.", + "type": "boolean" + }, + "RetentionPolicy": { + "$ref": "#/definitions/RetentionPolicy" + } + } + }, + "PageList": { + "description": "the list of pages", + "type": "object", + "properties": { + "PageRange": { + "type": "array", + "items": { + "$ref": "#/definitions/PageRange" + } + }, + "ClearRange": { + "type": "array", + "items": { + "$ref": "#/definitions/ClearRange" + } + } + } + }, + "PageRange": { + "type": "object", + "required": [ + "Start", + "End" + ], + "properties": { + "Start": { + "type": "integer", + "format": "int64", + "xml": { + "name": "Start" + } + }, + "End": { + "type": "integer", + "format": "int64", + "xml": { + "name": "End" + } + } + }, + "xml": { + "name": "PageRange" + } + }, + "ClearRange": { + "type": "object", + "required": [ + "Start", + "End" + ], + "properties": { + "Start": { + "type": "integer", + "format": "int64", + "xml": { + "name": "Start" + } + }, + "End": { + "type": "integer", + "format": "int64", + "xml": { + "name": "End" + } + } + }, + "xml": { + "name": "ClearRange" + } + }, + "RetentionPolicy": { + "description": "the retention policy which determines how long the associated data should persist", + "type": "object", + "required": [ + "Enabled" + ], + "properties": { + "Enabled": { + "description": "Indicates whether a retention policy is enabled for the storage service", + "type": "boolean" + }, + "Days": { + "description": "Indicates the number of days that metrics or logging or soft-deleted data should be retained. All data older than this value will be deleted", + "type": "integer", + "minimum": 1 + } + } + }, + "SignedIdentifier": { + "xml": { + "name": "SignedIdentifier" + }, + "description": "signed identifier", + "type": "object", + "required": [ + "Id", + "AccessPolicy" + ], + "properties": { + "Id": { + "type": "string", + "description": "a unique id" + }, + "AccessPolicy": { + "$ref": "#/definitions/AccessPolicy" + } + } + }, + "SignedIdentifiers": { + "description": "a collection of signed identifiers", + "type": "array", + "items": { + "$ref": "#/definitions/SignedIdentifier" + }, + "xml": { + "wrapped": true, + "name": "SignedIdentifiers" + } + }, + "StaticWebsite": { + "description": "The properties that enable an account to host a static website", + "type": "object", + "required": [ + "Enabled" + ], + "properties": { + "Enabled": { + "description": "Indicates whether this account is hosting a static website", + "type": "boolean" + }, + "IndexDocument": { + "description": "The default name of the index page under each directory", + "type": "string" + }, + "ErrorDocument404Path": { + "description": "The absolute path of the custom 404 page", + "type": "string" + } + } + }, + "StorageServiceProperties": { + "description": "Storage Service Properties.", + "type": "object", + "properties": { + "Logging": { + "$ref": "#/definitions/Logging" + }, + "HourMetrics": { + "$ref": "#/definitions/Metrics" + }, + "MinuteMetrics": { + "$ref": "#/definitions/Metrics" + }, + "Cors": { + "description": "The set of CORS rules.", + "type": "array", + "items": { + "$ref": "#/definitions/CorsRule" + }, + "xml": { + "wrapped": true + } + }, + "DefaultServiceVersion": { + "description": "The default version to use for requests to the Blob service if an incoming request's version is not specified. Possible values include version 2008-10-27 and all more recent versions", + "type": "string" + }, + "DeleteRetentionPolicy": { + "$ref": "#/definitions/RetentionPolicy" + }, + "StaticWebsite": { + "$ref": "#/definitions/StaticWebsite" + } + } + }, + "StorageServiceStats": { + "description": "Stats for the storage service.", + "type": "object", + "properties": { + "GeoReplication": { + "$ref": "#/definitions/GeoReplication" + } + } + } + }, + "parameters": { + "Url": { + "name": "url", + "description": "The URL of the service account, container, or blob that is the targe of the desired operation.", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true + }, + "ApiVersionParameter": { + "name": "x-ms-version", + "x-ms-client-name": "version", + "in": "header", + "required": true, + "type": "string", + "description": "Specifies the version of the operation to use for this request.", + "enum": [ + "2018-11-09" + ] + }, + "Blob": { + "name": "blob", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9]+(?:/[a-zA-Z0-9]+)*(?:\\.[a-zA-Z0-9]+){0,1}$", + "minLength": 1, + "maxLength": 1024, + "x-ms-parameter-location": "method", + "description": "The blob name." + }, + "BlobCacheControl": { + "name": "x-ms-blob-cache-control", + "x-ms-client-name": "blobCacheControl", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. Sets the blob's cache control. If specified, this property is stored with the blob and returned with a read request." + }, + "BlobConditionAppendPos": { + "name": "x-ms-blob-condition-appendpos", + "x-ms-client-name": "appendPosition", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "append-position-access-conditions" + }, + "description": "Optional conditional header, used only for the Append Block operation. A number indicating the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition Failed)." + }, + "BlobConditionMaxSize": { + "name": "x-ms-blob-condition-maxsize", + "x-ms-client-name": "maxSize", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "append-position-access-conditions" + }, + "description": "Optional conditional header. The max length in bytes permitted for the append blob. If the Append Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 - Precondition Failed)." + }, + "BlobPublicAccess": { + "name": "x-ms-blob-public-access", + "x-ms-client-name": "access", + "in": "header", + "required": false, + "x-ms-parameter-location": "method", + "description": "Specifies whether data in the container may be accessed publicly and the level of access", + "type": "string", + "enum": [ + "container", + "blob" + ], + "x-ms-enum": { + "name": "PublicAccessType", + "modelAsString": true + } + }, + "AccessTier": { + "name": "x-ms-access-tier", + "x-ms-client-name": "tier", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "P4", + "P6", + "P10", + "P20", + "P30", + "P40", + "P50", + "Hot", + "Cool", + "Archive" + ], + "x-ms-enum": { + "name": "AccessTier", + "modelAsString": true + }, + "x-ms-parameter-location": "method", + "description": "Indicates the tier to be set on the blob." + }, + "BlobContentDisposition": { + "name": "x-ms-blob-content-disposition", + "x-ms-client-name": "blobContentDisposition", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. Sets the blob's Content-Disposition header." + }, + "BlobContentEncoding": { + "name": "x-ms-blob-content-encoding", + "x-ms-client-name": "blobContentEncoding", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. Sets the blob's content encoding. If specified, this property is stored with the blob and returned with a read request." + }, + "BlobContentLanguage": { + "name": "x-ms-blob-content-language", + "x-ms-client-name": "blobContentLanguage", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. Set the blob's content language. If specified, this property is stored with the blob and returned with a read request." + }, + "BlobContentLengthOptional": { + "name": "x-ms-blob-content-length", + "x-ms-client-name": "blobContentLength", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "description": "This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned to a 512-byte boundary." + }, + "BlobContentLengthRequired": { + "name": "x-ms-blob-content-length", + "x-ms-client-name": "blobContentLength", + "in": "header", + "required": true, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "description": "This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned to a 512-byte boundary." + }, + "BlobContentMD5": { + "name": "x-ms-blob-content-md5", + "x-ms-client-name": "blobContentMD5", + "in": "header", + "required": false, + "type": "string", + "format": "byte", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. An MD5 hash of the blob content. Note that this hash is not validated, as the hashes for the individual blocks were validated when each was uploaded." + }, + "BlobContentType": { + "name": "x-ms-blob-content-type", + "x-ms-client-name": "blobContentType", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. Sets the blob's content type. If specified, this property is stored with the blob and returned with a read request." + }, + "BlobSequenceNumber": { + "name": "x-ms-blob-sequence-number", + "x-ms-client-name": "blobSequenceNumber", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "default": 0, + "x-ms-parameter-location": "method", + "description": "Set for page blobs only. The sequence number is a user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 2^63 - 1." + }, + "BlockId": { + "name": "blockid", + "x-ms-client-name": "blockId", + "in": "query", + "type": "string", + "required": true, + "x-ms-parameter-location": "method", + "description": "A valid Base64 string value that identifies the block. Prior to encoding, the string must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter must be the same size for each block." + }, + "BlockListType": { + "name": "blocklisttype", + "x-ms-client-name": "listType", + "in": "query", + "required": true, + "default": "committed", + "x-ms-parameter-location": "method", + "description": "Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both lists together.", + "type": "string", + "enum": [ + "committed", + "uncommitted", + "all" + ], + "x-ms-enum": { + "name": "BlockListType", + "modelAsString": false + } + }, + "Body": { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "format": "file" + }, + "x-ms-parameter-location": "method", + "description": "Initial data" + }, + "ContainerAcl": { + "name": "containerAcl", + "in": "body", + "schema": { + "$ref": "#/definitions/SignedIdentifiers" + }, + "x-ms-parameter-location": "method", + "description": "the acls for the container" + }, + "CopyId": { + "name": "copyid", + "x-ms-client-name": "copyId", + "in": "query", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The copy identifier provided in the x-ms-copy-id header of the original Copy Blob operation." + }, + "ClientRequestId": { + "name": "x-ms-client-request-id", + "x-ms-client-name": "requestId", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled." + }, + "ContainerName": { + "name": "containerName", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The container name." + }, + + "ContentLength": { + "name": "Content-Length", + "in": "header", + "required": true, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "description": "The length of the request." + }, + "ContentMD5": { + "name": "Content-MD5", + "x-ms-client-name": "transactionalContentMD5", + "in": "header", + "required": false, + "type": "string", + "format": "byte", + "x-ms-parameter-location": "method", + "description": "Specify the transactional md5 for the body, to be validated by the service." + }, + "CopySource": { + "name": "x-ms-copy-source", + "x-ms-client-name": "copySource", + "in": "header", + "required": true, + "type": "string", + "format": "url", + "x-ms-parameter-location": "method", + "description": "Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. The source blob must either be public or must be authenticated via a shared access signature." + }, + "DeleteSnapshots": { + "name": "x-ms-delete-snapshots", + "x-ms-client-name": "deleteSnapshots", + "description": "Required if the blob has associated snapshots. Specify one of the following two options: include: Delete the base blob and all of its snapshots. only: Delete only the blob's snapshots and not the blob itself", + "x-ms-parameter-location": "method", + "in": "header", + "required": false, + "type": "string", + "enum": [ + "include", + "only" + ], + "x-ms-enum": { + "name": "DeleteSnapshotsOptionType", + "modelAsString": false + } + }, + "Delimiter": { + "name": "delimiter", + "description": "When the request includes this parameter, the operation returns a BlobPrefix element in the response body that acts as a placeholder for all blobs whose names begin with the same substring up to the appearance of the delimiter character. The delimiter may be a single character or a string.", + "type": "string", + "x-ms-parameter-location": "method", + "in": "query", + "required": true + }, + "GetRangeContentMD5": { + "name": "x-ms-range-get-content-md5", + "x-ms-client-name": "rangeGetContentMD5", + "in": "header", + "required": false, + "type": "boolean", + "x-ms-parameter-location": "method", + "description": "When set to true and specified together with the Range, the service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size." + }, + "IfMatch": { + "name": "If-Match", + "x-ms-client-name": "ifMatch", + "in": "header", + "required": false, + "type": "string", + "format": "etag", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "modified-access-conditions" + }, + "description": "Specify an ETag value to operate only on blobs with a matching value." + }, + "IfModifiedSince": { + "name": "If-Modified-Since", + "x-ms-client-name": "ifModifiedSince", + "in": "header", + "required": false, + "type": "string", + "format": "date-time-rfc1123", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "modified-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has been modified since the specified date/time." + }, + "IfNoneMatch": { + "name": "If-None-Match", + "x-ms-client-name": "ifNoneMatch", + "in": "header", + "required": false, + "type": "string", + "format": "etag", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "modified-access-conditions" + }, + "description": "Specify an ETag value to operate only on blobs without a matching value." + }, + "IfUnmodifiedSince": { + "name": "If-Unmodified-Since", + "x-ms-client-name": "ifUnmodifiedSince", + "in": "header", + "required": false, + "type": "string", + "format": "date-time-rfc1123", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "modified-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has not been modified since the specified date/time." + }, + "IfSequenceNumberEqualTo": { + "name": "x-ms-if-sequence-number-eq", + "x-ms-client-name": "ifSequenceNumberEqualTo", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "sequence-number-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has the specified sequence number." + }, + "IfSequenceNumberLessThan": { + "name": "x-ms-if-sequence-number-lt", + "x-ms-client-name": "ifSequenceNumberLessThan", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "sequence-number-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has a sequence number less than the specified." + }, + "IfSequenceNumberLessThanOrEqualTo": { + "name": "x-ms-if-sequence-number-le", + "x-ms-client-name": "ifSequenceNumberLessThanOrEqualTo", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "sequence-number-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has a sequence number less than or equal to the specified." + }, + "KeyInfo": { + "name": "KeyInfo", + "in": "body", + "x-ms-parameter-location": "method", + "required": true, + "schema": { + "$ref": "#/definitions/KeyInfo" + } + }, + "ListBlobsInclude": { + "name": "include", + "in": "query", + "required": false, + "type": "array", + "collectionFormat": "csv", + "items": { + "type": "string", + "enum": [ + "copy", + "deleted", + "metadata", + "snapshots", + "uncommittedblobs" + ], + "x-ms-enum": { + "name": "ListBlobsIncludeItem", + "modelAsString": false + } + }, + "x-ms-parameter-location": "method", + "description": "Include this parameter to specify one or more datasets to include in the response." + }, + "ListContainersInclude": { + "name": "include", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "metadata" + ], + "x-ms-enum": { + "name": "ListContainersIncludeType", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Include this parameter to specify that the container's metadata be returned as part of the response body." + }, + "LeaseBreakPeriod": { + "name": "x-ms-lease-break-period", + "x-ms-client-name": "breakPeriod", + "in": "header", + "required": false, + "type": "integer", + "x-ms-parameter-location": "method", + "description": "For a break operation, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. If longer, the time remaining on the lease is used. A new lease will not be available before the break period has expired, but the lease may be held for longer than the break period. If this header does not appear with a break operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks immediately." + }, + "LeaseDuration": { + "name": "x-ms-lease-duration", + "x-ms-client-name": "duration", + "in": "header", + "required": false, + "type": "integer", + "x-ms-parameter-location": "method", + "description": "Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or change." + }, + "LeaseIdOptional": { + "name": "x-ms-lease-id", + "x-ms-client-name": "leaseId", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "lease-access-conditions" + }, + "description": "If specified, the operation only succeeds if the resource's lease is active and matches this ID." + }, + "LeaseIdRequired": { + "name": "x-ms-lease-id", + "x-ms-client-name": "leaseId", + "in": "header", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Specifies the current lease ID on the resource." + }, + "Marker": { + "name": "marker", + "in": "query", + "required": false, + "type": "string", + "description": "A string value that identifies the portion of the list of containers to be returned with the next listing operation. The operation returns the NextMarker value within the response body if the listing operation did not return all containers remaining to be listed with the current page. The NextMarker value can be used as the value for the marker parameter in a subsequent call to request the next page of list items. The marker value is opaque to the client.", + "x-ms-parameter-location": "method" + }, + "MaxResults": { + "name": "maxresults", + "in": "query", + "required": false, + "type": "integer", + "minimum": 1, + "x-ms-parameter-location": "method", + "description": "Specifies the maximum number of containers to return. If the request does not specify maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the listing operation crosses a partition boundary, then the service will return a continuation token for retrieving the remainder of the results. For this reason, it is possible that the service will return fewer results than specified by maxresults, or than the default of 5000." + }, + "Metadata": { + "name": "x-ms-meta", + "x-ms-client-name": "metadata", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information.", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "Prefix": { + "name": "prefix", + "in": "query", + "required": false, + "type": "string", + "description": "Filters the results to return only containers whose name begins with the specified prefix.", + "x-ms-parameter-location": "method" + }, + "PrevSnapshot": { + "name": "prevsnapshot", + "in": "query", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Optional in version 2015-07-08 and newer. The prevsnapshot parameter is a DateTime value that specifies that the response will contain only pages that were changed between target blob and previous snapshot. Changed pages include both updated and cleared pages. The target blob may be a snapshot, as long as the snapshot specified by prevsnapshot is the older of the two. Note that incremental snapshots are currently supported only for blobs created on or after January 1, 2016." + }, + "ProposedLeaseIdOptional": { + "name": "x-ms-proposed-lease-id", + "x-ms-client-name": "proposedLeaseId", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID string formats." + }, + "ProposedLeaseIdRequired": { + "name": "x-ms-proposed-lease-id", + "x-ms-client-name": "proposedLeaseId", + "in": "header", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID string formats." + }, + "Range": { + "name": "x-ms-range", + "x-ms-client-name": "range", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Return only the bytes of the blob in the specified range." + }, + "RangeRequiredPutPageFromUrl": { + "name": "x-ms-range", + "x-ms-client-name": "range", + "in": "header", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The range of bytes to which the source range would be written. The range should be 512 aligned and range-end is required." + }, + "SequenceNumberAction": { + "name": "x-ms-sequence-number-action", + "x-ms-client-name": "sequenceNumberAction", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Required if the x-ms-blob-sequence-number header is set for the request. This property applies to page blobs only. This property indicates how the service should modify the blob's sequence number", + "type": "string", + "enum": [ + "max", + "update", + "increment" + ], + "x-ms-enum": { + "name": "SequenceNumberActionType", + "modelAsString": false + } + }, + "Snapshot": { + "name": "snapshot", + "in": "query", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more information on working with blob snapshots, see Creating a Snapshot of a Blob." + }, + "SourceContentMD5": { + "name": "x-ms-source-content-md5", + "x-ms-client-name": "sourceContentMD5", + "in": "header", + "required": false, + "type": "string", + "format": "byte", + "x-ms-parameter-location": "method", + "description": "Specify the md5 calculated for the range of bytes that must be read from the copy source." + }, + "SourceRange": { + "name": "x-ms-source-range", + "x-ms-client-name": "sourceRange", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Bytes of source data in the specified range." + }, + "SourceRangeRequiredPutPageFromUrl": { + "name": "x-ms-source-range", + "x-ms-client-name": "sourceRange", + "in": "header", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Bytes of source data in the specified range. The length of this range should match the ContentLength header and x-ms-range/Range destination range header." + }, + "SourceIfMatch": { + "name": "x-ms-source-if-match", + "x-ms-client-name": "sourceIfMatch", + "in": "header", + "required": false, + "type": "string", + "format": "etag", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "source-modified-access-conditions" + }, + "description": "Specify an ETag value to operate only on blobs with a matching value." + }, + "SourceIfModifiedSince": { + "name": "x-ms-source-if-modified-since", + "x-ms-client-name": "sourceIfModifiedSince", + "in": "header", + "required": false, + "type": "string", + "format": "date-time-rfc1123", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "source-modified-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has been modified since the specified date/time." + }, + "SourceIfNoneMatch": { + "name": "x-ms-source-if-none-match", + "x-ms-client-name": "sourceIfNoneMatch", + "in": "header", + "required": false, + "type": "string", + "format": "etag", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "source-modified-access-conditions" + }, + "description": "Specify an ETag value to operate only on blobs without a matching value." + }, + "SourceIfUnmodifiedSince": { + "name": "x-ms-source-if-unmodified-since", + "x-ms-client-name": "sourceIfUnmodifiedSince", + "in": "header", + "required": false, + "type": "string", + "format": "date-time-rfc1123", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "source-modified-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has not been modified since the specified date/time." + }, + "SourceLeaseId": { + "name": "x-ms-source-lease-id", + "x-ms-client-name": "sourceLeaseId", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "A lease ID for the source path. If specified, the source path must have an active lease and the leaase ID must match." + }, + "SourceUrl": { + "name": "x-ms-copy-source", + "x-ms-client-name": "sourceUrl", + "in": "header", + "required": true, + "type": "string", + "format": "url", + "x-ms-parameter-location": "method", + "description": "Specify a URL to the copy source." + }, + "StorageServiceProperties": { + "name": "StorageServiceProperties", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/StorageServiceProperties" + }, + "x-ms-parameter-location": "method", + "description": "The StorageService properties." + }, + "Timeout": { + "name": "timeout", + "in": "query", + "required": false, + "type": "integer", + "minimum": 0, + "x-ms-parameter-location": "method", + "description": "The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations." + } + } + } + \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/swagger/blob-2019-02-02.json b/sdk/storage/azure-storage-blob/swagger/blob-2019-02-02.json new file mode 100644 index 000000000000..18ae16c45ec5 --- /dev/null +++ b/sdk/storage/azure-storage-blob/swagger/blob-2019-02-02.json @@ -0,0 +1,9974 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Blob Storage", + "version": "2019-02-02", + "x-ms-code-generation-settings": { + "header": "MIT", + "strictSpecAdherence": false + } + }, + "x-ms-parameterized-host": { + "hostTemplate": "{url}", + "useSchemePrefix": false, + "positionInOperation": "first", + "parameters": [ + { + "$ref": "#/parameters/Url" + } + ] + }, + "securityDefinitions": { + "blob_shared_key": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + } + }, + "schemes": [ + "https" + ], + "consumes": [ + "application/xml", + "application/octet-stream", + "text/plain" + ], + "produces": [ + "application/xml", + "application/octet-stream", + "text/plain" + ], + "paths": {}, + "x-ms-paths": { + "/?restype=service&comp=properties": { + "put": { + "tags": [ + "service" + ], + "operationId": "Service_SetProperties", + "description": "Sets properties for a storage account's Blob service endpoint, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules", + "parameters": [ + { + "$ref": "#/parameters/StorageServiceProperties" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "Success (Accepted)", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "get": { + "tags": [ + "service" + ], + "operationId": "Service_GetProperties", + "description": "gets the properties of a storage account's Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + } + }, + "schema": { + "$ref": "#/definitions/StorageServiceProperties" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "service" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/?restype=service&comp=stats": { + "get": { + "tags": [ + "service" + ], + "operationId": "Service_GetStatistics", + "description": "Retrieves statistics related to replication for the Blob service. It is only available on the secondary location endpoint when read-access geo-redundant replication is enabled for the storage account.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/StorageServiceStats" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "service" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "stats" + ] + } + ] + }, + "/?comp=list": { + "get": { + "tags": [ + "service" + ], + "operationId": "Service_ListContainersSegment", + "description": "The List Containers Segment operation returns a list of the containers under the specified account", + "parameters": [ + { + "$ref": "#/parameters/Prefix" + }, + { + "$ref": "#/parameters/Marker" + }, + { + "$ref": "#/parameters/MaxResults" + }, + { + "$ref": "#/parameters/ListContainersInclude" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + } + }, + "schema": { + "$ref": "#/definitions/ListContainersSegmentResponse" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "NextMarker" + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "list" + ] + } + ] + }, + "/?restype=service&comp=userdelegationkey": { + "post": { + "tags": [ + "service" + ], + "operationId": "Service_GetUserDelegationKey", + "description": "Retrieves a user delgation key for the Blob service. This is only a valid operation when using bearer token authentication.", + "parameters": [ + { + "$ref": "#/parameters/KeyInfo" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/UserDelegationKey" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "service" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "userdelegationkey" + ] + } + ] + }, + "/?restype=account&comp=properties": { + "get": { + "tags": [ + "service" + ], + "operationId": "Service_GetAccountInfo", + "description": "Returns the sku name and account kind ", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success (OK)", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-sku-name": { + "x-ms-client-name": "SkuName", + "type": "string", + "enum": [ + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" + ], + "x-ms-enum": { + "name": "SkuName", + "modelAsString": false + }, + "description": "Identifies the sku name of the account" + }, + "x-ms-account-kind": { + "x-ms-client-name": "AccountKind", + "type": "string", + "enum": [ + "Storage", + "BlobStorage", + "StorageV2" + ], + "x-ms-enum": { + "name": "AccountKind", + "modelAsString": false + }, + "description": "Identifies the account kind" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "account" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/?comp=blobs": { + "get": { + "tags": [ + "service" + ], + "operationId": "Service_FilterBlobs", + "description": "The Filter Blobs operation enables callers to list blobs in an account whose tags match a given search expression.", + "parameters": [ + { + "$ref": "#/parameters/Marker" + }, + { + "$ref": "#/parameters/MaxResults" + }, + { + "$ref": "#/parameters/BlobTagFilter" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "Content-Type": { + "type": "string", + "description": "The media type of the body of the response. For Filter Blobs this is 'application/xml'" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/FilterBlobsResponse" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "blobs" + ] + } + ] + }, + "/{containerName}?restype=container": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_Create", + "description": "creates a new container under the specified account. If the container with the same name already exists, the operation fails", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/BlobPublicAccess" + }, + { + "$ref": "#/parameters/DefaultEncryptionScope" + }, + { + "$ref": "#/parameters/DenyEncryptionScopeOverride" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "Success, Container created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "get": { + "tags": [ + "container" + ], + "operationId": "Container_GetProperties", + "description": "returns all user-defined metadata and system properties for the specified container. The data returned does not include the container's list of blobs", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "x-ms-meta": { + "type": "string", + "x-ms-client-name": "Metadata", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-duration": { + "x-ms-client-name": "LeaseDuration", + "description": "When a blob is leased, specifies whether the lease is of infinite or fixed duration.", + "type": "string", + "enum": [ + "infinite", + "fixed" + ], + "x-ms-enum": { + "name": "LeaseDurationType", + "modelAsString": false + } + }, + "x-ms-lease-state": { + "x-ms-client-name": "LeaseState", + "description": "Lease state of the blob.", + "type": "string", + "enum": [ + "available", + "leased", + "expired", + "breaking", + "broken" + ], + "x-ms-enum": { + "name": "LeaseStateType", + "modelAsString": false + } + }, + "x-ms-lease-status": { + "x-ms-client-name": "LeaseStatus", + "description": "The current lease status of the blob.", + "type": "string", + "enum": [ + "locked", + "unlocked" + ], + "x-ms-enum": { + "name": "LeaseStatusType", + "modelAsString": false + } + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-blob-public-access": { + "x-ms-client-name": "BlobPublicAccess", + "description": "Indicated whether data in the container may be accessed publicly and the level of access", + "type": "string", + "enum": [ + "container", + "blob" + ], + "x-ms-enum": { + "name": "PublicAccessType", + "modelAsString": true + } + }, + "x-ms-default-encryption-scope": { + "x-ms-client-name": "DefaultEncryptionScope", + "type": "string", + "description": "Default encryption scope on this container" + }, + "x-ms-deny-encryption-scope-override": { + "x-ms-client-name": "DenyEncryptionScopeOverride", + "type": "boolean", + "description": "Whether to reject the write request with encryption scope" + }, + "x-ms-has-immutability-policy": { + "x-ms-client-name": "HasImmutabilityPolicy", + "description": "Indicates whether the container has an immutability policy set on it.", + "type": "boolean" + }, + "x-ms-has-legal-hold": { + "x-ms-client-name": "HasLegalHold", + "description": "Indicates whether the container has a legal hold.", + "type": "boolean" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "delete": { + "tags": [ + "container" + ], + "operationId": "Container_Delete", + "description": "operation marks the specified container for deletion. The container and any blobs contained within it are later deleted during garbage collection", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "Accepted", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + } + ] + }, + "/{containerName}?restype=container&comp=metadata": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_SetMetadata", + "description": "operation sets one or more user-defined name-value pairs for the specified container.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "metadata" + ] + } + ] + }, + "/{containerName}?restype=container&comp=acl": { + "get": { + "tags": [ + "container" + ], + "operationId": "Container_GetAccessPolicy", + "description": "gets the permissions for the specified container. The permissions indicate whether container data may be accessed publicly.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "x-ms-blob-public-access": { + "x-ms-client-name": "BlobPublicAccess", + "description": "Indicated whether data in the container may be accessed publicly and the level of access", + "type": "string", + "enum": [ + "container", + "blob" + ], + "x-ms-enum": { + "name": "PublicAccessType", + "modelAsString": true + } + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/SignedIdentifiers" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "put": { + "tags": [ + "container" + ], + "operationId": "Container_SetAccessPolicy", + "description": "sets the permissions for the specified container. The permissions indicate whether blobs in a container may be accessed publicly.", + "parameters": [ + { + "$ref": "#/parameters/ContainerAcl" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobPublicAccess" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "acl" + ] + } + ] + }, + "/{containerName}?comp=lease&restype=container&acquire": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_AcquireLease", + "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseDuration" + }, + { + "$ref": "#/parameters/ProposedLeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The Acquire operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a container's lease" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "acquire" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}?comp=lease&restype=container&release": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_ReleaseLease", + "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Release operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "release" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}?comp=lease&restype=container&renew": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_RenewLease", + "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Renew operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a container's lease" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "renew" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}?comp=lease&restype=container&break": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_BreakLease", + "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseBreakPeriod" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The Break operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-time": { + "x-ms-client-name": "LeaseTime", + "type": "integer", + "description": "Approximate time remaining in the lease period, in seconds." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "break" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}?comp=lease&restype=container&change": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_ChangeLease", + "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/ProposedLeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Change operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a container's lease" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "change" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}?restype=container&comp=list&flat": { + "get": { + "tags": [ + "containers" + ], + "operationId": "Container_ListBlobFlatSegment", + "description": "[Update] The List Blobs operation returns a list of the blobs under the specified container", + "parameters": [ + { + "$ref": "#/parameters/Prefix" + }, + { + "$ref": "#/parameters/Marker" + }, + { + "$ref": "#/parameters/MaxResults" + }, + { + "$ref": "#/parameters/ListBlobsInclude" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "Content-Type": { + "type": "string", + "description": "The media type of the body of the response. For List Blobs this is 'application/xml'" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/ListBlobsFlatSegmentResponse" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "NextMarker" + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "list" + ] + } + ] + }, + "/{containerName}?restype=container&comp=list&hierarchy": { + "get": { + "tags": [ + "containers" + ], + "operationId": "Container_ListBlobHierarchySegment", + "description": "[Update] The List Blobs operation returns a list of the blobs under the specified container", + "parameters": [ + { + "$ref": "#/parameters/Prefix" + }, + { + "$ref": "#/parameters/Delimiter" + }, + { + "$ref": "#/parameters/Marker" + }, + { + "$ref": "#/parameters/MaxResults" + }, + { + "$ref": "#/parameters/ListBlobsInclude" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "Content-Type": { + "type": "string", + "description": "The media type of the body of the response. For List Blobs this is 'application/xml'" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/ListBlobsHierarchySegmentResponse" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "NextMarker" + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "list" + ] + } + ] + }, + "/{containerName}?restype=account&comp=properties": { + "get": { + "tags": [ + "container" + ], + "operationId": "Container_GetAccountInfo", + "description": "Returns the sku name and account kind ", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success (OK)", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-sku-name": { + "x-ms-client-name": "SkuName", + "type": "string", + "enum": [ + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" + ], + "x-ms-enum": { + "name": "SkuName", + "modelAsString": false + }, + "description": "Identifies the sku name of the account" + }, + "x-ms-account-kind": { + "x-ms-client-name": "AccountKind", + "type": "string", + "enum": [ + "Storage", + "BlobStorage", + "StorageV2" + ], + "x-ms-enum": { + "name": "AccountKind", + "modelAsString": false + }, + "description": "Identifies the account kind" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "account" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{filesystem}/{path}?resource=directory&Create": { + "put": { + "tags": [ + "directory" + ], + "operationId": "Directory_Create", + "description": "Create a directory. By default, the destination is overwritten and if the destination already exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). To fail if the destination already exists, use a conditional request with If-None-Match: \"*\".", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/DirectoryProperties" + }, + { + "$ref": "#/parameters/PosixPermissions" + }, + { + "$ref": "#/parameters/PosixUmask" + }, + { + "$ref": "#/parameters/XMsCacheControl" + }, + { + "$ref": "#/parameters/XMsContentType" + }, + { + "$ref": "#/parameters/XMsContentEncoding" + }, + { + "$ref": "#/parameters/XMsContentLanguage" + }, + { + "$ref": "#/parameters/XMsContentDisposition" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The file or directory was created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "An HTTP entity tag associated with the file or directory." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The data and time the file or directory was last modified. Write operations on the file or directory update the last modified time." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "A server-generated UUID recorded in the analytics logs for troubleshooting and correlation." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "The version of the REST protocol used to process the request." + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "The size of the resource in bytes." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "A UTC date/time value generated by the service that indicates the time at which the response was initiated." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "A server-generated UUID recorded in the analytics logs for troubleshooting and correlation." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "The version of the REST protocol used to process the request." + } + }, + "schema": { + "$ref": "#/definitions/DataLakeStorageError" + } + } + } + }, + "parameters": [ + { + "name": "resource", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "directory" + ] + } + ] + }, + "/{filesystem}/{path}?DirectoryRename": { + "put": { + "tags": [ + "directory" + ], + "operationId": "Directory_Rename", + "description": "Rename a directory. By default, the destination is overwritten and if the destination already exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). To fail if the destination already exists, use a conditional request with If-None-Match: \"*\".", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Continuation" + }, + { + "$ref": "#/parameters/PathRenameMode" + }, + { + "$ref": "#/parameters/FileRenameSource" + }, + { + "$ref": "#/parameters/DirectoryProperties" + }, + { + "$ref": "#/parameters/PosixPermissions" + }, + { + "$ref": "#/parameters/PosixUmask" + }, + { + "$ref": "#/parameters/XMsCacheControl" + }, + { + "$ref": "#/parameters/XMsContentType" + }, + { + "$ref": "#/parameters/XMsContentEncoding" + }, + { + "$ref": "#/parameters/XMsContentLanguage" + }, + { + "$ref": "#/parameters/XMsContentDisposition" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/SourceLeaseId" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The directory was renamed.", + "headers": { + "x-ms-continuation": { + "x-ms-client-name": "marker", + "type": "string", + "description": "When renaming a directory, the number of paths that are renamed with each invocation is limited. If the number of paths to be renamed exceeds this limit, a continuation token is returned in this response header. When a continuation token is returned in the response, it must be specified in a subsequent invocation of the rename operation to continue renaming the directory." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "An HTTP entity tag associated with the file or directory." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The data and time the file or directory was last modified. Write operations on the file or directory update the last modified time." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "A server-generated UUID recorded in the analytics logs for troubleshooting and correlation." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "The version of the REST protocol used to process the request." + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "The size of the resource in bytes." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "A UTC date/time value generated by the service that indicates the time at which the response was initiated." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "A server-generated UUID recorded in the analytics logs for troubleshooting and correlation." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "The version of the REST protocol used to process the request." + } + }, + "schema": { + "$ref": "#/definitions/DataLakeStorageError" + } + } + } + } + }, + "/{filesystem}/{path}?DirectoryDelete": { + "delete": { + "tags": [ + "directory" + ], + "operationId": "Directory_Delete", + "description": "Deletes the directory", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/RecursiveDirectoryDelete" + }, + { + "$ref": "#/parameters/Continuation" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The directory was deleted.", + "headers": { + "x-ms-continuation": { + "x-ms-client-name": "marker", + "type": "string", + "description": "When renaming a directory, the number of paths that are renamed with each invocation is limited. If the number of paths to be renamed exceeds this limit, a continuation token is returned in this response header. When a continuation token is returned in the response, it must be specified in a subsequent invocation of the rename operation to continue renaming the directory." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "A server-generated UUID recorded in the analytics logs for troubleshooting and correlation." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "The version of the REST protocol used to process the request." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "A UTC date/time value generated by the service that indicates the time at which the response was initiated." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "A server-generated UUID recorded in the analytics logs for troubleshooting and correlation." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "The version of the REST protocol used to process the request." + } + }, + "schema": { + "$ref": "#/definitions/DataLakeStorageError" + } + } + } + } + }, + "/{containerName}/{blob}": { + "get": { + "tags": [ + "blob" + ], + "operationId": "Blob_Download", + "description": "The Download operation reads or downloads a blob from the system, including its metadata and properties. You can also call Download to read a snapshot or verison.", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/VersionId" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Range" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/GetRangeContentMD5" + }, + { + "$ref": "#/parameters/GetRangeContentCRC64" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Returns the content of the entire blob.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-meta": { + "type": "string", + "x-ms-client-name": "Metadata", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "The number of bytes present in the response body." + }, + "Content-Type": { + "type": "string", + "description": "The media type of the body of the response. For Download Blob this is 'application/octet-stream'" + }, + "Content-Range": { + "type": "string", + "description": "Indicates the range of bytes returned in the event that the client requested a subset of the blob by setting the 'Range' request header." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "Content-Encoding": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Encoding request header" + }, + "Cache-Control": { + "type": "string", + "description": "This header is returned if it was previously specified for the blob." + }, + "Content-Disposition": { + "type": "string", + "description": "This header returns the value that was specified for the 'x-ms-blob-content-disposition' header. The Content-Disposition response header field conveys additional information about how to process the response payload, and also can be used to attach additional metadata. For example, if set to attachment, it indicates that the user-agent should not display the response, but instead show a Save As dialog with a filename other than the blob name specified." + }, + "Content-Language": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Language request header." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-blob-type": { + "x-ms-client-name": "BlobType", + "description": "The blob's type.", + "type": "string", + "enum": [ + "BlockBlob", + "PageBlob", + "AppendBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + }, + "x-ms-copy-completion-time": { + "x-ms-client-name": "CopyCompletionTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Conclusion time of the last attempted Copy Blob operation where this blob was the destination blob. This value can specify the time of a completed, aborted, or failed copy attempt. This header does not appear if a copy is pending, if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status-description": { + "x-ms-client-name": "CopyStatusDescription", + "type": "string", + "description": "Only appears when x-ms-copy-status is failed or pending. Describes the cause of the last fatal or non-fatal copy operation failure. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." + }, + "x-ms-copy-progress": { + "x-ms-client-name": "CopyProgress", + "type": "string", + "description": "Contains the number of bytes copied and the total bytes in the source in the last attempted Copy Blob operation where this blob was the destination blob. Can show between 0 and Content-Length bytes copied. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-source": { + "x-ms-client-name": "CopySource", + "type": "string", + "description": "URL up to 2 KB in length that specifies the source blob or file used in the last attempted Copy Blob operation where this blob was the destination blob. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + }, + "x-ms-lease-duration": { + "x-ms-client-name": "LeaseDuration", + "description": "When a blob is leased, specifies whether the lease is of infinite or fixed duration.", + "type": "string", + "enum": [ + "infinite", + "fixed" + ], + "x-ms-enum": { + "name": "LeaseDurationType", + "modelAsString": false + } + }, + "x-ms-lease-state": { + "x-ms-client-name": "LeaseState", + "description": "Lease state of the blob.", + "type": "string", + "enum": [ + "available", + "leased", + "expired", + "breaking", + "broken" + ], + "x-ms-enum": { + "name": "LeaseStateType", + "modelAsString": false + } + }, + "x-ms-lease-status": { + "x-ms-client-name": "LeaseStatus", + "description": "The current lease status of the blob.", + "type": "string", + "enum": [ + "locked", + "unlocked" + ], + "x-ms-enum": { + "name": "LeaseStatusType", + "modelAsString": false + } + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Accept-Ranges": { + "type": "string", + "description": "Indicates that the service supports requests for partial blob content." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-blob-committed-block-count": { + "x-ms-client-name": "BlobCommittedBlockCount", + "type": "integer", + "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." + }, + "x-ms-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the blob data and application metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the blob is unencrypted, or if only parts of the blob/application metadata are encrypted)." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the blob. This header is only returned when the blob was encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the blob. This header is only returned when the blob was encrypted with customer specified encryption." + }, + "x-ms-blob-content-md5": { + "x-ms-client-name": "BlobContentMD5", + "type": "string", + "format": "byte", + "description": "If the blob has a MD5 hash, and if request contains range header (Range or x-ms-range), this response header is returned with the value of the whole blob's MD5 value. This value may or may not be equal to the value returned in Content-MD5 header, with the latter calculated from the requested range" + }, + "x-ms-tag-count": { + "x-ms-client-name": "TagCount", + "type": "integer", + "description": "The number of tags corresponding to the blob." + } + }, + "schema": { + "type": "object", + "format": "file" + } + }, + "206": { + "description": "Returns the content of a specified range of the blob.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-meta": { + "type": "string", + "x-ms-client-name": "Metadata", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "The number of bytes present in the response body." + }, + "Content-Type": { + "type": "string", + "description": "The media type of the body of the response. For Download Blob this is 'application/octet-stream'" + }, + "Content-Range": { + "type": "string", + "description": "Indicates the range of bytes returned in the event that the client requested a subset of the blob by setting the 'Range' request header." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "Content-Encoding": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Encoding request header" + }, + "Cache-Control": { + "type": "string", + "description": "This header is returned if it was previously specified for the blob." + }, + "Content-Disposition": { + "type": "string", + "description": "This header returns the value that was specified for the 'x-ms-blob-content-disposition' header. The Content-Disposition response header field conveys additional information about how to process the response payload, and also can be used to attach additional metadata. For example, if set to attachment, it indicates that the user-agent should not display the response, but instead show a Save As dialog with a filename other than the blob name specified." + }, + "Content-Language": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Language request header." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-blob-type": { + "x-ms-client-name": "BlobType", + "description": "The blob's type.", + "type": "string", + "enum": [ + "BlockBlob", + "PageBlob", + "AppendBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + }, + "x-ms-content-crc64": { + "x-ms-client-name": "ContentCrc64", + "type": "string", + "format": "byte", + "description": "If the request is to read a specified range and the x-ms-range-get-content-crc64 is set to true, then the request returns a crc64 for the range, as long as the range size is less than or equal to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is specified in the same request, it will fail with 400(Bad Request)" + }, + "x-ms-copy-completion-time": { + "x-ms-client-name": "CopyCompletionTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Conclusion time of the last attempted Copy Blob operation where this blob was the destination blob. This value can specify the time of a completed, aborted, or failed copy attempt. This header does not appear if a copy is pending, if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status-description": { + "x-ms-client-name": "CopyStatusDescription", + "type": "string", + "description": "Only appears when x-ms-copy-status is failed or pending. Describes the cause of the last fatal or non-fatal copy operation failure. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." + }, + "x-ms-copy-progress": { + "x-ms-client-name": "CopyProgress", + "type": "string", + "description": "Contains the number of bytes copied and the total bytes in the source in the last attempted Copy Blob operation where this blob was the destination blob. Can show between 0 and Content-Length bytes copied. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-source": { + "x-ms-client-name": "CopySource", + "type": "string", + "description": "URL up to 2 KB in length that specifies the source blob or file used in the last attempted Copy Blob operation where this blob was the destination blob. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + }, + "x-ms-lease-duration": { + "x-ms-client-name": "LeaseDuration", + "description": "When a blob is leased, specifies whether the lease is of infinite or fixed duration.", + "type": "string", + "enum": [ + "infinite", + "fixed" + ], + "x-ms-enum": { + "name": "LeaseDurationType", + "modelAsString": false + } + }, + "x-ms-lease-state": { + "x-ms-client-name": "LeaseState", + "description": "Lease state of the blob.", + "type": "string", + "enum": [ + "available", + "leased", + "expired", + "breaking", + "broken" + ], + "x-ms-enum": { + "name": "LeaseStateType", + "modelAsString": false + } + }, + "x-ms-lease-status": { + "x-ms-client-name": "LeaseStatus", + "description": "The current lease status of the blob.", + "type": "string", + "enum": [ + "locked", + "unlocked" + ], + "x-ms-enum": { + "name": "LeaseStatusType", + "modelAsString": false + } + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Accept-Ranges": { + "type": "string", + "description": "Indicates that the service supports requests for partial blob content." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-blob-committed-block-count": { + "x-ms-client-name": "BlobCommittedBlockCount", + "type": "integer", + "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." + }, + "x-ms-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the blob data and application metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the blob is unencrypted, or if only parts of the blob/application metadata are encrypted)." + }, + "x-ms-blob-content-md5": { + "x-ms-client-name": "BlobContentMD5", + "type": "string", + "format": "byte", + "description": "If the blob has a MD5 hash, and if request contains range header (Range or x-ms-range), this response header is returned with the value of the whole blob's MD5 value. This value may or may not be equal to the value returned in Content-MD5 header, with the latter calculated from the requested range" + }, + "x-ms-tag-count": { + "x-ms-client-name": "TagCount", + "type": "integer", + "description": "The number of tags corresponding to the blob." + } + }, + "schema": { + "type": "object", + "format": "file" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "head": { + "tags": [ + "blob" + ], + "operationId": "Blob_GetProperties", + "description": "The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties for the blob. It does not return the content of the blob.", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/VersionId" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Returns the properties of the blob.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-creation-time": { + "x-ms-client-name": "CreationTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was created." + }, + "x-ms-meta": { + "type": "string", + "x-ms-client-name": "Metadata", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "x-ms-blob-type": { + "x-ms-client-name": "BlobType", + "description": "The blob's type.", + "type": "string", + "enum": [ + "BlockBlob", + "PageBlob", + "AppendBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + }, + "x-ms-copy-completion-time": { + "x-ms-client-name": "CopyCompletionTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Conclusion time of the last attempted Copy Blob operation where this blob was the destination blob. This value can specify the time of a completed, aborted, or failed copy attempt. This header does not appear if a copy is pending, if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status-description": { + "x-ms-client-name": "CopyStatusDescription", + "type": "string", + "description": "Only appears when x-ms-copy-status is failed or pending. Describes the cause of the last fatal or non-fatal copy operation failure. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." + }, + "x-ms-copy-progress": { + "x-ms-client-name": "CopyProgress", + "type": "string", + "description": "Contains the number of bytes copied and the total bytes in the source in the last attempted Copy Blob operation where this blob was the destination blob. Can show between 0 and Content-Length bytes copied. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-source": { + "x-ms-client-name": "CopySource", + "type": "string", + "description": "URL up to 2 KB in length that specifies the source blob or file used in the last attempted Copy Blob operation where this blob was the destination blob. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + }, + "x-ms-incremental-copy": { + "x-ms-client-name": "IsIncrementalCopy", + "type": "boolean", + "description": "Included if the blob is incremental copy blob." + }, + "x-ms-copy-destination-snapshot": { + "x-ms-client-name": "DestinationSnapshot", + "type": "string", + "description": "Included if the blob is incremental copy blob or incremental copy snapshot, if x-ms-copy-status is success. Snapshot time of the last successful incremental copy snapshot for this blob." + }, + "x-ms-lease-duration": { + "x-ms-client-name": "LeaseDuration", + "description": "When a blob is leased, specifies whether the lease is of infinite or fixed duration.", + "type": "string", + "enum": [ + "infinite", + "fixed" + ], + "x-ms-enum": { + "name": "LeaseDurationType", + "modelAsString": false + } + }, + "x-ms-lease-state": { + "x-ms-client-name": "LeaseState", + "description": "Lease state of the blob.", + "type": "string", + "enum": [ + "available", + "leased", + "expired", + "breaking", + "broken" + ], + "x-ms-enum": { + "name": "LeaseStateType", + "modelAsString": false + } + }, + "x-ms-lease-status": { + "x-ms-client-name": "LeaseStatus", + "description": "The current lease status of the blob.", + "type": "string", + "enum": [ + "locked", + "unlocked" + ], + "x-ms-enum": { + "name": "LeaseStatusType", + "modelAsString": false + } + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "The number of bytes present in the response body." + }, + "Content-Type": { + "type": "string", + "description": "The content type specified for the blob. The default content type is 'application/octet-stream'" + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "Content-Encoding": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Encoding request header" + }, + "Content-Disposition": { + "type": "string", + "description": "This header returns the value that was specified for the 'x-ms-blob-content-disposition' header. The Content-Disposition response header field conveys additional information about how to process the response payload, and also can be used to attach additional metadata. For example, if set to attachment, it indicates that the user-agent should not display the response, but instead show a Save As dialog with a filename other than the blob name specified." + }, + "Content-Language": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Language request header." + }, + "Cache-Control": { + "type": "string", + "description": "This header is returned if it was previously specified for the blob." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "Accept-Ranges": { + "type": "string", + "description": "Indicates that the service supports requests for partial blob content." + }, + "x-ms-blob-committed-block-count": { + "x-ms-client-name": "BlobCommittedBlockCount", + "type": "integer", + "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." + }, + "x-ms-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the blob data and application metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the blob is unencrypted, or if only parts of the blob/application metadata are encrypted)." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the metadata. This header is only returned when the metadata was encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the metadata. This header is only returned when the metadata was encrypted with customer specified encryption." + }, + "x-ms-access-tier": { + "x-ms-client-name": "AccessTier", + "type": "string", + "description": "The tier of page blob on a premium storage account or tier of block blob on blob storage LRS accounts. For a list of allowed premium page blob tiers, see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/premium-storage#features. For blob storage LRS accounts, valid values are Hot/Cool/Archive." + }, + "x-ms-access-tier-inferred": { + "x-ms-client-name": "AccessTierInferred", + "type": "boolean", + "description": "For page blobs on a premium storage account only. If the access tier is not explicitly set on the blob, the tier is inferred based on its content length and this header will be returned with true value." + }, + "x-ms-archive-status": { + "x-ms-client-name": "ArchiveStatus", + "type": "string", + "description": "For blob storage LRS accounts, valid values are rehydrate-pending-to-hot/rehydrate-pending-to-cool. If the blob is being rehydrated and is not complete then this header is returned indicating that rehydrate is pending and also tells the destination tier." + }, + "x-ms-access-tier-change-time": { + "x-ms-client-name": "AccessTierChangeTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "The time the tier was changed on the object. This is only returned if the tier on the block blob was ever set." + }, + "x-ms-tag-count": { + "x-ms-client-name": "TagCount", + "type": "integer", + "description": "The number of tags corresponding to the blob." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "delete": { + "tags": [ + "blob" + ], + "operationId": "Blob_Delete", + "description": "If the storage account's soft delete feature is disabled then, when a blob is deleted, it is permanently removed from the storage account. If the storage account's soft delete feature is enabled, then, when a blob is deleted, it is marked for deletion and becomes inaccessible immediately. However, the blob service retains the blob or snapshot for the number of days specified by the DeleteRetentionPolicy section of [Storage service properties] (Set-Blob-Service-Properties.md). After the specified number of days has passed, the blob's data is permanently removed from the storage account. Note that you continue to be charged for the soft-deleted blob's storage until it is permanently removed. Use the List Blobs API and specify the \"include=deleted\" query parameter to discover which blobs and snapshots have been soft deleted. You can then use the Undelete Blob API to restore a soft-deleted blob. All other operations on a soft-deleted blob or snapshot causes the service to return an HTTP status code of 404 (ResourceNotFound). If the storage account's automatic snapshot feature is enabled, then, when a blob is deleted, an automatic snapshot is created. The blob becomes inaccessible immediately. All other operations on the blob causes the service to return an HTTP status code of 404 (ResourceNotFound). You can access automatic snapshot using snapshot timestamp or version id. You can restore the blob by calling Put or Copy Blob API with automatic snapshot as source. Deleting automatic snapshot requires shared key or special SAS/RBAC permissions.", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/VersionId" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/DeleteSnapshots" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The delete request was accepted and the blob will be deleted.", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + } + }, + "/{filesystem}/{path}?FileRename": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_Rename", + "description": "Rename a blob/file. By default, the destination is overwritten and if the destination already exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). To fail if the destination already exists, use a conditional request with If-None-Match: \"*\".", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/PathRenameMode" + }, + { + "$ref": "#/parameters/FileRenameSource" + }, + { + "$ref": "#/parameters/DirectoryProperties" + }, + { + "$ref": "#/parameters/PosixPermissions" + }, + { + "$ref": "#/parameters/PosixUmask" + }, + { + "$ref": "#/parameters/XMsCacheControl" + }, + { + "$ref": "#/parameters/XMsContentType" + }, + { + "$ref": "#/parameters/XMsContentEncoding" + }, + { + "$ref": "#/parameters/XMsContentLanguage" + }, + { + "$ref": "#/parameters/XMsContentDisposition" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/SourceLeaseId" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The file was renamed.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "An HTTP entity tag associated with the file or directory." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The data and time the file or directory was last modified. Write operations on the file or directory update the last modified time." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "A server-generated UUID recorded in the analytics logs for troubleshooting and correlation." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "The version of the REST protocol used to process the request." + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "The size of the resource in bytes." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "A UTC date/time value generated by the service that indicates the time at which the response was initiated." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "A server-generated UUID recorded in the analytics logs for troubleshooting and correlation." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "The version of the REST protocol used to process the request." + } + }, + "schema": { + "$ref": "#/definitions/DataLakeStorageError" + } + } + } + } + }, + "/{containerName}/{blob}?PageBlob": { + "put": { + "tags": [ + "blob" + ], + "operationId": "PageBlob_Create", + "description": "The Create operation creates a new page blob.", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/BlobContentType" + }, + { + "$ref": "#/parameters/BlobContentEncoding" + }, + { + "$ref": "#/parameters/BlobContentLanguage" + }, + { + "$ref": "#/parameters/BlobContentMD5" + }, + { + "$ref": "#/parameters/BlobCacheControl" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobContentDisposition" + }, + { + "$ref": "#/parameters/BlobTagsHeader" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/EncryptionScope" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/BlobContentLengthRequired" + }, + { + "$ref": "#/parameters/BlobSequenceNumber" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The blob was created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "x-ms-version-id": { + "x-ms-client-name": "VersionId", + "type": "string", + "description": "UTC date/time value generated by the service that identifies a version of the blob. This header is returned for requests made against version 2018-11-09 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the blob. This header is only returned when the blob was encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the blob. This header is only returned when the blob was encrypted with customer specified encryption." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "x-ms-blob-type", + "x-ms-client-name": "blobType", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Specifies the type of blob to create: block blob, page blob, or append blob.", + "type": "string", + "enum": [ + "PageBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?AppendBlob": { + "put": { + "tags": [ + "blob" + ], + "operationId": "AppendBlob_Create", + "description": "The Create Append Blob operation creates a new append blob.", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/BlobContentType" + }, + { + "$ref": "#/parameters/BlobContentEncoding" + }, + { + "$ref": "#/parameters/BlobContentLanguage" + }, + { + "$ref": "#/parameters/BlobContentMD5" + }, + { + "$ref": "#/parameters/BlobCacheControl" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobContentDisposition" + }, + { + "$ref": "#/parameters/BlobTagsHeader" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/EncryptionScope" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The blob was created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "x-ms-version-id": { + "x-ms-client-name": "VersionId", + "type": "string", + "description": "UTC date/time value generated by the service that identifies a version of the blob. This header is returned for requests made against version 2018-11-09 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the blob. This header is only returned when the blob was encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the blob. This header is only returned when the blob was encrypted with customer specified encryption." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "x-ms-blob-type", + "x-ms-client-name": "blobType", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Specifies the type of blob to create: block blob, page blob, or append blob.", + "type": "string", + "enum": [ + "AppendBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?BlockBlob": { + "put": { + "tags": [ + "blob" + ], + "operationId": "BlockBlob_Upload", + "description": "The Upload Block Blob operation updates the content of an existing block blob. Updating an existing block blob overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; the content of the existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a block blob, use the Put Block List operation.", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Body" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/BlobContentType" + }, + { + "$ref": "#/parameters/BlobContentEncoding" + }, + { + "$ref": "#/parameters/BlobContentLanguage" + }, + { + "$ref": "#/parameters/BlobContentMD5" + }, + { + "$ref": "#/parameters/BlobCacheControl" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobContentDisposition" + }, + { + "$ref": "#/parameters/BlobTagsHeader" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/EncryptionScope" + }, + { + "$ref": "#/parameters/AccessTierOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The blob was updated.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "x-ms-version-id": { + "x-ms-client-name": "VersionId", + "type": "string", + "description": "UTC date/time value generated by the service that identifies a version of the blob. This header is returned for requests made against version 2018-11-09 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the blob. This header is only returned when the blob was encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the blob. This header is only returned when the blob was encrypted with customer specified encryption." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "x-ms-blob-type", + "x-ms-client-name": "blobType", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Specifies the type of blob to create: block blob, page blob, or append blob.", + "type": "string", + "enum": [ + "BlockBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?comp=undelete": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_Undelete", + "description": "Undelete a blob that was previously soft deleted", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The blob was undeleted successfully.", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "undelete" + ] + } + ] + }, + "/{containerName}/{blob}?comp=properties&SetHTTPHeaders": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_SetHTTPHeaders", + "description": "The Set HTTP Headers operation sets system properties on the blob", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/BlobCacheControl" + }, + { + "$ref": "#/parameters/BlobContentType" + }, + { + "$ref": "#/parameters/BlobContentMD5" + }, + { + "$ref": "#/parameters/BlobContentEncoding" + }, + { + "$ref": "#/parameters/BlobContentLanguage" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/BlobContentDisposition" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The properties were set successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{containerName}/{blob}?comp=metadata": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_SetMetadata", + "description": "The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more name-value pairs", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/EncryptionScope" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The metadata was set successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the metadata. This header is only returned when the metadata was encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the metadata. This header is only returned when the when the metadata was with customer specified encryption." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "metadata" + ] + } + ] + }, + "/{containerName}/{blob}?comp=lease&acquire": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_AcquireLease", + "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseDuration" + }, + { + "$ref": "#/parameters/ProposedLeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The Acquire operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a blobs's lease" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "acquire" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}/{blob}?comp=lease&release": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_ReleaseLease", + "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Release operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "release" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}/{blob}?comp=lease&renew": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_RenewLease", + "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Renew operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a blobs's lease" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "renew" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}/{blob}?comp=lease&change": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_ChangeLease", + "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/ProposedLeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Change operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a blobs's lease" + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "change" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}/{blob}?comp=lease&break": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_BreakLease", + "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseBreakPeriod" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The Break operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-time": { + "x-ms-client-name": "LeaseTime", + "type": "integer", + "description": "Approximate time remaining in the lease period, in seconds." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "break" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}/{blob}?comp=snapshot": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_CreateSnapshot", + "description": "The Create Snapshot operation creates a read-only snapshot of a blob", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/EncryptionScope" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The snaptshot was taken successfully.", + "headers": { + "x-ms-snapshot": { + "x-ms-client-name": "Snapshot", + "type": "string", + "description": "Uniquely identifies the snapshot and indicates the snapshot version. It may be used in subsequent requests to access the snapshot" + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "x-ms-version-id": { + "x-ms-client-name": "VersionId", + "type": "string", + "description": "UTC date/time value generated by the service that identifies the version of the blob. This header is returned for requests made against version 2018-11-09 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "True if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise. For a snapshot request, this header is set to true when metadata was provided in the request and encrypted with a customer-provided key." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the source blob. This header is only returned when the blob was encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the source blob. This header is only returned when the blob was encrypted with customer specified encryption." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "snapshot" + ] + } + ] + }, + "/{containerName}/{blob}?comp=copy": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_StartCopyFromURL", + "description": "The Start Copy From URL operation copies a blob or an internet resource to a new blob.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/BlobTagsHeader" + }, + { + "$ref": "#/parameters/AccessTierOptional" + }, + { + "$ref": "#/parameters/RehydratePriority" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/CopySource" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The copy blob has been accepted with the specified copy status.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "x-ms-version-id": { + "x-ms-client-name": "VersionId", + "type": "string", + "description": "UTC date/time value generated by the service that identifies the version of the blob. This header is returned for requests made against version 2018-11-09 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [] + }, + "/{containerName}/{blob}?comp=copy&sync": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_CopyFromURL", + "description": "The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response until the copy is complete.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/BlobTagsHeader" + }, + { + "$ref": "#/parameters/AccessTierOptional" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/CopySource" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The copy has completed.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "x-ms-version-id": { + "x-ms-client-name": "VersionId", + "type": "string", + "description": "UTC date/time value generated by the service that identifies the version of the blob. This header is returned for requests made against version 2018-11-09 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "success" + ], + "x-ms-enum": { + "name": "SyncCopyStatusType", + "modelAsString": false + } + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "x-ms-requires-sync", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "true" + ] + } + ] + }, + "/{containerName}/{blob}?comp=copy©id={CopyId}": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_AbortCopyFromURL", + "description": "The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination blob with zero length and full metadata.", + "parameters": [ + { + "$ref": "#/parameters/CopyId" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "204": { + "description": "The delete request was accepted and the blob will be deleted.", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "copy" + ] + }, + { + "name": "x-ms-copy-action", + "x-ms-client-name": "copyActionAbortConstant", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "abort" + ], + "x-ms-parameter-location": "method" + } + ] + }, + "/{containerName}/{blob}?comp=tier": { + "put": { + "tags": [ + "blobs" + ], + "operationId": "Blob_SetTier", + "description": "The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium storage account and on a block blob in a blob storage account (locally redundant storage only). A premium page blob's tier determines the allowed size, IOPS, and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive storage type. This operation does not update the blob's ETag.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/AccessTierRequired" + }, + { + "$ref": "#/parameters/RehydratePriority" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + } + ], + "responses": { + "200": { + "description": "The new tier will take effect immediately.", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and newer." + } + } + }, + "202": { + "description": "The transition to the new tier is pending.", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and newer." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "tier" + ] + } + ] + }, + "/{containerName}/{blob}?restype=account&comp=properties": { + "get": { + "tags": [ + "blob" + ], + "operationId": "Blob_GetAccountInfo", + "description": "Returns the sku name and account kind ", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success (OK)", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-sku-name": { + "x-ms-client-name": "SkuName", + "type": "string", + "enum": [ + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" + ], + "x-ms-enum": { + "name": "SkuName", + "modelAsString": false + }, + "description": "Identifies the sku name of the account" + }, + "x-ms-account-kind": { + "x-ms-client-name": "AccountKind", + "type": "string", + "enum": [ + "Storage", + "BlobStorage", + "StorageV2" + ], + "x-ms-enum": { + "name": "AccountKind", + "modelAsString": false + }, + "description": "Identifies the account kind" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "account" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{containerName}/{blob}?comp=tags": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_SetTags", + "description": "The Set Blob Tags operation sets tags for the specified blob. This API is only supported in version 2018-11-09 and later.", + "parameters": [ + { + "$ref": "#/parameters/BlobTagsBody" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/ContentMD5" + }, + { + "$ref": "#/parameters/ContentCrc64" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "204": { + "description": "The tags were set.", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "get": { + "tags": [ + "blob" + ], + "operationId": "Blob_GetTags", + "description": "The Get Blob Tags operation returns all tags for the specified blob, snapshot, or version. This API is only supported in version 2018-11-09 and later.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/VersionId" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Returns the tags.", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/BlobTags" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "tags" + ] + } + ] + }, + "/{containerName}/{blob}?comp=block": { + "put": { + "tags": [ + "blockblob" + ], + "operationId": "BlockBlob_StageBlock", + "description": "The Stage Block operation creates a new block to be committed as part of a blob", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/BlockId" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/ContentMD5" + }, + { + "$ref": "#/parameters/ContentCrc64" + }, + { + "$ref": "#/parameters/Body" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/EncryptionScope" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The block was created.", + "headers": { + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "This header is returned so that the client can check for message content integrity. The value of this header is computed by the Blob service; it is not necessarily the same value specified in the request headers." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-content-crc64": { + "type": "string", + "format": "byte", + "description": "This header is returned so that the client can check for message content integrity. The value of this header is computed by the Blob service; it is not necessarily the same value specified in the request headers." + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the block. This header is only returned when the block was encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the block. This header is only returned when the block was encrypted with customer specified encryption." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "block" + ] + } + ] + }, + "/{containerName}/{blob}?comp=block&fromURL": { + "put": { + "tags": [ + "blockblob" + ], + "operationId": "BlockBlob_StageBlockFromURL", + "description": "The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from a URL.", + "parameters": [ + { + "$ref": "#/parameters/BlockId" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/SourceUrl" + }, + { + "$ref": "#/parameters/SourceRange" + }, + { + "$ref": "#/parameters/SourceContentMD5" + }, + { + "$ref": "#/parameters/SourceContentCRC64" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/EncryptionScope" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + } + ], + "responses": { + "201": { + "description": "The block was created.", + "headers": { + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "This header is returned so that the client can check for message content integrity. The value of this header is computed by the Blob service; it is not necessarily the same value specified in the request headers." + }, + "x-ms-content-crc64": { + "type": "string", + "format": "byte", + "description": "This header is returned so that the client can check for message content integrity. The value of this header is computed by the Blob service; it is not necessarily the same value specified in the request headers." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the block. This header is only returned when the block was encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the block. This header is only returned when the block was encrypted with customer specified encryption." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "block" + ] + } + ] + }, + "/{containerName}/{blob}?comp=blocklist": { + "put": { + "tags": [ + "blockblob" + ], + "operationId": "BlockBlob_CommitBlockList", + "description": "The Commit Block List operation writes a blob by specifying the list of block IDs that make up the blob. In order to be written as part of a blob, a block must have been successfully written to the server in a prior Put Block operation. You can call Put Block List to update a blob by uploading only those blocks that have changed, then committing the new and existing blocks together. You can do this by specifying whether to commit a block from the committed block list or from the uncommitted block list, or to commit the most recently uploaded version of the block, whichever list it may belong to.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/BlobCacheControl" + }, + { + "$ref": "#/parameters/BlobContentType" + }, + { + "$ref": "#/parameters/BlobContentEncoding" + }, + { + "$ref": "#/parameters/BlobContentLanguage" + }, + { + "$ref": "#/parameters/BlobContentMD5" + }, + { + "$ref": "#/parameters/ContentMD5" + }, + { + "$ref": "#/parameters/ContentCrc64" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobContentDisposition" + }, + { + "$ref": "#/parameters/BlobTagsHeader" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/EncryptionScope" + }, + { + "$ref": "#/parameters/AccessTierOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "name": "blocks", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BlockLookupList" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The block list was recorded.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "This header is returned so that the client can check for message content integrity. This header refers to the content of the request, meaning, in this case, the list of blocks, and not the content of the blob itself." + }, + "x-ms-content-crc64": { + "type": "string", + "format": "byte", + "description": "This header is returned so that the client can check for message content integrity. This header refers to the content of the request, meaning, in this case, the list of blocks, and not the content of the blob itself." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "x-ms-version-id": { + "x-ms-client-name": "VersionId", + "type": "string", + "description": "UTC date/time value generated by the service that identifies a version of the blob. This header is returned for requests made against version 2018-11-09 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the blob. This header is only returned when the blob was encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the blob. This header is only returned when the blob was encrypted with customer specified encryption." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "get": { + "tags": [ + "blockblob" + ], + "operationId": "BlockBlob_GetBlockList", + "description": "The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block blob", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/VersionId" + }, + { + "$ref": "#/parameters/BlockListType" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The page range was written.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Content-Type": { + "type": "string", + "description": "The media type of the body of the response. For Get Block List this is 'application/xml'" + }, + "x-ms-blob-content-length": { + "x-ms-client-name": "BlobContentLength", + "type": "integer", + "format": "int64", + "description": "The size of the blob in bytes." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/BlockList" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "blocklist" + ] + } + ] + }, + "/{containerName}/{blob}?comp=page&update": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_UploadPages", + "description": "The Upload Pages operation writes a range of pages to a page blob", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Body" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/ContentMD5" + }, + { + "$ref": "#/parameters/ContentCrc64" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Range" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/EncryptionScope" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThanOrEqualTo" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThan" + }, + { + "$ref": "#/parameters/IfSequenceNumberEqualTo" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The page range was written.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-content-crc64": { + "type": "string", + "format": "byte", + "description": "This header is returned so that the client can check for message content integrity. The value of this header is computed by the Blob service; it is not necessarily the same value specified in the request headers." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for the page blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the pages. This header is only returned when the pages were encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the pages. This header is only returned when the pages were encrypted with customer specified encryption." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "page" + ] + }, + { + "name": "x-ms-page-write", + "x-ms-client-name": "pageWrite", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Required. You may specify one of the following options:\n - Update: Writes the bytes specified by the request body into the specified range. The Range and Content-Length headers must match to perform the update.\n - Clear: Clears the specified range and releases the space used in storage for that range. To clear a range, set the Content-Length header to zero, and the Range header to a value that indicates the range to clear, up to maximum blob size.", + "type": "string", + "enum": [ + "update" + ], + "x-ms-enum": { + "name": "PageWriteType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?comp=page&clear": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_ClearPages", + "description": "The Clear Pages operation clears a set of pages from a page blob", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Range" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThanOrEqualTo" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThan" + }, + { + "$ref": "#/parameters/IfSequenceNumberEqualTo" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The page range was cleared.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-content-crc64": { + "type": "string", + "format": "byte", + "description": "This header is returned so that the client can check for message content integrity. The value of this header is computed by the Blob service; it is not necessarily the same value specified in the request headers." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for the page blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "page" + ] + }, + { + "name": "x-ms-page-write", + "x-ms-client-name": "pageWrite", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Required. You may specify one of the following options:\n - Update: Writes the bytes specified by the request body into the specified range. The Range and Content-Length headers must match to perform the update.\n - Clear: Clears the specified range and releases the space used in storage for that range. To clear a range, set the Content-Length header to zero, and the Range header to a value that indicates the range to clear, up to maximum blob size.", + "type": "string", + "enum": [ + "clear" + ], + "x-ms-enum": { + "name": "PageWriteType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?comp=page&update&fromUrl": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_UploadPagesFromURL", + "description": "The Upload Pages operation writes a range of pages to a page blob where the contents are read from a URL", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/SourceUrl" + }, + { + "$ref": "#/parameters/SourceRangeRequiredPutPageFromUrl" + }, + { + "$ref": "#/parameters/SourceContentMD5" + }, + { + "$ref": "#/parameters/SourceContentCRC64" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/RangeRequiredPutPageFromUrl" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThanOrEqualTo" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThan" + }, + { + "$ref": "#/parameters/IfSequenceNumberEqualTo" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The page range was written.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-content-crc64": { + "type": "string", + "format": "byte", + "description": "This header is returned so that the client can check for message content integrity. The value of this header is computed by the Blob service; it is not necessarily the same value specified in the request headers." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for the page blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "page" + ] + }, + { + "name": "x-ms-page-write", + "x-ms-client-name": "pageWrite", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Required. You may specify one of the following options:\n - Update: Writes the bytes specified by the request body into the specified range. The Range and Content-Length headers must match to perform the update.\n - Clear: Clears the specified range and releases the space used in storage for that range. To clear a range, set the Content-Length header to zero, and the Range header to a value that indicates the range to clear, up to maximum blob size.", + "type": "string", + "enum": [ + "update" + ], + "x-ms-enum": { + "name": "PageWriteType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?comp=pagelist": { + "get": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_GetPageRanges", + "description": "The Get Page Ranges operation returns the list of valid page ranges for a page blob, version or snapshot of a page blob", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/VersionId" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Range" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Information on the page blob was found.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "x-ms-blob-content-length": { + "x-ms-client-name": "BlobContentLength", + "type": "integer", + "format": "int64", + "description": "The size of the blob in bytes." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/PageList" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "pagelist" + ] + } + ] + }, + "/{containerName}/{blob}?comp=pagelist&diff": { + "get": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_GetPageRangesDiff", + "description": "[Update] The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were changed between target blob and previous snapshot or version.", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/VersionId" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/PrevSnapshot" + }, + { + "$ref": "#/parameters/Range" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Information on the page blob was found.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "x-ms-blob-content-length": { + "x-ms-client-name": "BlobContentLength", + "type": "integer", + "format": "int64", + "description": "The size of the blob in bytes." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/PageList" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "pagelist" + ] + } + ] + }, + "/{containerName}/{blob}?comp=properties&Resize": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_Resize", + "description": "Resize the Blob", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/BlobContentLengthRequired" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Blob was resized successfully", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{containerName}/{blob}?comp=properties&UpdateSequenceNumber": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_UpdateSequenceNumber", + "description": "Update the sequence number of the blob", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/SequenceNumberAction" + }, + { + "$ref": "#/parameters/BlobSequenceNumber" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The sequence numbers were updated successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{containerName}/{blob}?comp=incrementalcopy": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_CopyIncremental", + "description": "The Copy Incremental operation copies a snapshot of the source page blob to a destination page blob. The snapshot is copied such that only the differential changes between the previously copied snapshot are transferred to the destination. The copied snapshots are complete copies of the original snapshot and can be read or copied from as usual. This API is supported since REST version 2016-05-31.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/CopySource" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The blob was copied.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "incrementalcopy" + ] + } + ] + }, + "/{containerName}/{blob}?comp=appendblock": { + "put": { + "tags": [ + "appendblob" + ], + "operationId": "AppendBlob_AppendBlock", + "description": "The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later.", + "parameters": [ + { + "$ref": "#/parameters/Body" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/ContentMD5" + }, + { + "$ref": "#/parameters/ContentCrc64" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobConditionMaxSize" + }, + { + "$ref": "#/parameters/BlobConditionAppendPos" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/EncryptionScope" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The block was created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-content-crc64": { + "type": "string", + "format": "byte", + "description": "This header is returned so that the client can check for message content integrity. The value of this header is computed by the Blob service; it is not necessarily the same value specified in the request headers." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-blob-append-offset": { + "x-ms-client-name": "BlobAppendOffset", + "type": "string", + "description": "This response header is returned only for append operations. It returns the offset at which the block was committed, in bytes." + }, + "x-ms-blob-committed-block-count": { + "x-ms-client-name": "BlobCommittedBlockCount", + "type": "integer", + "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the block. This header is only returned when the block was encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the block. This header is only returned when the block was encrypted with customer specified encryption." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "appendblock" + ] + } + ] + }, + "/{containerName}/{blob}?comp=appendblock&fromUrl": { + "put": { + "tags": [ + "appendblob" + ], + "operationId": "AppendBlob_AppendBlockFromUrl", + "description": "The Append Block operation commits a new block of data to the end of an existing append blob where the contents are read from a source url. The Append Block operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later.", + "parameters": [ + { + "$ref": "#/parameters/SourceUrl" + }, + { + "$ref": "#/parameters/SourceRange" + }, + { + "$ref": "#/parameters/SourceContentMD5" + }, + { + "$ref": "#/parameters/SourceContentCRC64" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/ContentMD5" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobConditionMaxSize" + }, + { + "$ref": "#/parameters/BlobConditionAppendPos" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The block was created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-content-crc64": { + "type": "string", + "format": "byte", + "description": "This header is returned so that the client can check for message content integrity. The value of this header is computed by the Blob service; it is not necessarily the same value specified in the request headers." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-blob-append-offset": { + "x-ms-client-name": "BlobAppendOffset", + "type": "string", + "description": "This response header is returned only for append operations. It returns the offset at which the block was committed, in bytes." + }, + "x-ms-blob-committed-block-count": { + "x-ms-client-name": "BlobCommittedBlockCount", + "type": "integer", + "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "appendblock" + ] + } + ] + } + }, + "definitions": { + "KeyInfo": { + "type": "object", + "required": [ + "Start", + "Expiry" + ], + "description": "Key information", + "properties": { + "Start": { + "description": "The date-time the key is active in ISO 8601 UTC time", + "type": "string" + }, + "Expiry": { + "description": "The date-time the key expires in ISO 8601 UTC time", + "type": "string" + } + } + }, + "UserDelegationKey": { + "type": "object", + "required": [ + "SignedOid", + "SignedTid", + "SignedStart", + "SignedExpiry", + "SignedService", + "SignedVersion", + "Value" + ], + "description": "A user delegation key", + "properties": { + "SignedOid": { + "description": "The Azure Active Directory object ID in GUID format.", + "type": "string" + }, + "SignedTid": { + "description": "The Azure Active Directory tenant ID in GUID format", + "type": "string" + }, + "SignedStart": { + "description": "The date-time the key is active", + "type": "string", + "format": "date-time" + }, + "SignedExpiry": { + "description": "The date-time the key expires", + "type": "string", + "format": "date-time" + }, + "SignedService": { + "description": "Abbreviation of the Azure Storage service that accepts the key", + "type": "string" + }, + "SignedVersion": { + "description": "The service version that created the key", + "type": "string" + }, + "Value": { + "description": "The key as a base64 string", + "type": "string" + } + } + }, + "PublicAccessType": { + "type": "string", + "enum": [ + "container", + "blob" + ], + "x-ms-enum": { + "name": "PublicAccessType", + "modelAsString": true + } + }, + "CopyStatus": { + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + }, + "LeaseDuration": { + "type": "string", + "enum": [ + "infinite", + "fixed" + ], + "x-ms-enum": { + "name": "LeaseDurationType", + "modelAsString": false + } + }, + "LeaseState": { + "type": "string", + "enum": [ + "available", + "leased", + "expired", + "breaking", + "broken" + ], + "x-ms-enum": { + "name": "LeaseStateType", + "modelAsString": false + } + }, + "LeaseStatus": { + "type": "string", + "enum": [ + "locked", + "unlocked" + ], + "x-ms-enum": { + "name": "LeaseStatusType", + "modelAsString": false + } + }, + "StorageError": { + "type": "object", + "properties": { + "Message": { + "type": "string" + } + } + }, + "DataLakeStorageError": { + "type": "object", + "properties": { + "error": { + "description": "The service error response object.", + "properties": { + "code": { + "description": "The service error code.", + "type": "string" + }, + "message": { + "description": "The service error message.", + "type": "string" + } + } + } + } + }, + "AccessPolicy": { + "type": "object", + "required": [ + "Start", + "Expiry", + "Permission" + ], + "description": "An Access policy", + "properties": { + "Start": { + "description": "the date-time the policy is active", + "type": "string", + "format": "date-time" + }, + "Expiry": { + "description": "the date-time the policy expires", + "type": "string", + "format": "date-time" + }, + "Permission": { + "description": "the permissions for the acl policy", + "type": "string" + } + } + }, + "AccessTier": { + "type": "string", + "enum": [ + "P4", + "P6", + "P10", + "P20", + "P30", + "P40", + "P50", + "Hot", + "Cool", + "Archive" + ], + "x-ms-enum": { + "name": "AccessTier", + "modelAsString": true + } + }, + "ArchiveStatus": { + "type": "string", + "enum": [ + "rehydrate-pending-to-hot", + "rehydrate-pending-to-cool" + ], + "x-ms-enum": { + "name": "ArchiveStatus", + "modelAsString": true + } + }, + "BlobItem": { + "xml": { + "name": "Blob" + }, + "description": "An Azure Storage blob", + "type": "object", + "required": [ + "Name", + "Deleted", + "Snapshot", + "VersionId", + "Properties" + ], + "properties": { + "Name": { + "type": "string" + }, + "Deleted": { + "type": "boolean" + }, + "Snapshot": { + "type": "string" + }, + "VersionId": { + "type": "string" + }, + "Properties": { + "$ref": "#/definitions/BlobProperties" + }, + "Metadata": { + "$ref": "#/definitions/BlobMetadata" + }, + "Tags": { + "$ref": "#/definitions/BlobTags" + } + } + }, + "BlobProperties": { + "xml": { + "name": "Properties" + }, + "description": "Properties of a blob", + "type": "object", + "required": [ + "Etag", + "Last-Modified", + "TagCount" + ], + "properties": { + "Creation-Time": { + "type": "string", + "format": "date-time-rfc1123" + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123" + }, + "Etag": { + "type": "string", + "format": "etag" + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "Size in bytes" + }, + "Content-Type": { + "type": "string" + }, + "Content-Encoding": { + "type": "string" + }, + "Content-Language": { + "type": "string" + }, + "Content-MD5": { + "type": "string", + "format": "byte" + }, + "Content-Disposition": { + "type": "string" + }, + "Cache-Control": { + "type": "string" + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "blobSequenceNumber", + "type": "integer", + "format": "int64" + }, + "BlobType": { + "type": "string", + "enum": [ + "BlockBlob", + "PageBlob", + "AppendBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + }, + "LeaseStatus": { + "$ref": "#/definitions/LeaseStatus" + }, + "LeaseState": { + "$ref": "#/definitions/LeaseState" + }, + "LeaseDuration": { + "$ref": "#/definitions/LeaseDuration" + }, + "CopyId": { + "type": "string" + }, + "CopyStatus": { + "$ref": "#/definitions/CopyStatus" + }, + "CopySource": { + "type": "string" + }, + "CopyProgress": { + "type": "string" + }, + "CopyCompletionTime": { + "type": "string", + "format": "date-time-rfc1123" + }, + "CopyStatusDescription": { + "type": "string" + }, + "ServerEncrypted": { + "type": "boolean" + }, + "IncrementalCopy": { + "type": "boolean" + }, + "DestinationSnapshot": { + "type": "string" + }, + "DeletedTime": { + "type": "string", + "format": "date-time-rfc1123" + }, + "RemainingRetentionDays": { + "type": "integer" + }, + "AccessTier": { + "$ref": "#/definitions/AccessTier" + }, + "AccessTierInferred": { + "type": "boolean" + }, + "ArchiveStatus": { + "$ref": "#/definitions/ArchiveStatus" + }, + "CustomerProvidedKeySha256": { + "type": "string" + }, + "EncryptionScope": { + "type": "string" + }, + "AccessTierChangeTime": { + "type": "string", + "format": "date-time-rfc1123" + }, + "TagCount": { + "type": "integer", + "description": "The number of tags corresponding to the blob." + } + } + }, + "ListBlobsFlatSegmentResponse": { + "xml": { + "name": "EnumerationResults" + }, + "description": "An enumeration of blobs", + "type": "object", + "required": [ + "ServiceEndpoint", + "ContainerName", + "Segment" + ], + "properties": { + "ServiceEndpoint": { + "type": "string", + "xml": { + "attribute": true + } + }, + "ContainerName": { + "type": "string", + "xml": { + "attribute": true + } + }, + "Prefix": { + "type": "string" + }, + "Marker": { + "type": "string" + }, + "MaxResults": { + "type": "integer" + }, + "Delimiter": { + "type": "string" + }, + "Segment": { + "$ref": "#/definitions/BlobFlatListSegment" + }, + "NextMarker": { + "type": "string" + } + } + }, + "ListBlobsHierarchySegmentResponse": { + "xml": { + "name": "EnumerationResults" + }, + "description": "An enumeration of blobs", + "type": "object", + "required": [ + "ServiceEndpoint", + "ContainerName", + "Segment" + ], + "properties": { + "ServiceEndpoint": { + "type": "string", + "xml": { + "attribute": true + } + }, + "ContainerName": { + "type": "string", + "xml": { + "attribute": true + } + }, + "Prefix": { + "type": "string" + }, + "Marker": { + "type": "string" + }, + "MaxResults": { + "type": "integer" + }, + "Delimiter": { + "type": "string" + }, + "Segment": { + "$ref": "#/definitions/BlobHierarchyListSegment" + }, + "NextMarker": { + "type": "string" + } + } + }, + "BlobFlatListSegment": { + "xml": { + "name": "Blobs" + }, + "required": [ + "BlobItems" + ], + "type": "object", + "properties": { + "BlobItems": { + "type": "array", + "items": { + "$ref": "#/definitions/BlobItem" + } + } + } + }, + "BlobHierarchyListSegment": { + "xml": { + "name": "Blobs" + }, + "type": "object", + "required": [ + "BlobItems" + ], + "properties": { + "BlobPrefixes": { + "type": "array", + "items": { + "$ref": "#/definitions/BlobPrefix" + } + }, + "BlobItems": { + "type": "array", + "items": { + "$ref": "#/definitions/BlobItem" + } + } + } + }, + "BlobPrefix": { + "type": "object", + "required": [ + "Name" + ], + "properties": { + "Name": { + "type": "string" + } + } + }, + "Tag": { + "type": "object", + "required": [ + "Key", + "Value" + ], + "description": "Represents a single user-provided tag.", + "properties": { + "Key": { + "description": "The tag name.", + "type": "string" + }, + "Value": { + "description": "The tag value.", + "type": "string" + } + } + }, + "BlobTags": { + "xml": { + "name": "Tags" + }, + "description": "XML containing key/value pairs representing the tags for the blob.", + "properties": { + "TagSet": { + "xml": { + "wrapped": true + }, + "type": "array", + "items": { + "$ref": "#/definitions/Tag" + } + } + } + }, + "Block": { + "type": "object", + "required": [ + "Name", + "Size" + ], + "description": "Represents a single block in a block blob. It describes the block's ID and size.", + "properties": { + "Name": { + "description": "The base64 encoded block ID.", + "type": "string" + }, + "Size": { + "description": "The block size in bytes.", + "type": "integer" + } + } + }, + "BlockList": { + "type": "object", + "properties": { + "CommittedBlocks": { + "xml": { + "wrapped": true + }, + "type": "array", + "items": { + "$ref": "#/definitions/Block" + } + }, + "UncommittedBlocks": { + "xml": { + "wrapped": true + }, + "type": "array", + "items": { + "$ref": "#/definitions/Block" + } + } + } + }, + "BlockLookupList": { + "type": "object", + "properties": { + "Committed": { + "type": "array", + "items": { + "type": "string", + "xml": { + "name": "Committed" + } + } + }, + "Uncommitted": { + "type": "array", + "items": { + "type": "string", + "xml": { + "name": "Uncommitted" + } + } + }, + "Latest": { + "type": "array", + "items": { + "type": "string", + "xml": { + "name": "Latest" + } + } + } + }, + "xml": { + "name": "BlockList" + } + }, + "ContainerItem": { + "xml": { + "name": "Container" + }, + "type": "object", + "required": [ + "Name", + "Properties" + ], + "description": "An Azure Storage container", + "properties": { + "Name": { + "type": "string" + }, + "Properties": { + "$ref": "#/definitions/ContainerProperties" + }, + "Metadata": { + "$ref": "#/definitions/ContainerMetadata" + } + } + }, + "ContainerProperties": { + "type": "object", + "required": [ + "Last-Modified", + "Etag" + ], + "description": "Properties of a container", + "properties": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123" + }, + "Etag": { + "type": "string", + "format": "etag" + }, + "LeaseStatus": { + "$ref": "#/definitions/LeaseStatus" + }, + "LeaseState": { + "$ref": "#/definitions/LeaseState" + }, + "LeaseDuration": { + "$ref": "#/definitions/LeaseDuration" + }, + "PublicAccess": { + "$ref": "#/definitions/PublicAccessType" + }, + "HasImmutabilityPolicy": { + "type": "boolean" + }, + "HasLegalHold": { + "type": "boolean" + } + } + }, + "ListContainersSegmentResponse": { + "xml": { + "name": "EnumerationResults" + }, + "description": "An enumeration of containers", + "type": "object", + "required": [ + "ServiceEndpoint", + "ContainerItems" + ], + "properties": { + "ServiceEndpoint": { + "type": "string", + "xml": { + "attribute": true + } + }, + "Prefix": { + "type": "string" + }, + "Marker": { + "type": "string" + }, + "MaxResults": { + "type": "integer" + }, + "ContainerItems": { + "xml": { + "wrapped": true, + "name": "Containers" + }, + "type": "array", + "items": { + "$ref": "#/definitions/ContainerItem" + } + }, + "NextMarker": { + "type": "string" + } + } + }, + "CorsRule": { + "description": "CORS is an HTTP feature that enables a web application running under one domain to access resources in another domain. Web browsers implement a security restriction known as same-origin policy that prevents a web page from calling APIs in a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs in another domain", + "type": "object", + "required": [ + "AllowedOrigins", + "AllowedMethods", + "AllowedHeaders", + "ExposedHeaders", + "MaxAgeInSeconds" + ], + "properties": { + "AllowedOrigins": { + "description": "The origin domains that are permitted to make a request against the storage service via CORS. The origin domain is the domain from which the request originates. Note that the origin must be an exact case-sensitive match with the origin that the user age sends to the service. You can also use the wildcard character '*' to allow all origin domains to make requests via CORS.", + "type": "string" + }, + "AllowedMethods": { + "description": "The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated)", + "type": "string" + }, + "AllowedHeaders": { + "description": "the request headers that the origin domain may specify on the CORS request.", + "type": "string" + }, + "ExposedHeaders": { + "description": "The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer", + "type": "string" + }, + "MaxAgeInSeconds": { + "description": "The maximum amount time that a browser should cache the preflight OPTIONS request.", + "type": "integer", + "minimum": 0 + } + } + }, + "ErrorCode": { + "description": "Error codes returned by the service", + "type": "string", + "enum": [ + "AccountAlreadyExists", + "AccountBeingCreated", + "AccountIsDisabled", + "AuthenticationFailed", + "ConditionHeadersNotSupported", + "ConditionNotMet", + "EmptyMetadataKey", + "InsufficientAccountPermissions", + "InternalError", + "InvalidAuthenticationInfo", + "InvalidHeaderValue", + "InvalidHttpVerb", + "InvalidInput", + "InvalidMd5", + "InvalidMetadata", + "InvalidQueryParameterValue", + "InvalidRange", + "InvalidResourceName", + "InvalidUri", + "InvalidXmlDocument", + "InvalidXmlNodeValue", + "Md5Mismatch", + "MetadataTooLarge", + "MissingContentLengthHeader", + "MissingRequiredQueryParameter", + "MissingRequiredHeader", + "MissingRequiredXmlNode", + "MultipleConditionHeadersNotSupported", + "OperationTimedOut", + "OutOfRangeInput", + "OutOfRangeQueryParameterValue", + "RequestBodyTooLarge", + "ResourceTypeMismatch", + "RequestUrlFailedToParse", + "ResourceAlreadyExists", + "ResourceNotFound", + "ServerBusy", + "UnsupportedHeader", + "UnsupportedXmlNode", + "UnsupportedQueryParameter", + "UnsupportedHttpVerb", + "AppendPositionConditionNotMet", + "BlobAlreadyExists", + "BlobNotFound", + "BlobOverwritten", + "BlobTierInadequateForContentLength", + "BlockCountExceedsLimit", + "BlockListTooLong", + "CannotChangeToLowerTier", + "CannotVerifyCopySource", + "ContainerAlreadyExists", + "ContainerBeingDeleted", + "ContainerDisabled", + "ContainerNotFound", + "ContentLengthLargerThanTierLimit", + "CopyAcrossAccountsNotSupported", + "CopyIdMismatch", + "FeatureVersionMismatch", + "IncrementalCopyBlobMismatch", + "IncrementalCopyOfEralierVersionSnapshotNotAllowed", + "IncrementalCopySourceMustBeSnapshot", + "InfiniteLeaseDurationRequired", + "InvalidBlobOrBlock", + "InvalidBlobTier", + "InvalidBlobType", + "InvalidBlockId", + "InvalidBlockList", + "InvalidOperation", + "InvalidPageRange", + "InvalidSourceBlobType", + "InvalidSourceBlobUrl", + "InvalidVersionForPageBlobOperation", + "LeaseAlreadyPresent", + "LeaseAlreadyBroken", + "LeaseIdMismatchWithBlobOperation", + "LeaseIdMismatchWithContainerOperation", + "LeaseIdMismatchWithLeaseOperation", + "LeaseIdMissing", + "LeaseIsBreakingAndCannotBeAcquired", + "LeaseIsBreakingAndCannotBeChanged", + "LeaseIsBrokenAndCannotBeRenewed", + "LeaseLost", + "LeaseNotPresentWithBlobOperation", + "LeaseNotPresentWithContainerOperation", + "LeaseNotPresentWithLeaseOperation", + "MaxBlobSizeConditionNotMet", + "NoPendingCopyOperation", + "OperationNotAllowedOnIncrementalCopyBlob", + "PendingCopyOperation", + "PreviousSnapshotCannotBeNewer", + "PreviousSnapshotNotFound", + "PreviousSnapshotOperationNotSupported", + "SequenceNumberConditionNotMet", + "SequenceNumberIncrementTooLarge", + "SnapshotCountExceeded", + "SnaphotOperationRateExceeded", + "SnapshotsPresent", + "SourceConditionNotMet", + "SystemInUse", + "TargetConditionNotMet", + "UnauthorizedBlobOverwrite", + "BlobBeingRehydrated", + "BlobArchived", + "BlobNotArchived" + ], + "x-ms-enum": { + "name": "StorageErrorCode", + "modelAsString": true + } + }, + "FilterBlobsItem": { + "xml": { + "name": "Blob" + }, + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "ContainerName": { + "type": "string" + }, + "TagValue": { + "type": "string" + } + } + }, + "FilterBlobsSegment": { + "xml": { + "name": "Blobs" + }, + "type": "object", + "properties": { + "BlobItems": { + "type": "array", + "items": { + "$ref": "#/definitions/FilterBlobsItem" + } + } + } + }, + "FilterBlobsResponse": { + "xml": { + "name": "EnumerationResults" + }, + "description": "An enumeration of blobs which matched the filter.", + "type": "object", + "required": [ + "ServiceEndpoint", + "Filter", + "Segment", + "NextMarker" + ], + "properties": { + "ServiceEndpoint": { + "type": "string", + "xml": { + "attribute": true + } + }, + "Filter": { + "type": "string" + }, + "Marker": { + "type": "string" + }, + "MaxResults": { + "type": "integer" + }, + "Segment": { + "$ref": "#/definitions/FilterBlobsSegment" + }, + "NextMarker": { + "type": "string" + } + } + }, + "GeoReplication": { + "description": "Geo-Replication information for the Secondary Storage Service", + "type": "object", + "required": [ + "Status", + "LastSyncTime" + ], + "properties": { + "Status": { + "description": "The status of the secondary location", + "type": "string", + "enum": [ + "live", + "bootstrap", + "unavailable" + ], + "x-ms-enum": { + "name": "GeoReplicationStatusType", + "modelAsString": true + } + }, + "LastSyncTime": { + "description": "A GMT date/time value, to the second. All primary writes preceding this value are guaranteed to be available for read operations at the secondary. Primary writes after this point in time may or may not be available for reads.", + "type": "string", + "format": "date-time-rfc1123" + } + } + }, + "Logging": { + "description": "Azure Analytics Logging settings.", + "type": "object", + "required": [ + "Version", + "Delete", + "Read", + "Write", + "RetentionPolicy" + ], + "properties": { + "Version": { + "description": "The version of Storage Analytics to configure.", + "type": "string" + }, + "Delete": { + "description": "Indicates whether all delete requests should be logged.", + "type": "boolean" + }, + "Read": { + "description": "Indicates whether all read requests should be logged.", + "type": "boolean" + }, + "Write": { + "description": "Indicates whether all write requests should be logged.", + "type": "boolean" + }, + "RetentionPolicy": { + "$ref": "#/definitions/RetentionPolicy" + } + } + }, + "ContainerMetadata": { + "type": "object", + "xml": { + "name": "Metadata" + }, + "additionalProperties": { + "type": "string" + } + }, + "BlobMetadata": { + "type": "object", + "xml": { + "name": "Metadata" + }, + "properties": { + "Encrypted": { + "type": "string", + "xml": { + "attribute": true + } + } + }, + "additionalProperties": { + "type": "string" + } + }, + "Metrics": { + "description": "a summary of request statistics grouped by API in hour or minute aggregates for blobs", + "required": [ + "Enabled" + ], + "properties": { + "Version": { + "description": "The version of Storage Analytics to configure.", + "type": "string" + }, + "Enabled": { + "description": "Indicates whether metrics are enabled for the Blob service.", + "type": "boolean" + }, + "IncludeAPIs": { + "description": "Indicates whether metrics should generate summary statistics for called API operations.", + "type": "boolean" + }, + "RetentionPolicy": { + "$ref": "#/definitions/RetentionPolicy" + } + } + }, + "PageList": { + "description": "the list of pages", + "type": "object", + "properties": { + "PageRange": { + "type": "array", + "items": { + "$ref": "#/definitions/PageRange" + } + }, + "ClearRange": { + "type": "array", + "items": { + "$ref": "#/definitions/ClearRange" + } + } + } + }, + "PageRange": { + "type": "object", + "required": [ + "Start", + "End" + ], + "properties": { + "Start": { + "type": "integer", + "format": "int64", + "xml": { + "name": "Start" + } + }, + "End": { + "type": "integer", + "format": "int64", + "xml": { + "name": "End" + } + } + }, + "xml": { + "name": "PageRange" + } + }, + "ClearRange": { + "type": "object", + "required": [ + "Start", + "End" + ], + "properties": { + "Start": { + "type": "integer", + "format": "int64", + "xml": { + "name": "Start" + } + }, + "End": { + "type": "integer", + "format": "int64", + "xml": { + "name": "End" + } + } + }, + "xml": { + "name": "ClearRange" + } + }, + "RetentionPolicy": { + "description": "the retention policy which determines how long the associated data should persist", + "type": "object", + "required": [ + "Enabled" + ], + "properties": { + "Enabled": { + "description": "Indicates whether a retention policy is enabled for the storage service", + "type": "boolean" + }, + "Days": { + "description": "Indicates the number of days that metrics or logging or soft-deleted data should be retained. All data older than this value will be deleted", + "type": "integer", + "minimum": 1 + } + } + }, + "SignedIdentifier": { + "xml": { + "name": "SignedIdentifier" + }, + "description": "signed identifier", + "type": "object", + "required": [ + "Id", + "AccessPolicy" + ], + "properties": { + "Id": { + "type": "string", + "description": "a unique id" + }, + "AccessPolicy": { + "$ref": "#/definitions/AccessPolicy" + } + } + }, + "SignedIdentifiers": { + "description": "a collection of signed identifiers", + "type": "array", + "items": { + "$ref": "#/definitions/SignedIdentifier" + }, + "xml": { + "wrapped": true, + "name": "SignedIdentifiers" + } + }, + "StaticWebsite": { + "description": "The properties that enable an account to host a static website", + "type": "object", + "required": [ + "Enabled" + ], + "properties": { + "Enabled": { + "description": "Indicates whether this account is hosting a static website", + "type": "boolean" + }, + "IndexDocument": { + "description": "The default name of the index page under each directory", + "type": "string" + }, + "ErrorDocument404Path": { + "description": "The absolute path of the custom 404 page", + "type": "string" + } + } + }, + "StorageServiceProperties": { + "description": "Storage Service Properties.", + "type": "object", + "properties": { + "Logging": { + "$ref": "#/definitions/Logging" + }, + "HourMetrics": { + "$ref": "#/definitions/Metrics" + }, + "MinuteMetrics": { + "$ref": "#/definitions/Metrics" + }, + "Cors": { + "description": "The set of CORS rules.", + "type": "array", + "items": { + "$ref": "#/definitions/CorsRule" + }, + "xml": { + "wrapped": true + } + }, + "DefaultServiceVersion": { + "description": "The default version to use for requests to the Blob service if an incoming request's version is not specified. Possible values include version 2008-10-27 and all more recent versions", + "type": "string" + }, + "DeleteRetentionPolicy": { + "$ref": "#/definitions/RetentionPolicy" + }, + "StaticWebsite": { + "$ref": "#/definitions/StaticWebsite" + } + } + }, + "StorageServiceStats": { + "description": "Stats for the storage service.", + "type": "object", + "properties": { + "GeoReplication": { + "$ref": "#/definitions/GeoReplication" + } + } + } + }, + "parameters": { + "Url": { + "name": "url", + "description": "The URL of the service account, container, or blob that is the targe of the desired operation.", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true + }, + "ApiVersionParameter": { + "name": "x-ms-version", + "x-ms-client-name": "version", + "in": "header", + "required": true, + "type": "string", + "description": "Specifies the version of the operation to use for this request.", + "enum": [ + "2019-02-02" + ] + }, + "Blob": { + "name": "blob", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9]+(?:/[a-zA-Z0-9]+)*(?:\\.[a-zA-Z0-9]+){0,1}$", + "minLength": 1, + "maxLength": 1024, + "x-ms-parameter-location": "method", + "description": "The blob name." + }, + "Filesystem": { + "name": "filesystem", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The filesystem name." + }, + "Path": { + "name": "path", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The namespace path to a file or directory." + }, + "BlobCacheControl": { + "name": "x-ms-blob-cache-control", + "x-ms-client-name": "blobCacheControl", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. Sets the blob's cache control. If specified, this property is stored with the blob and returned with a read request." + }, + "BlobConditionAppendPos": { + "name": "x-ms-blob-condition-appendpos", + "x-ms-client-name": "appendPosition", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "append-position-access-conditions" + }, + "description": "Optional conditional header, used only for the Append Block operation. A number indicating the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition Failed)." + }, + "BlobConditionMaxSize": { + "name": "x-ms-blob-condition-maxsize", + "x-ms-client-name": "maxSize", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "append-position-access-conditions" + }, + "description": "Optional conditional header. The max length in bytes permitted for the append blob. If the Append Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 - Precondition Failed)." + }, + "BlobPublicAccess": { + "name": "x-ms-blob-public-access", + "x-ms-client-name": "access", + "in": "header", + "required": false, + "x-ms-parameter-location": "method", + "description": "Specifies whether data in the container may be accessed publicly and the level of access", + "type": "string", + "enum": [ + "container", + "blob" + ], + "x-ms-enum": { + "name": "PublicAccessType", + "modelAsString": true + } + }, + "AccessTierRequired": { + "name": "x-ms-access-tier", + "x-ms-client-name": "tier", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "P4", + "P6", + "P10", + "P20", + "P30", + "P40", + "P50", + "Hot", + "Cool", + "Archive" + ], + "x-ms-enum": { + "name": "AccessTier", + "modelAsString": true + }, + "x-ms-parameter-location": "method", + "description": "Indicates the tier to be set on the blob." + }, + "AccessTierOptional": { + "name": "x-ms-access-tier", + "x-ms-client-name": "tier", + "in": "header", + "required": false, + "type": "string", + "enum": [ + "Hot", + "Cool", + "Archive" + ], + "x-ms-enum": { + "name": "AccessTier", + "modelAsString": true + }, + "x-ms-parameter-location": "method", + "description": "Optional. Indicates the tier to be set on the blob." + }, + "RehydratePriority": { + "name": "x-ms-rehydrate-priority", + "x-ms-client-name": "rehydratePriority", + "in": "header", + "required": false, + "type": "string", + "enum": [ + "High", + "Standard" + ], + "x-ms-enum": { + "name": "RehydratePriority", + "modelAsString": true + }, + "x-ms-parameter-location": "method", + "description": "Optional: Indicates the priority with which to rehydrate an archived blob." + }, + "BlobContentDisposition": { + "name": "x-ms-blob-content-disposition", + "x-ms-client-name": "blobContentDisposition", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. Sets the blob's Content-Disposition header." + }, + "BlobContentEncoding": { + "name": "x-ms-blob-content-encoding", + "x-ms-client-name": "blobContentEncoding", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. Sets the blob's content encoding. If specified, this property is stored with the blob and returned with a read request." + }, + "BlobContentLanguage": { + "name": "x-ms-blob-content-language", + "x-ms-client-name": "blobContentLanguage", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. Set the blob's content language. If specified, this property is stored with the blob and returned with a read request." + }, + "BlobContentLengthOptional": { + "name": "x-ms-blob-content-length", + "x-ms-client-name": "blobContentLength", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "description": "This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned to a 512-byte boundary." + }, + "BlobContentLengthRequired": { + "name": "x-ms-blob-content-length", + "x-ms-client-name": "blobContentLength", + "in": "header", + "required": true, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "description": "This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned to a 512-byte boundary." + }, + "BlobContentMD5": { + "name": "x-ms-blob-content-md5", + "x-ms-client-name": "blobContentMD5", + "in": "header", + "required": false, + "type": "string", + "format": "byte", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. An MD5 hash of the blob content. Note that this hash is not validated, as the hashes for the individual blocks were validated when each was uploaded." + }, + "BlobContentType": { + "name": "x-ms-blob-content-type", + "x-ms-client-name": "blobContentType", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. Sets the blob's content type. If specified, this property is stored with the blob and returned with a read request." + }, + "BlobSequenceNumber": { + "name": "x-ms-blob-sequence-number", + "x-ms-client-name": "blobSequenceNumber", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "default": 0, + "x-ms-parameter-location": "method", + "description": "Set for page blobs only. The sequence number is a user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 2^63 - 1." + }, + "BlobTagsBody": { + "name": "Tags", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BlobTags" + }, + "x-ms-parameter-location": "method" + }, + "BlobTagsHeader": { + "name": "x-ms-tags", + "x-ms-client-name": "tags", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Optional. A URL encoded query param string which specifies the tags to be created with the Blob object. e.g. TagName1=TagValue1&TagName2=TagValue2. The x-ms-tags header may contain up to 2kb of tags." + }, + "BlobTagFilter": { + "name": "filter", + "in": "query", + "required": true, + "type": "string", + "x-m-parameter-location": "method", + "description": "The filter parameter enables the caller to query blobs whose tags match a given expression. The given expression must evaluate to true for a blob to be returned in the results." + }, + "BlockId": { + "name": "blockid", + "x-ms-client-name": "blockId", + "in": "query", + "type": "string", + "required": true, + "x-ms-parameter-location": "method", + "description": "A valid Base64 string value that identifies the block. Prior to encoding, the string must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter must be the same size for each block." + }, + "BlockListType": { + "name": "blocklisttype", + "x-ms-client-name": "listType", + "in": "query", + "required": true, + "default": "committed", + "x-ms-parameter-location": "method", + "description": "Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both lists together.", + "type": "string", + "enum": [ + "committed", + "uncommitted", + "all" + ], + "x-ms-enum": { + "name": "BlockListType", + "modelAsString": false + } + }, + "Body": { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "format": "file" + }, + "x-ms-parameter-location": "method", + "description": "Initial data" + }, + "Continuation": { + "name": "continuation", + "x-ms-client-name": "marker", + "in": "query", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "When renaming a directory, the number of paths that are renamed with each invocation is limited. If the number of paths to be renamed exceeds this limit, a continuation token is returned in this response header. When a continuation token is returned in the response, it must be specified in a subsequent invocation of the rename operation to continue renaming the directory." + }, + "ContainerAcl": { + "name": "containerAcl", + "in": "body", + "schema": { + "$ref": "#/definitions/SignedIdentifiers" + }, + "x-ms-parameter-location": "method", + "description": "the acls for the container" + }, + "CopyId": { + "name": "copyid", + "x-ms-client-name": "copyId", + "in": "query", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The copy identifier provided in the x-ms-copy-id header of the original Copy Blob operation." + }, + "ClientRequestId": { + "name": "x-ms-client-request-id", + "x-ms-client-name": "requestId", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled." + }, + "ContainerName": { + "name": "containerName", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The container name." + }, + "ContentCrc64": { + "name": "x-ms-content-crc64", + "x-ms-client-name": "transactionalContentCrc64", + "in": "header", + "required": false, + "type": "string", + "format": "byte", + "x-ms-parameter-location": "method", + "description": "Specify the transactional crc64 for the body, to be validated by the service." + }, + "ContentLength": { + "name": "Content-Length", + "in": "header", + "required": true, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "description": "The length of the request." + }, + "ContentMD5": { + "name": "Content-MD5", + "x-ms-client-name": "transactionalContentMD5", + "in": "header", + "required": false, + "type": "string", + "format": "byte", + "x-ms-parameter-location": "method", + "description": "Specify the transactional md5 for the body, to be validated by the service." + }, + "CopySource": { + "name": "x-ms-copy-source", + "x-ms-client-name": "copySource", + "in": "header", + "required": true, + "type": "string", + "format": "url", + "x-ms-parameter-location": "method", + "description": "Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. The source blob must either be public or must be authenticated via a shared access signature." + }, + "DeleteSnapshots": { + "name": "x-ms-delete-snapshots", + "x-ms-client-name": "deleteSnapshots", + "description": "Required if the blob has associated snapshots. Specify one of the following two options: include: Delete the base blob and all of its snapshots. only: Delete only the blob's snapshots and not the blob itself", + "x-ms-parameter-location": "method", + "in": "header", + "required": false, + "type": "string", + "enum": [ + "include", + "only" + ], + "x-ms-enum": { + "name": "DeleteSnapshotsOptionType", + "modelAsString": false + } + }, + "Delimiter": { + "name": "delimiter", + "description": "When the request includes this parameter, the operation returns a BlobPrefix element in the response body that acts as a placeholder for all blobs whose names begin with the same substring up to the appearance of the delimiter character. The delimiter may be a single character or a string.", + "type": "string", + "x-ms-parameter-location": "method", + "in": "query", + "required": true + }, + "DirectoryProperties": { + "name": "x-ms-properties", + "description": "Optional. User-defined properties to be stored with the file or directory, in the format of a comma-separated list of name and value pairs \"n1=v1, n2=v2, ...\", where each value is base64 encoded.", + "x-ms-client-name": "directoryProperties", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "EncryptionKey": { + "name": "x-ms-encryption-key", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method", + "description": "Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services." + }, + "EncryptionScope": { + "name": "x-ms-encryption-scope", + "type": "string", + "in": "query", + "required": false, + "x-ms-client-name": "EncryptionScope", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "customer-provided-key-info" + }, + "description": "Optional. Specifies the encryption scope to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services." + }, + "EncryptionKeySha256": { + "name": "x-ms-encryption-key-sha256", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method", + "description": "The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided." + }, + "EncryptionAlgorithm": { + "name": "x-ms-encryption-algorithm", + "type": "string", + "in": "query", + "required": false, + "enum": [ + "AES256" + ], + "x-ms-enum": { + "name": "EncryptionAlgorithmType", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "The algorithm used to produce the encryption key hash. Currently, the only accepted value is \"AES256\". Must be provided if the x-ms-encryption-key header is provided." + }, + "DefaultEncryptionScope": { + "name": "x-ms-default-encryption-scope", + "type": "string", + "in": "header", + "required": false, + "x-ms-client-name": "DefaultEncryptionScope", + "x-ms-parameter-location": "method", + "description": "Optional. Specifies the default encryption scope on the container. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services." + }, + "DenyEncryptionScopeOverride": { + "name": "x-ms-deny-encryption-scope-override", + "type": "boolean", + "in": "header", + "required": false, + "x-ms-client-name": "DenyEncryptionScopeOverride", + "x-ms-parameter-location": "method", + "description": "Optional. Specifies whether to deny encryption scope override provided in the request or not. If true, reject the request with encryption scope. If false, encryption is performed using encryption scope provided in the request. For more information, see Encryption at Rest for Azure Storage Services." + }, + "FileRenameSource": { + "name": "x-ms-rename-source", + "x-ms-client-name": "renameSource", + "in": "header", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The file or directory to be renamed. The value must have the following format: \"/{filesysystem}/{path}\". If \"x-ms-properties\" is specified, the properties will overwrite the existing properties; otherwise, the existing properties will be preserved." + }, + "GetRangeContentMD5": { + "name": "x-ms-range-get-content-md5", + "x-ms-client-name": "rangeGetContentMD5", + "in": "header", + "required": false, + "type": "boolean", + "x-ms-parameter-location": "method", + "description": "When set to true and specified together with the Range, the service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size." + }, + "GetRangeContentCRC64": { + "name": "x-ms-range-get-content-crc64", + "x-ms-client-name": "rangeGetContentCRC64", + "in": "header", + "required": false, + "type": "boolean", + "x-ms-parameter-location": "method", + "description": "When set to true and specified together with the Range, the service returns the CRC64 hash for the range, as long as the range is less than or equal to 4 MB in size." + }, + "IfMatch": { + "name": "If-Match", + "x-ms-client-name": "ifMatch", + "in": "header", + "required": false, + "type": "string", + "format": "etag", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "modified-access-conditions" + }, + "description": "Specify an ETag value to operate only on blobs with a matching value." + }, + "IfModifiedSince": { + "name": "If-Modified-Since", + "x-ms-client-name": "ifModifiedSince", + "in": "header", + "required": false, + "type": "string", + "format": "date-time-rfc1123", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "modified-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has been modified since the specified date/time." + }, + "IfNoneMatch": { + "name": "If-None-Match", + "x-ms-client-name": "ifNoneMatch", + "in": "header", + "required": false, + "type": "string", + "format": "etag", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "modified-access-conditions" + }, + "description": "Specify an ETag value to operate only on blobs without a matching value." + }, + "IfUnmodifiedSince": { + "name": "If-Unmodified-Since", + "x-ms-client-name": "ifUnmodifiedSince", + "in": "header", + "required": false, + "type": "string", + "format": "date-time-rfc1123", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "modified-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has not been modified since the specified date/time." + }, + "IfSequenceNumberEqualTo": { + "name": "x-ms-if-sequence-number-eq", + "x-ms-client-name": "ifSequenceNumberEqualTo", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "sequence-number-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has the specified sequence number." + }, + "IfSequenceNumberLessThan": { + "name": "x-ms-if-sequence-number-lt", + "x-ms-client-name": "ifSequenceNumberLessThan", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "sequence-number-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has a sequence number less than the specified." + }, + "IfSequenceNumberLessThanOrEqualTo": { + "name": "x-ms-if-sequence-number-le", + "x-ms-client-name": "ifSequenceNumberLessThanOrEqualTo", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "sequence-number-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has a sequence number less than or equal to the specified." + }, + "KeyInfo": { + "name": "KeyInfo", + "in": "body", + "x-ms-parameter-location": "method", + "required": true, + "schema": { + "$ref": "#/definitions/KeyInfo" + } + }, + "ListBlobsInclude": { + "name": "include", + "in": "query", + "required": false, + "type": "array", + "collectionFormat": "csv", + "items": { + "type": "string", + "enum": [ + "copy", + "deleted", + "metadata", + "snapshots", + "tags", + "uncommittedblobs" + ], + "x-ms-enum": { + "name": "ListBlobsIncludeItem", + "modelAsString": false + } + }, + "x-ms-parameter-location": "method", + "description": "Include this parameter to specify one or more datasets to include in the response." + }, + "ListContainersInclude": { + "name": "include", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "metadata" + ], + "x-ms-enum": { + "name": "ListContainersIncludeType", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Include this parameter to specify that the container's metadata be returned as part of the response body." + }, + "LeaseBreakPeriod": { + "name": "x-ms-lease-break-period", + "x-ms-client-name": "breakPeriod", + "in": "header", + "required": false, + "type": "integer", + "x-ms-parameter-location": "method", + "description": "For a break operation, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. If longer, the time remaining on the lease is used. A new lease will not be available before the break period has expired, but the lease may be held for longer than the break period. If this header does not appear with a break operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks immediately." + }, + "LeaseDuration": { + "name": "x-ms-lease-duration", + "x-ms-client-name": "duration", + "in": "header", + "required": false, + "type": "integer", + "x-ms-parameter-location": "method", + "description": "Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or change." + }, + "LeaseIdOptional": { + "name": "x-ms-lease-id", + "x-ms-client-name": "leaseId", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "lease-access-conditions" + }, + "description": "If specified, the operation only succeeds if the resource's lease is active and matches this ID." + }, + "LeaseIdRequired": { + "name": "x-ms-lease-id", + "x-ms-client-name": "leaseId", + "in": "header", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Specifies the current lease ID on the resource." + }, + "Marker": { + "name": "marker", + "in": "query", + "required": false, + "type": "string", + "description": "A string value that identifies the portion of the list of containers to be returned with the next listing operation. The operation returns the NextMarker value within the response body if the listing operation did not return all containers remaining to be listed with the current page. The NextMarker value can be used as the value for the marker parameter in a subsequent call to request the next page of list items. The marker value is opaque to the client.", + "x-ms-parameter-location": "method" + }, + "MaxResults": { + "name": "maxresults", + "in": "query", + "required": false, + "type": "integer", + "minimum": 1, + "x-ms-parameter-location": "method", + "description": "Specifies the maximum number of containers to return. If the request does not specify maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the listing operation crosses a partition boundary, then the service will return a continuation token for retrieving the remainder of the results. For this reason, it is possible that the service will return fewer results than specified by maxresults, or than the default of 5000." + }, + "Metadata": { + "name": "x-ms-meta", + "x-ms-client-name": "metadata", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information.", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "PathRenameMode": { + "name": "mode", + "x-ms-client-name": "pathRenameMode", + "description": "Determines the behavior of the rename operation", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "legacy", + "posix" + ], + "x-ms-enum": { + "name": "PathRenameMode", + "modelAsString": false + } + }, + "PosixPermissions": { + "name": "x-ms-permissions", + "description": "Optional and only valid if Hierarchical Namespace is enabled for the account. Sets POSIX access permissions for the file owner, the file owning group, and others. Each class may be granted read, write, or execute permission. The sticky bit is also supported. Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are supported.", + "x-ms-client-name": "posixPermissions", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "PosixUmask": { + "name": "x-ms-umask", + "x-ms-client-name": "posixUmask", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Only valid if Hierarchical Namespace is enabled for the account. This umask restricts permission settings for file and directory, and will only be applied when default Acl does not exist in parent directory. If the umask bit has set, it means that the corresponding permission will be disabled. Otherwise the corresponding permission will be determined by the permission. A 4-digit octal notation (e.g. 0022) is supported here. If no umask was specified, a default umask - 0027 will be used." + }, + "Prefix": { + "name": "prefix", + "in": "query", + "required": false, + "type": "string", + "description": "Filters the results to return only containers whose name begins with the specified prefix.", + "x-ms-parameter-location": "method" + }, + "PrevSnapshot": { + "name": "prevsnapshot", + "in": "query", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Optional in version 2015-07-08 and newer. The prevsnapshot parameter is a DateTime value that specifies that the response will contain only pages that were changed between target blob and previous snapshot. Changed pages include both updated and cleared pages. The target blob may be a snapshot, as long as the snapshot specified by prevsnapshot is the older of the two. Note that incremental snapshots are currently supported only for blobs created on or after January 1, 2016." + }, + "ProposedLeaseIdOptional": { + "name": "x-ms-proposed-lease-id", + "x-ms-client-name": "proposedLeaseId", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID string formats." + }, + "ProposedLeaseIdRequired": { + "name": "x-ms-proposed-lease-id", + "x-ms-client-name": "proposedLeaseId", + "in": "header", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID string formats." + }, + "Range": { + "name": "x-ms-range", + "x-ms-client-name": "range", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Return only the bytes of the blob in the specified range." + }, + "RecursiveDirectoryDelete": { + "name": "recursive", + "x-ms-client-name": "recursiveDirectoryDelete", + "in": "query", + "required": true, + "type": "boolean", + "x-ms-parameter-location": "method", + "description": "If \"true\", all paths beneath the directory will be deleted. If \"false\" and the directory is non-empty, an error occurs." + }, + "SequenceNumberAction": { + "name": "x-ms-sequence-number-action", + "x-ms-client-name": "sequenceNumberAction", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Required if the x-ms-blob-sequence-number header is set for the request. This property applies to page blobs only. This property indicates how the service should modify the blob's sequence number", + "type": "string", + "enum": [ + "max", + "update", + "increment" + ], + "x-ms-enum": { + "name": "SequenceNumberActionType", + "modelAsString": false + } + }, + "Snapshot": { + "name": "snapshot", + "in": "query", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more information on working with blob snapshots, see Creating a Snapshot of a Blob." + }, + "SourceContentMD5": { + "name": "x-ms-source-content-md5", + "x-ms-client-name": "sourceContentMD5", + "in": "header", + "required": false, + "type": "string", + "format": "byte", + "x-ms-parameter-location": "method", + "description": "Specify the md5 calculated for the range of bytes that must be read from the copy source." + }, + "SourceContentCRC64": { + "name": "x-ms-source-content-crc64", + "x-ms-client-name": "sourceContentcrc64", + "in": "header", + "required": false, + "type": "string", + "format": "byte", + "x-ms-parameter-location": "method", + "description": "Specify the crc64 calculated for the range of bytes that must be read from the copy source." + }, + "SourceRange": { + "name": "x-ms-source-range", + "x-ms-client-name": "sourceRange", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Bytes of source data in the specified range." + }, + "RangeRequiredPutPageFromUrl": { + "name": "x-ms-range", + "x-ms-client-name": "range", + "in": "header", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The range of bytes to which the source range would be written. The range should be 512 aligned and range-end is required." + }, + "SourceRangeRequiredPutPageFromUrl": { + "name": "x-ms-source-range", + "x-ms-client-name": "sourceRange", + "in": "header", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Bytes of source data in the specified range. The length of this range should match the ContentLength header and x-ms-range/Range destination range header." + }, + "SourceIfMatch": { + "name": "x-ms-source-if-match", + "x-ms-client-name": "sourceIfMatch", + "in": "header", + "required": false, + "type": "string", + "format": "etag", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "source-modified-access-conditions" + }, + "description": "Specify an ETag value to operate only on blobs with a matching value." + }, + "SourceIfModifiedSince": { + "name": "x-ms-source-if-modified-since", + "x-ms-client-name": "sourceIfModifiedSince", + "in": "header", + "required": false, + "type": "string", + "format": "date-time-rfc1123", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "source-modified-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has been modified since the specified date/time." + }, + "SourceIfNoneMatch": { + "name": "x-ms-source-if-none-match", + "x-ms-client-name": "sourceIfNoneMatch", + "in": "header", + "required": false, + "type": "string", + "format": "etag", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "source-modified-access-conditions" + }, + "description": "Specify an ETag value to operate only on blobs without a matching value." + }, + "SourceIfUnmodifiedSince": { + "name": "x-ms-source-if-unmodified-since", + "x-ms-client-name": "sourceIfUnmodifiedSince", + "in": "header", + "required": false, + "type": "string", + "format": "date-time-rfc1123", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "source-modified-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has not been modified since the specified date/time." + }, + "SourceLeaseId": { + "name": "x-ms-source-lease-id", + "x-ms-client-name": "sourceLeaseId", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "A lease ID for the source path. If specified, the source path must have an active lease and the leaase ID must match." + }, + "SourceUrl": { + "name": "x-ms-copy-source", + "x-ms-client-name": "sourceUrl", + "in": "header", + "required": true, + "type": "string", + "format": "url", + "x-ms-parameter-location": "method", + "description": "Specify a URL to the copy source." + }, + "StorageServiceProperties": { + "name": "StorageServiceProperties", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/StorageServiceProperties" + }, + "x-ms-parameter-location": "method", + "description": "The StorageService properties." + }, + "Timeout": { + "name": "timeout", + "in": "query", + "required": false, + "type": "integer", + "minimum": 0, + "x-ms-parameter-location": "method", + "description": "The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations." + }, + "VersionId": { + "name": "versionid", + "x-ms-client-name": "versionId", + "in": "query", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The version ID parameter is an opaque DateTime value that, when present, specifies the blob version to retrieve." + }, + "XMsCacheControl": { + "name": "x-ms-cache-control", + "x-ms-client-name": "cacheControl", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "directory-http-headers" + }, + "description": "Cache control for given resource" + }, + "XMsContentType": { + "name": "x-ms-content-type", + "x-ms-client-name": "contentType", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "directory-http-headers" + }, + "description": "Content type for given resource" + }, + "XMsContentEncoding": { + "name": "x-ms-content-encoding", + "x-ms-client-name": "contentEncoding", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "directory-http-headers" + }, + "description": "Content encoding for given resource" + }, + "XMsContentLanguage": { + "name": "x-ms-content-language", + "x-ms-client-name": "contentLanguage", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "directory-http-headers" + }, + "description": "Content language for given resource" + }, + "XMsContentDisposition": { + "name": "x-ms-content-disposition", + "x-ms-client-name": "contentDisposition", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "directory-http-headers" + }, + "description": "Content disposition for given resource" + } + } +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/swagger/blob.json b/sdk/storage/azure-storage-blob/swagger/blob.json deleted file mode 100644 index 0bf6a308f327..000000000000 --- a/sdk/storage/azure-storage-blob/swagger/blob.json +++ /dev/null @@ -1,8647 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Azure Blob Storage", - "version": "2018-11-09", - "x-ms-code-generation-settings": { - "header": "MIT", - "strictSpecAdherence": false - } - }, - "x-ms-parameterized-host": { - "hostTemplate": "{url}", - "useSchemePrefix": false, - "positionInOperation": "first", - "parameters": [ - { - "$ref": "#/parameters/Url" - } - ] - }, - "securityDefinitions": { - "blob_shared_key": { - "type": "apiKey", - "name": "Authorization", - "in": "header" - } - }, - "schemes": [ - "https" - ], - "consumes": [ - "application/xml" - ], - "produces": [ - "application/xml" - ], - "paths": {}, - "x-ms-paths": { - "/?restype=service&comp=properties": { - "put": { - "tags": [ - "service" - ], - "operationId": "Service_SetProperties", - "description": "Sets properties for a storage account's Blob service endpoint, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules", - "parameters": [ - { - "$ref": "#/parameters/StorageServiceProperties" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "202": { - "description": "Success (Accepted)", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "get": { - "tags": [ - "service" - ], - "operationId": "Service_GetProperties", - "description": "gets the properties of a storage account's Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.", - "parameters": [ - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "Success.", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - } - }, - "schema": { - "$ref": "#/definitions/StorageServiceProperties" - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "restype", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "service" - ] - }, - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "properties" - ] - } - ] - }, - "/?restype=service&comp=stats": { - "get": { - "tags": [ - "service" - ], - "operationId": "Service_GetStatistics", - "description": "Retrieves statistics related to replication for the Blob service. It is only available on the secondary location endpoint when read-access geo-redundant replication is enabled for the storage account.", - "parameters": [ - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "Success.", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - }, - "schema": { - "$ref": "#/definitions/StorageServiceStats" - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "restype", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "service" - ] - }, - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "stats" - ] - } - ] - }, - "/?comp=list": { - "get": { - "tags": [ - "service" - ], - "operationId": "Service_ListContainersSegment", - "description": "The List Containers Segment operation returns a list of the containers under the specified account", - "parameters": [ - { - "$ref": "#/parameters/Prefix" - }, - { - "$ref": "#/parameters/Marker" - }, - { - "$ref": "#/parameters/MaxResults" - }, - { - "$ref": "#/parameters/ListContainersInclude" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "Success.", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - } - }, - "schema": { - "$ref": "#/definitions/ListContainersSegmentResponse" - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "NextMarker" - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "list" - ] - } - ] - }, - "/?restype=service&comp=userdelegationkey": { - "post": { - "tags": [ - "service" - ], - "operationId": "Service_GetUserDelegationKey", - "description": "Retrieves a user delgation key for the Blob service. This is only a valid operation when using bearer token authentication.", - "parameters": [ - { - "$ref": "#/parameters/KeyInfo" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "Success.", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - }, - "schema": { - "$ref": "#/definitions/UserDelegationKey" - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "restype", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "service" - ] - }, - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "userdelegationkey" - ] - } - ] - }, - "/?restype=account&comp=properties": { - "get": { - "tags": [ - "service" - ], - "operationId": "Service_GetAccountInfo", - "description": "Returns the sku name and account kind ", - "parameters": [ - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "Success (OK)", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "x-ms-sku-name": { - "x-ms-client-name": "SkuName", - "type": "string", - "enum": [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ], - "x-ms-enum": { - "name": "SkuName", - "modelAsString": false - }, - "description": "Identifies the sku name of the account" - }, - "x-ms-account-kind": { - "x-ms-client-name": "AccountKind", - "type": "string", - "enum": [ - "Storage", - "BlobStorage", - "StorageV2" - ], - "x-ms-enum": { - "name": "AccountKind", - "modelAsString": false - }, - "description": "Identifies the account kind" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "restype", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "account" - ] - }, - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "properties" - ] - } - ] - }, - "/{containerName}?restype=container": { - "put": { - "tags": [ - "container" - ], - "operationId": "Container_Create", - "description": "creates a new container under the specified account. If the container with the same name already exists, the operation fails", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/Metadata" - }, - { - "$ref": "#/parameters/BlobPublicAccess" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "201": { - "description": "Success, Container created.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "get": { - "tags": [ - "container" - ], - "operationId": "Container_GetProperties", - "description": "returns all user-defined metadata and system properties for the specified container. The data returned does not include the container's list of blobs", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "Success", - "headers": { - "x-ms-meta": { - "type": "string", - "x-ms-client-name": "Metadata", - "x-ms-header-collection-prefix": "x-ms-meta-" - }, - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-lease-duration": { - "x-ms-client-name": "LeaseDuration", - "description": "When a blob is leased, specifies whether the lease is of infinite or fixed duration.", - "type": "string", - "enum": [ - "infinite", - "fixed" - ], - "x-ms-enum": { - "name": "LeaseDurationType", - "modelAsString": false - } - }, - "x-ms-lease-state": { - "x-ms-client-name": "LeaseState", - "description": "Lease state of the blob.", - "type": "string", - "enum": [ - "available", - "leased", - "expired", - "breaking", - "broken" - ], - "x-ms-enum": { - "name": "LeaseStateType", - "modelAsString": false - } - }, - "x-ms-lease-status": { - "x-ms-client-name": "LeaseStatus", - "description": "The current lease status of the blob.", - "type": "string", - "enum": [ - "locked", - "unlocked" - ], - "x-ms-enum": { - "name": "LeaseStatusType", - "modelAsString": false - } - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "x-ms-blob-public-access": { - "x-ms-client-name": "BlobPublicAccess", - "description": "Indicated whether data in the container may be accessed publicly and the level of access", - "type": "string", - "enum": [ - "container", - "blob" - ], - "x-ms-enum": { - "name": "PublicAccessType", - "modelAsString": true - } - }, - "x-ms-has-immutability-policy": { - "x-ms-client-name": "HasImmutabilityPolicy", - "description": "Indicates whether the container has an immutability policy set on it.", - "type": "boolean" - }, - "x-ms-has-legal-hold": { - "x-ms-client-name": "HasLegalHold", - "description": "Indicates whether the container has a legal hold.", - "type": "boolean" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "delete": { - "tags": [ - "container" - ], - "operationId": "Container_Delete", - "description": "operation marks the specified container for deletion. The container and any blobs contained within it are later deleted during garbage collection", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "202": { - "description": "Accepted", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "restype", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "container" - ] - } - ] - }, - "/{containerName}?restype=container&comp=metadata": { - "put": { - "tags": [ - "container" - ], - "operationId": "Container_SetMetadata", - "description": "operation sets one or more user-defined name-value pairs for the specified container.", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/Metadata" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "restype", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "container" - ] - }, - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "metadata" - ] - } - ] - }, - "/{containerName}?restype=container&comp=acl": { - "get": { - "tags": [ - "container" - ], - "operationId": "Container_GetAccessPolicy", - "description": "gets the permissions for the specified container. The permissions indicate whether container data may be accessed publicly.", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "Success", - "headers": { - "x-ms-blob-public-access": { - "x-ms-client-name": "BlobPublicAccess", - "description": "Indicated whether data in the container may be accessed publicly and the level of access", - "type": "string", - "enum": [ - "container", - "blob" - ], - "x-ms-enum": { - "name": "PublicAccessType", - "modelAsString": true - } - }, - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - }, - "schema": { - "$ref": "#/definitions/SignedIdentifiers" - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "put": { - "tags": [ - "container" - ], - "operationId": "Container_SetAccessPolicy", - "description": "sets the permissions for the specified container. The permissions indicate whether blobs in a container may be accessed publicly.", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/ContainerAcl" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/BlobPublicAccess" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "Success.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "restype", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "container" - ] - }, - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "acl" - ] - } - ] - }, - "/{containerName}?comp=lease&restype=container&acquire": { - "put": { - "tags": [ - "container" - ], - "operationId": "Container_AcquireLease", - "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseDuration" - }, - { - "$ref": "#/parameters/ProposedLeaseIdOptional" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "201": { - "description": "The Acquire operation completed successfully.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-lease-id": { - "x-ms-client-name": "LeaseId", - "type": "string", - "description": "Uniquely identifies a container's lease" - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "lease" - ] - }, - { - "name": "restype", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "container" - ] - }, - { - "name": "x-ms-lease-action", - "x-ms-client-name": "action", - "in": "header", - "required": true, - "type": "string", - "enum": [ - "acquire" - ], - "x-ms-enum": { - "name": "LeaseAction", - "modelAsString": false - }, - "x-ms-parameter-location": "method", - "description": "Describes what lease action to take." - } - ] - }, - "/{containerName}?comp=lease&restype=container&release": { - "put": { - "tags": [ - "container" - ], - "operationId": "Container_ReleaseLease", - "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseIdRequired" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "The Release operation completed successfully.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "lease" - ] - }, - { - "name": "restype", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "container" - ] - }, - { - "name": "x-ms-lease-action", - "x-ms-client-name": "action", - "in": "header", - "required": true, - "type": "string", - "enum": [ - "release" - ], - "x-ms-enum": { - "name": "LeaseAction", - "modelAsString": false - }, - "x-ms-parameter-location": "method", - "description": "Describes what lease action to take." - } - ] - }, - "/{containerName}?comp=lease&restype=container&renew": { - "put": { - "tags": [ - "container" - ], - "operationId": "Container_RenewLease", - "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseIdRequired" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "The Renew operation completed successfully.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-lease-id": { - "x-ms-client-name": "LeaseId", - "type": "string", - "description": "Uniquely identifies a container's lease" - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "lease" - ] - }, - { - "name": "restype", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "container" - ] - }, - { - "name": "x-ms-lease-action", - "x-ms-client-name": "action", - "in": "header", - "required": true, - "type": "string", - "enum": [ - "renew" - ], - "x-ms-enum": { - "name": "LeaseAction", - "modelAsString": false - }, - "x-ms-parameter-location": "method", - "description": "Describes what lease action to take." - } - ] - }, - "/{containerName}?comp=lease&restype=container&break": { - "put": { - "tags": [ - "container" - ], - "operationId": "Container_BreakLease", - "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseBreakPeriod" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "202": { - "description": "The Break operation completed successfully.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-lease-time": { - "x-ms-client-name": "LeaseTime", - "type": "integer", - "description": "Approximate time remaining in the lease period, in seconds." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "lease" - ] - }, - { - "name": "restype", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "container" - ] - }, - { - "name": "x-ms-lease-action", - "x-ms-client-name": "action", - "in": "header", - "required": true, - "type": "string", - "enum": [ - "break" - ], - "x-ms-enum": { - "name": "LeaseAction", - "modelAsString": false - }, - "x-ms-parameter-location": "method", - "description": "Describes what lease action to take." - } - ] - }, - "/{containerName}?comp=lease&restype=container&change": { - "put": { - "tags": [ - "container" - ], - "operationId": "Container_ChangeLease", - "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseIdRequired" - }, - { - "$ref": "#/parameters/ProposedLeaseIdRequired" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "The Change operation completed successfully.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-lease-id": { - "x-ms-client-name": "LeaseId", - "type": "string", - "description": "Uniquely identifies a container's lease" - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "lease" - ] - }, - { - "name": "restype", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "container" - ] - }, - { - "name": "x-ms-lease-action", - "x-ms-client-name": "action", - "in": "header", - "required": true, - "type": "string", - "enum": [ - "change" - ], - "x-ms-enum": { - "name": "LeaseAction", - "modelAsString": false - }, - "x-ms-parameter-location": "method", - "description": "Describes what lease action to take." - } - ] - }, - "/{containerName}?restype=container&comp=list&flat": { - "get": { - "tags": [ - "containers" - ], - "operationId": "Container_ListBlobFlatSegment", - "description": "[Update] The List Blobs operation returns a list of the blobs under the specified container", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Prefix" - }, - { - "$ref": "#/parameters/Marker" - }, - { - "$ref": "#/parameters/MaxResults" - }, - { - "$ref": "#/parameters/ListBlobsInclude" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "Success.", - "headers": { - "Content-Type": { - "type": "string", - "description": "The media type of the body of the response. For List Blobs this is 'application/xml'" - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - }, - "schema": { - "$ref": "#/definitions/ListBlobsFlatSegmentResponse" - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "NextMarker" - } - }, - "parameters": [ - { - "name": "restype", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "container" - ] - }, - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "list" - ] - } - ] - }, - "/{containerName}?restype=container&comp=list&hierarchy": { - "get": { - "tags": [ - "containers" - ], - "operationId": "Container_ListBlobHierarchySegment", - "description": "[Update] The List Blobs operation returns a list of the blobs under the specified container", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Prefix" - }, - { - "$ref": "#/parameters/Delimiter" - }, - { - "$ref": "#/parameters/Marker" - }, - { - "$ref": "#/parameters/MaxResults" - }, - { - "$ref": "#/parameters/ListBlobsInclude" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "Success.", - "headers": { - "Content-Type": { - "type": "string", - "description": "The media type of the body of the response. For List Blobs this is 'application/xml'" - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - }, - "schema": { - "$ref": "#/definitions/ListBlobsHierarchySegmentResponse" - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "NextMarker" - } - }, - "parameters": [ - { - "name": "restype", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "container" - ] - }, - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "list" - ] - } - ] - }, - "/{containerName}?restype=account&comp=properties": { - "get": { - "tags": [ - "container" - ], - "operationId": "Container_GetAccountInfo", - "description": "Returns the sku name and account kind ", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "Success (OK)", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "x-ms-sku-name": { - "x-ms-client-name": "SkuName", - "type": "string", - "enum": [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ], - "x-ms-enum": { - "name": "SkuName", - "modelAsString": false - }, - "description": "Identifies the sku name of the account" - }, - "x-ms-account-kind": { - "x-ms-client-name": "AccountKind", - "type": "string", - "enum": [ - "Storage", - "BlobStorage", - "StorageV2" - ], - "x-ms-enum": { - "name": "AccountKind", - "modelAsString": false - }, - "description": "Identifies the account kind" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "restype", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "account" - ] - }, - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "properties" - ] - } - ] - }, - "/{containerName}/{blob}": { - "get": { - "tags": [ - "blob" - ], - "operationId": "Blob_Download", - "description": "The Download operation reads or downloads a blob from the system, including its metadata and properties. You can also call Download to read a snapshot or verison.", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Snapshot" - }, - { - "$ref": "#/parameters/VersionId" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/Range" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/GetRangeContentMD5" - }, - { - "$ref": "#/parameters/EncryptionKey" - }, - { - "$ref": "#/parameters/EncryptionKeySha256" - }, - { - "$ref": "#/parameters/EncryptionAlgorithm" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "Returns the content of the entire blob.", - "headers": { - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-meta": { - "type": "string", - "x-ms-client-name": "Metadata", - "x-ms-header-collection-prefix": "x-ms-meta-" - }, - "Content-Length": { - "type": "integer", - "format": "int64", - "description": "The number of bytes present in the response body." - }, - "Content-Type": { - "type": "string", - "description": "The media type of the body of the response. For Download Blob this is 'application/octet-stream'" - }, - "Content-Range": { - "type": "string", - "description": "Indicates the range of bytes returned in the event that the client requested a subset of the blob by setting the 'Range' request header." - }, - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Content-MD5": { - "type": "string", - "format": "byte", - "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." - }, - "Content-Encoding": { - "type": "string", - "description": "This header returns the value that was specified for the Content-Encoding request header" - }, - "Cache-Control": { - "type": "string", - "description": "This header is returned if it was previously specified for the blob." - }, - "Content-Disposition": { - "type": "string", - "description": "This header returns the value that was specified for the 'x-ms-blob-content-disposition' header. The Content-Disposition response header field conveys additional information about how to process the response payload, and also can be used to attach additional metadata. For example, if set to attachment, it indicates that the user-agent should not display the response, but instead show a Save As dialog with a filename other than the blob name specified." - }, - "Content-Language": { - "type": "string", - "description": "This header returns the value that was specified for the Content-Language request header." - }, - "x-ms-blob-sequence-number": { - "x-ms-client-name": "BlobSequenceNumber", - "type": "integer", - "format": "int64", - "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" - }, - "x-ms-blob-type": { - "x-ms-client-name": "BlobType", - "description": "The blob's type.", - "type": "string", - "enum": [ - "BlockBlob", - "PageBlob", - "AppendBlob" - ], - "x-ms-enum": { - "name": "BlobType", - "modelAsString": false - } - }, - "x-ms-copy-completion-time": { - "x-ms-client-name": "CopyCompletionTime", - "type": "string", - "format": "date-time-rfc1123", - "description": "Conclusion time of the last attempted Copy Blob operation where this blob was the destination blob. This value can specify the time of a completed, aborted, or failed copy attempt. This header does not appear if a copy is pending, if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." - }, - "x-ms-copy-status-description": { - "x-ms-client-name": "CopyStatusDescription", - "type": "string", - "description": "Only appears when x-ms-copy-status is failed or pending. Describes the cause of the last fatal or non-fatal copy operation failure. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" - }, - "x-ms-copy-id": { - "x-ms-client-name": "CopyId", - "type": "string", - "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." - }, - "x-ms-copy-progress": { - "x-ms-client-name": "CopyProgress", - "type": "string", - "description": "Contains the number of bytes copied and the total bytes in the source in the last attempted Copy Blob operation where this blob was the destination blob. Can show between 0 and Content-Length bytes copied. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" - }, - "x-ms-copy-source": { - "x-ms-client-name": "CopySource", - "type": "string", - "description": "URL up to 2 KB in length that specifies the source blob or file used in the last attempted Copy Blob operation where this blob was the destination blob. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." - }, - "x-ms-copy-status": { - "x-ms-client-name": "CopyStatus", - "description": "State of the copy operation identified by x-ms-copy-id.", - "type": "string", - "enum": [ - "pending", - "success", - "aborted", - "failed" - ], - "x-ms-enum": { - "name": "CopyStatusType", - "modelAsString": false - } - }, - "x-ms-lease-duration": { - "x-ms-client-name": "LeaseDuration", - "description": "When a blob is leased, specifies whether the lease is of infinite or fixed duration.", - "type": "string", - "enum": [ - "infinite", - "fixed" - ], - "x-ms-enum": { - "name": "LeaseDurationType", - "modelAsString": false - } - }, - "x-ms-lease-state": { - "x-ms-client-name": "LeaseState", - "description": "Lease state of the blob.", - "type": "string", - "enum": [ - "available", - "leased", - "expired", - "breaking", - "broken" - ], - "x-ms-enum": { - "name": "LeaseStateType", - "modelAsString": false - } - }, - "x-ms-lease-status": { - "x-ms-client-name": "LeaseStatus", - "description": "The current lease status of the blob.", - "type": "string", - "enum": [ - "locked", - "unlocked" - ], - "x-ms-enum": { - "name": "LeaseStatusType", - "modelAsString": false - } - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Accept-Ranges": { - "type": "string", - "description": "Indicates that the service supports requests for partial blob content." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "x-ms-blob-committed-block-count": { - "x-ms-client-name": "BlobCommittedBlockCount", - "type": "integer", - "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." - }, - "x-ms-server-encrypted": { - "x-ms-client-name": "IsServerEncrypted", - "type": "boolean", - "description": "The value of this header is set to true if the blob data and application metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the blob is unencrypted, or if only parts of the blob/application metadata are encrypted)." - }, - "x-ms-encryption-key-sha256": { - "x-ms-client-name": "EncryptionKeySha256", - "type": "string", - "description": "The SHA-256 hash of the encryption key used to encrypt the blob. This header is only returned when the blob was encrypted with a customer-provided key." - }, - "x-ms-blob-content-md5": { - "x-ms-client-name": "BlobContentMD5", - "type": "string", - "format": "byte", - "description": "If the blob has a MD5 hash, and if request contains range header (Range or x-ms-range), this response header is returned with the value of the whole blob's MD5 value. This value may or may not be equal to the value returned in Content-MD5 header, with the latter calculated from the requested range" - } - }, - "schema": { - "type": "object", - "format": "file" - } - }, - "206": { - "description": "Returns the content of a specified range of the blob.", - "headers": { - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-meta": { - "type": "string", - "x-ms-client-name": "Metadata", - "x-ms-header-collection-prefix": "x-ms-meta-" - }, - "Content-Length": { - "type": "integer", - "format": "int64", - "description": "The number of bytes present in the response body." - }, - "Content-Type": { - "type": "string", - "description": "The media type of the body of the response. For Download Blob this is 'application/octet-stream'" - }, - "Content-Range": { - "type": "string", - "description": "Indicates the range of bytes returned in the event that the client requested a subset of the blob by setting the 'Range' request header." - }, - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Content-MD5": { - "type": "string", - "format": "byte", - "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." - }, - "Content-Encoding": { - "type": "string", - "description": "This header returns the value that was specified for the Content-Encoding request header" - }, - "Cache-Control": { - "type": "string", - "description": "This header is returned if it was previously specified for the blob." - }, - "Content-Disposition": { - "type": "string", - "description": "This header returns the value that was specified for the 'x-ms-blob-content-disposition' header. The Content-Disposition response header field conveys additional information about how to process the response payload, and also can be used to attach additional metadata. For example, if set to attachment, it indicates that the user-agent should not display the response, but instead show a Save As dialog with a filename other than the blob name specified." - }, - "Content-Language": { - "type": "string", - "description": "This header returns the value that was specified for the Content-Language request header." - }, - "x-ms-blob-sequence-number": { - "x-ms-client-name": "BlobSequenceNumber", - "type": "integer", - "format": "int64", - "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" - }, - "x-ms-blob-type": { - "x-ms-client-name": "BlobType", - "description": "The blob's type.", - "type": "string", - "enum": [ - "BlockBlob", - "PageBlob", - "AppendBlob" - ], - "x-ms-enum": { - "name": "BlobType", - "modelAsString": false - } - }, - "x-ms-copy-completion-time": { - "x-ms-client-name": "CopyCompletionTime", - "type": "string", - "format": "date-time-rfc1123", - "description": "Conclusion time of the last attempted Copy Blob operation where this blob was the destination blob. This value can specify the time of a completed, aborted, or failed copy attempt. This header does not appear if a copy is pending, if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." - }, - "x-ms-copy-status-description": { - "x-ms-client-name": "CopyStatusDescription", - "type": "string", - "description": "Only appears when x-ms-copy-status is failed or pending. Describes the cause of the last fatal or non-fatal copy operation failure. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" - }, - "x-ms-copy-id": { - "x-ms-client-name": "CopyId", - "type": "string", - "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." - }, - "x-ms-copy-progress": { - "x-ms-client-name": "CopyProgress", - "type": "string", - "description": "Contains the number of bytes copied and the total bytes in the source in the last attempted Copy Blob operation where this blob was the destination blob. Can show between 0 and Content-Length bytes copied. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" - }, - "x-ms-copy-source": { - "x-ms-client-name": "CopySource", - "type": "string", - "description": "URL up to 2 KB in length that specifies the source blob or file used in the last attempted Copy Blob operation where this blob was the destination blob. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." - }, - "x-ms-copy-status": { - "x-ms-client-name": "CopyStatus", - "description": "State of the copy operation identified by x-ms-copy-id.", - "type": "string", - "enum": [ - "pending", - "success", - "aborted", - "failed" - ], - "x-ms-enum": { - "name": "CopyStatusType", - "modelAsString": false - } - }, - "x-ms-lease-duration": { - "x-ms-client-name": "LeaseDuration", - "description": "When a blob is leased, specifies whether the lease is of infinite or fixed duration.", - "type": "string", - "enum": [ - "infinite", - "fixed" - ], - "x-ms-enum": { - "name": "LeaseDurationType", - "modelAsString": false - } - }, - "x-ms-lease-state": { - "x-ms-client-name": "LeaseState", - "description": "Lease state of the blob.", - "type": "string", - "enum": [ - "available", - "leased", - "expired", - "breaking", - "broken" - ], - "x-ms-enum": { - "name": "LeaseStateType", - "modelAsString": false - } - }, - "x-ms-lease-status": { - "x-ms-client-name": "LeaseStatus", - "description": "The current lease status of the blob.", - "type": "string", - "enum": [ - "locked", - "unlocked" - ], - "x-ms-enum": { - "name": "LeaseStatusType", - "modelAsString": false - } - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Accept-Ranges": { - "type": "string", - "description": "Indicates that the service supports requests for partial blob content." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "x-ms-blob-committed-block-count": { - "x-ms-client-name": "BlobCommittedBlockCount", - "type": "integer", - "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." - }, - "x-ms-server-encrypted": { - "x-ms-client-name": "IsServerEncrypted", - "type": "boolean", - "description": "The value of this header is set to true if the blob data and application metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the blob is unencrypted, or if only parts of the blob/application metadata are encrypted)." - }, - "x-ms-blob-content-md5": { - "x-ms-client-name": "BlobContentMD5", - "type": "string", - "format": "byte", - "description": "If the blob has a MD5 hash, and if request contains range header (Range or x-ms-range), this response header is returned with the value of the whole blob's MD5 value. This value may or may not be equal to the value returned in Content-MD5 header, with the latter calculated from the requested range" - } - }, - "schema": { - "type": "object", - "format": "file" - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "head": { - "tags": [ - "blob" - ], - "operationId": "Blob_GetProperties", - "description": "The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties for the blob. It does not return the content of the blob.", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Snapshot" - }, - { - "$ref": "#/parameters/VersionId" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/EncryptionKey" - }, - { - "$ref": "#/parameters/EncryptionKeySha256" - }, - { - "$ref": "#/parameters/EncryptionAlgorithm" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "Returns the properties of the blob.", - "headers": { - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-creation-time": { - "x-ms-client-name": "CreationTime", - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the blob was created." - }, - "x-ms-meta": { - "type": "string", - "x-ms-client-name": "Metadata", - "x-ms-header-collection-prefix": "x-ms-meta-" - }, - "x-ms-blob-type": { - "x-ms-client-name": "BlobType", - "description": "The blob's type.", - "type": "string", - "enum": [ - "BlockBlob", - "PageBlob", - "AppendBlob" - ], - "x-ms-enum": { - "name": "BlobType", - "modelAsString": false - } - }, - "x-ms-copy-completion-time": { - "x-ms-client-name": "CopyCompletionTime", - "type": "string", - "format": "date-time-rfc1123", - "description": "Conclusion time of the last attempted Copy Blob operation where this blob was the destination blob. This value can specify the time of a completed, aborted, or failed copy attempt. This header does not appear if a copy is pending, if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." - }, - "x-ms-copy-status-description": { - "x-ms-client-name": "CopyStatusDescription", - "type": "string", - "description": "Only appears when x-ms-copy-status is failed or pending. Describes the cause of the last fatal or non-fatal copy operation failure. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" - }, - "x-ms-copy-id": { - "x-ms-client-name": "CopyId", - "type": "string", - "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." - }, - "x-ms-copy-progress": { - "x-ms-client-name": "CopyProgress", - "type": "string", - "description": "Contains the number of bytes copied and the total bytes in the source in the last attempted Copy Blob operation where this blob was the destination blob. Can show between 0 and Content-Length bytes copied. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" - }, - "x-ms-copy-source": { - "x-ms-client-name": "CopySource", - "type": "string", - "description": "URL up to 2 KB in length that specifies the source blob or file used in the last attempted Copy Blob operation where this blob was the destination blob. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." - }, - "x-ms-copy-status": { - "x-ms-client-name": "CopyStatus", - "description": "State of the copy operation identified by x-ms-copy-id.", - "type": "string", - "enum": [ - "pending", - "success", - "aborted", - "failed" - ], - "x-ms-enum": { - "name": "CopyStatusType", - "modelAsString": false - } - }, - "x-ms-incremental-copy": { - "x-ms-client-name": "IsIncrementalCopy", - "type": "boolean", - "description": "Included if the blob is incremental copy blob." - }, - "x-ms-copy-destination-snapshot": { - "x-ms-client-name": "DestinationSnapshot", - "type": "string", - "description": "Included if the blob is incremental copy blob or incremental copy snapshot, if x-ms-copy-status is success. Snapshot time of the last successful incremental copy snapshot for this blob." - }, - "x-ms-lease-duration": { - "x-ms-client-name": "LeaseDuration", - "description": "When a blob is leased, specifies whether the lease is of infinite or fixed duration.", - "type": "string", - "enum": [ - "infinite", - "fixed" - ], - "x-ms-enum": { - "name": "LeaseDurationType", - "modelAsString": false - } - }, - "x-ms-lease-state": { - "x-ms-client-name": "LeaseState", - "description": "Lease state of the blob.", - "type": "string", - "enum": [ - "available", - "leased", - "expired", - "breaking", - "broken" - ], - "x-ms-enum": { - "name": "LeaseStateType", - "modelAsString": false - } - }, - "x-ms-lease-status": { - "x-ms-client-name": "LeaseStatus", - "description": "The current lease status of the blob.", - "type": "string", - "enum": [ - "locked", - "unlocked" - ], - "x-ms-enum": { - "name": "LeaseStatusType", - "modelAsString": false - } - }, - "Content-Length": { - "type": "integer", - "format": "int64", - "description": "The number of bytes present in the response body." - }, - "Content-Type": { - "type": "string", - "description": "The content type specified for the blob. The default content type is 'application/octet-stream'" - }, - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Content-MD5": { - "type": "string", - "format": "byte", - "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." - }, - "Content-Encoding": { - "type": "string", - "description": "This header returns the value that was specified for the Content-Encoding request header" - }, - "Content-Disposition": { - "type": "string", - "description": "This header returns the value that was specified for the 'x-ms-blob-content-disposition' header. The Content-Disposition response header field conveys additional information about how to process the response payload, and also can be used to attach additional metadata. For example, if set to attachment, it indicates that the user-agent should not display the response, but instead show a Save As dialog with a filename other than the blob name specified." - }, - "Content-Language": { - "type": "string", - "description": "This header returns the value that was specified for the Content-Language request header." - }, - "Cache-Control": { - "type": "string", - "description": "This header is returned if it was previously specified for the blob." - }, - "x-ms-blob-sequence-number": { - "x-ms-client-name": "BlobSequenceNumber", - "type": "integer", - "format": "int64", - "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "Accept-Ranges": { - "type": "string", - "description": "Indicates that the service supports requests for partial blob content." - }, - "x-ms-blob-committed-block-count": { - "x-ms-client-name": "BlobCommittedBlockCount", - "type": "integer", - "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." - }, - "x-ms-server-encrypted": { - "x-ms-client-name": "IsServerEncrypted", - "type": "boolean", - "description": "The value of this header is set to true if the blob data and application metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the blob is unencrypted, or if only parts of the blob/application metadata are encrypted)." - }, - "x-ms-encryption-key-sha256": { - "x-ms-client-name": "EncryptionKeySha256", - "type": "string", - "description": "The SHA-256 hash of the encryption key used to encrypt the metadata. This header is only returned when the metadata was encrypted with a customer-provided key." - }, - "x-ms-access-tier": { - "x-ms-client-name": "AccessTier", - "type": "string", - "description": "The tier of page blob on a premium storage account or tier of block blob on blob storage LRS accounts. For a list of allowed premium page blob tiers, see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/premium-storage#features. For blob storage LRS accounts, valid values are Hot/Cool/Archive." - }, - "x-ms-access-tier-inferred": { - "x-ms-client-name": "AccessTierInferred", - "type": "boolean", - "description": "For page blobs on a premium storage account only. If the access tier is not explicitly set on the blob, the tier is inferred based on its content length and this header will be returned with true value." - }, - "x-ms-archive-status": { - "x-ms-client-name": "ArchiveStatus", - "type": "string", - "description": "For blob storage LRS accounts, valid values are rehydrate-pending-to-hot/rehydrate-pending-to-cool. If the blob is being rehydrated and is not complete then this header is returned indicating that rehydrate is pending and also tells the destination tier." - }, - "x-ms-access-tier-change-time": { - "x-ms-client-name": "AccessTierChangeTime", - "type": "string", - "format": "date-time-rfc1123", - "description": "The time the tier was changed on the object. This is only returned if the tier on the block blob was ever set." - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "delete": { - "tags": [ - "blob" - ], - "operationId": "Blob_Delete", - "description": "If the storage account's soft delete feature is disabled then, when a blob is deleted, it is permanently removed from the storage account. If the storage account's soft delete feature is enabled, then, when a blob is deleted, it is marked for deletion and becomes inaccessible immediately. However, the blob service retains the blob or snapshot for the number of days specified by the DeleteRetentionPolicy section of [Storage service properties] (Set-Blob-Service-Properties.md). After the specified number of days has passed, the blob's data is permanently removed from the storage account. Note that you continue to be charged for the soft-deleted blob's storage until it is permanently removed. Use the List Blobs API and specify the \"include=deleted\" query parameter to discover which blobs and snapshots have been soft deleted. You can then use the Undelete Blob API to restore a soft-deleted blob. All other operations on a soft-deleted blob or snapshot causes the service to return an HTTP status code of 404 (ResourceNotFound). If the storage account's automatic snapshot feature is enabled, then, when a blob is deleted, an automatic snapshot is created. The blob becomes inaccessible immediately. All other operations on the blob causes the service to return an HTTP status code of 404 (ResourceNotFound). You can access automatic snapshot using snapshot timestamp or version id. You can restore the blob by calling Put or Copy Blob API with automatic snapshot as source. Deleting automatic snapshot requires shared key or special SAS/RBAC permissions.", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Snapshot" - }, - { - "$ref": "#/parameters/VersionId" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/DeleteSnapshots" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "202": { - "description": "The delete request was accepted and the blob will be deleted.", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - } - }, - "/{containerName}/{blob}?PageBlob": { - "put": { - "tags": [ - "blob" - ], - "operationId": "PageBlob_Create", - "description": "The Create operation creates a new page blob.", - "consumes": [ - "application/octet-stream" - ], - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ContentLength" - }, - { - "$ref": "#/parameters/BlobContentType" - }, - { - "$ref": "#/parameters/BlobContentEncoding" - }, - { - "$ref": "#/parameters/BlobContentLanguage" - }, - { - "$ref": "#/parameters/BlobContentMD5" - }, - { - "$ref": "#/parameters/BlobCacheControl" - }, - { - "$ref": "#/parameters/Metadata" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/BlobContentDisposition" - }, - { - "$ref": "#/parameters/EncryptionKey" - }, - { - "$ref": "#/parameters/EncryptionKeySha256" - }, - { - "$ref": "#/parameters/EncryptionAlgorithm" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/BlobContentLengthRequired" - }, - { - "$ref": "#/parameters/BlobSequenceNumber" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "201": { - "description": "The blob was created.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "Content-MD5": { - "type": "string", - "format": "byte", - "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "x-ms-version-id": { - "x-ms-client-name": "VersionId", - "type": "string", - "description": "UTC date/time value generated by the service that identifies a version of the blob. This header is returned for requests made against version 2018-11-09 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "x-ms-request-server-encrypted": { - "x-ms-client-name": "IsServerEncrypted", - "type": "boolean", - "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." - }, - "x-ms-encryption-key-sha256": { - "x-ms-client-name": "EncryptionKeySha256", - "type": "string", - "description": "The SHA-256 hash of the encryption key used to encrypt the blob. This header is only returned when the blob was encrypted with a customer-provided key." - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "x-ms-blob-type", - "x-ms-client-name": "blobType", - "in": "header", - "required": true, - "x-ms-parameter-location": "method", - "description": "Specifies the type of blob to create: block blob, page blob, or append blob.", - "type": "string", - "enum": [ - "PageBlob" - ], - "x-ms-enum": { - "name": "BlobType", - "modelAsString": false - } - } - ] - }, - "/{containerName}/{blob}?AppendBlob": { - "put": { - "tags": [ - "blob" - ], - "operationId": "AppendBlob_Create", - "description": "The Create Append Blob operation creates a new append blob.", - "consumes": [ - "application/octet-stream" - ], - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ContentLength" - }, - { - "$ref": "#/parameters/BlobContentType" - }, - { - "$ref": "#/parameters/BlobContentEncoding" - }, - { - "$ref": "#/parameters/BlobContentLanguage" - }, - { - "$ref": "#/parameters/BlobContentMD5" - }, - { - "$ref": "#/parameters/BlobCacheControl" - }, - { - "$ref": "#/parameters/Metadata" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/BlobContentDisposition" - }, - { - "$ref": "#/parameters/EncryptionKey" - }, - { - "$ref": "#/parameters/EncryptionKeySha256" - }, - { - "$ref": "#/parameters/EncryptionAlgorithm" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "201": { - "description": "The blob was created.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "Content-MD5": { - "type": "string", - "format": "byte", - "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "x-ms-version-id": { - "x-ms-client-name": "VersionId", - "type": "string", - "description": "UTC date/time value generated by the service that identifies a version of the blob. This header is returned for requests made against version 2018-11-09 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "x-ms-request-server-encrypted": { - "x-ms-client-name": "IsServerEncrypted", - "type": "boolean", - "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." - }, - "x-ms-encryption-key-sha256": { - "x-ms-client-name": "EncryptionKeySha256", - "type": "string", - "description": "The SHA-256 hash of the encryption key used to encrypt the blob. This header is only returned when the blob was encrypted with a customer-provided key." - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "x-ms-blob-type", - "x-ms-client-name": "blobType", - "in": "header", - "required": true, - "x-ms-parameter-location": "method", - "description": "Specifies the type of blob to create: block blob, page blob, or append blob.", - "type": "string", - "enum": [ - "AppendBlob" - ], - "x-ms-enum": { - "name": "BlobType", - "modelAsString": false - } - } - ] - }, - "/{containerName}/{blob}?BlockBlob": { - "put": { - "tags": [ - "blob" - ], - "operationId": "BlockBlob_Upload", - "description": "The Upload Block Blob operation updates the content of an existing block blob. Updating an existing block blob overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; the content of the existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a block blob, use the Put Block List operation.", - "consumes": [ - "application/octet-stream" - ], - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Body" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ContentLength" - }, - { - "$ref": "#/parameters/BlobContentType" - }, - { - "$ref": "#/parameters/BlobContentEncoding" - }, - { - "$ref": "#/parameters/BlobContentLanguage" - }, - { - "$ref": "#/parameters/BlobContentMD5" - }, - { - "$ref": "#/parameters/BlobCacheControl" - }, - { - "$ref": "#/parameters/Metadata" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/BlobContentDisposition" - }, - { - "$ref": "#/parameters/EncryptionKey" - }, - { - "$ref": "#/parameters/EncryptionKeySha256" - }, - { - "$ref": "#/parameters/EncryptionAlgorithm" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "201": { - "description": "The blob was updated.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "Content-MD5": { - "type": "string", - "format": "byte", - "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "x-ms-version-id": { - "x-ms-client-name": "VersionId", - "type": "string", - "description": "UTC date/time value generated by the service that identifies a version of the blob. This header is returned for requests made against version 2018-11-09 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "x-ms-request-server-encrypted": { - "x-ms-client-name": "IsServerEncrypted", - "type": "boolean", - "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." - }, - "x-ms-encryption-key-sha256": { - "x-ms-client-name": "EncryptionKeySha256", - "type": "string", - "description": "The SHA-256 hash of the encryption key used to encrypt the blob. This header is only returned when the blob was encrypted with a customer-provided key." - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "x-ms-blob-type", - "x-ms-client-name": "blobType", - "in": "header", - "required": true, - "x-ms-parameter-location": "method", - "description": "Specifies the type of blob to create: block blob, page blob, or append blob.", - "type": "string", - "enum": [ - "BlockBlob" - ], - "x-ms-enum": { - "name": "BlobType", - "modelAsString": false - } - } - ] - }, - "/{containerName}/{blob}?comp=undelete": { - "put": { - "tags": [ - "blob" - ], - "operationId": "Blob_Undelete", - "description": "Undelete a blob that was previously soft deleted", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "The blob was undeleted successfully.", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated." - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "undelete" - ] - } - ] - }, - "/{containerName}/{blob}?comp=properties&SetHTTPHeaders": { - "put": { - "tags": [ - "blob" - ], - "operationId": "Blob_SetHTTPHeaders", - "description": "The Set HTTP Headers operation sets system properties on the blob", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/BlobCacheControl" - }, - { - "$ref": "#/parameters/BlobContentType" - }, - { - "$ref": "#/parameters/BlobContentMD5" - }, - { - "$ref": "#/parameters/BlobContentEncoding" - }, - { - "$ref": "#/parameters/BlobContentLanguage" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/BlobContentDisposition" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "The properties were set successfully.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-blob-sequence-number": { - "x-ms-client-name": "BlobSequenceNumber", - "type": "integer", - "format": "int64", - "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "properties" - ] - } - ] - }, - "/{containerName}/{blob}?comp=metadata": { - "put": { - "tags": [ - "blob" - ], - "operationId": "Blob_SetMetadata", - "description": "The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more name-value pairs", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/Metadata" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/EncryptionKey" - }, - { - "$ref": "#/parameters/EncryptionKeySha256" - }, - { - "$ref": "#/parameters/EncryptionAlgorithm" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "The metadata was set successfully.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "x-ms-request-server-encrypted": { - "x-ms-client-name": "IsServerEncrypted", - "type": "boolean", - "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." - }, - "x-ms-encryption-key-sha256": { - "x-ms-client-name": "EncryptionKeySha256", - "type": "string", - "description": "The SHA-256 hash of the encryption key used to encrypt the metadata. This header is only returned when the metadata was encrypted with a customer-provided key." - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "metadata" - ] - } - ] - }, - "/{containerName}/{blob}?comp=lease&acquire": { - "put": { - "tags": [ - "blob" - ], - "operationId": "Blob_AcquireLease", - "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseDuration" - }, - { - "$ref": "#/parameters/ProposedLeaseIdOptional" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "201": { - "description": "The Acquire operation completed successfully.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-lease-id": { - "x-ms-client-name": "LeaseId", - "type": "string", - "description": "Uniquely identifies a blobs's lease" - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "lease" - ] - }, - { - "name": "x-ms-lease-action", - "x-ms-client-name": "action", - "in": "header", - "required": true, - "type": "string", - "enum": [ - "acquire" - ], - "x-ms-enum": { - "name": "LeaseAction", - "modelAsString": false - }, - "x-ms-parameter-location": "method", - "description": "Describes what lease action to take." - } - ] - }, - "/{containerName}/{blob}?comp=lease&release": { - "put": { - "tags": [ - "blob" - ], - "operationId": "Blob_ReleaseLease", - "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseIdRequired" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "The Release operation completed successfully.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "lease" - ] - }, - { - "name": "x-ms-lease-action", - "x-ms-client-name": "action", - "in": "header", - "required": true, - "type": "string", - "enum": [ - "release" - ], - "x-ms-enum": { - "name": "LeaseAction", - "modelAsString": false - }, - "x-ms-parameter-location": "method", - "description": "Describes what lease action to take." - } - ] - }, - "/{containerName}/{blob}?comp=lease&renew": { - "put": { - "tags": [ - "blob" - ], - "operationId": "Blob_RenewLease", - "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseIdRequired" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "The Renew operation completed successfully.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-lease-id": { - "x-ms-client-name": "LeaseId", - "type": "string", - "description": "Uniquely identifies a blobs's lease" - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "lease" - ] - }, - { - "name": "x-ms-lease-action", - "x-ms-client-name": "action", - "in": "header", - "required": true, - "type": "string", - "enum": [ - "renew" - ], - "x-ms-enum": { - "name": "LeaseAction", - "modelAsString": false - }, - "x-ms-parameter-location": "method", - "description": "Describes what lease action to take." - } - ] - }, - "/{containerName}/{blob}?comp=lease&change": { - "put": { - "tags": [ - "blob" - ], - "operationId": "Blob_ChangeLease", - "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseIdRequired" - }, - { - "$ref": "#/parameters/ProposedLeaseIdRequired" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "The Change operation completed successfully.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-lease-id": { - "x-ms-client-name": "LeaseId", - "type": "string", - "description": "Uniquely identifies a blobs's lease" - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "lease" - ] - }, - { - "name": "x-ms-lease-action", - "x-ms-client-name": "action", - "in": "header", - "required": true, - "type": "string", - "enum": [ - "change" - ], - "x-ms-enum": { - "name": "LeaseAction", - "modelAsString": false - }, - "x-ms-parameter-location": "method", - "description": "Describes what lease action to take." - } - ] - }, - "/{containerName}/{blob}?comp=lease&break": { - "put": { - "tags": [ - "blob" - ], - "operationId": "Blob_BreakLease", - "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseBreakPeriod" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "202": { - "description": "The Break operation completed successfully.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-lease-time": { - "x-ms-client-name": "LeaseTime", - "type": "integer", - "description": "Approximate time remaining in the lease period, in seconds." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "lease" - ] - }, - { - "name": "x-ms-lease-action", - "x-ms-client-name": "action", - "in": "header", - "required": true, - "type": "string", - "enum": [ - "break" - ], - "x-ms-enum": { - "name": "LeaseAction", - "modelAsString": false - }, - "x-ms-parameter-location": "method", - "description": "Describes what lease action to take." - } - ] - }, - "/{containerName}/{blob}?comp=snapshot": { - "put": { - "tags": [ - "blob" - ], - "operationId": "Blob_CreateSnapshot", - "description": "The Create Snapshot operation creates a read-only snapshot of a blob", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/Metadata" - }, - { - "$ref": "#/parameters/EncryptionKey" - }, - { - "$ref": "#/parameters/EncryptionKeySha256" - }, - { - "$ref": "#/parameters/EncryptionAlgorithm" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "201": { - "description": "The snaptshot was taken successfully.", - "headers": { - "x-ms-snapshot": { - "x-ms-client-name": "Snapshot", - "type": "string", - "description": "Uniquely identifies the snapshot and indicates the snapshot version. It may be used in subsequent requests to access the snapshot" - }, - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "x-ms-version-id": { - "x-ms-client-name": "VersionId", - "type": "string", - "description": "UTC date/time value generated by the service that identifies the version of the blob. This header is returned for requests made against version 2018-11-09 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "x-ms-request-server-encrypted": { - "x-ms-client-name": "IsServerEncrypted", - "type": "boolean", - "description": "True if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise. For a snapshot request, this header is set to true when metadata was provided in the request and encrypted with a customer-provided key." - }, - "x-ms-encryption-key-sha256": { - "x-ms-client-name": "EncryptionKeySha256", - "type": "string", - "description": "The SHA-256 hash of the encryption key used to encrypt the source blob. This header is only returned when the blob was encrypted with a customer-provided key." - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "snapshot" - ] - } - ] - }, - "/{containerName}/{blob}?comp=copy": { - "put": { - "tags": [ - "blob" - ], - "operationId": "Blob_StartCopyFromURL", - "description": "The Start Copy From URL operation copies a blob or an internet resource to a new blob.", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/Metadata" - }, - { - "$ref": "#/parameters/SourceIfModifiedSince" - }, - { - "$ref": "#/parameters/SourceIfUnmodifiedSince" - }, - { - "$ref": "#/parameters/SourceIfMatch" - }, - { - "$ref": "#/parameters/SourceIfNoneMatch" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/CopySource" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "202": { - "description": "The copy blob has been accepted with the specified copy status.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "x-ms-version-id": { - "x-ms-client-name": "VersionId", - "type": "string", - "description": "UTC date/time value generated by the service that identifies the version of the blob. This header is returned for requests made against version 2018-11-09 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "x-ms-copy-id": { - "x-ms-client-name": "CopyId", - "type": "string", - "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." - }, - "x-ms-copy-status": { - "x-ms-client-name": "CopyStatus", - "description": "State of the copy operation identified by x-ms-copy-id.", - "type": "string", - "enum": [ - "pending", - "success", - "aborted", - "failed" - ], - "x-ms-enum": { - "name": "CopyStatusType", - "modelAsString": false - } - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [] - }, - "/{containerName}/{blob}?comp=copy&sync": { - "put": { - "tags": [ - "blob" - ], - "operationId": "Blob_CopyFromURL", - "description": "The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response until the copy is complete.", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/Metadata" - }, - { - "$ref": "#/parameters/SourceIfModifiedSince" - }, - { - "$ref": "#/parameters/SourceIfUnmodifiedSince" - }, - { - "$ref": "#/parameters/SourceIfMatch" - }, - { - "$ref": "#/parameters/SourceIfNoneMatch" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/CopySource" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "202": { - "description": "The copy has completed.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "x-ms-version-id": { - "x-ms-client-name": "VersionId", - "type": "string", - "description": "UTC date/time value generated by the service that identifies the version of the blob. This header is returned for requests made against version 2018-11-09 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "x-ms-copy-id": { - "x-ms-client-name": "CopyId", - "type": "string", - "description": "String identifier for this copy operation." - }, - "x-ms-copy-status": { - "x-ms-client-name": "CopyStatus", - "description": "State of the copy operation identified by x-ms-copy-id.", - "type": "string", - "enum": [ - "success" - ], - "x-ms-enum": { - "name": "SyncCopyStatusType", - "modelAsString": false - } - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "x-ms-requires-sync", - "in": "header", - "required": true, - "type": "string", - "enum": [ - "true" - ] - } - ] - }, - "/{containerName}/{blob}?comp=copy©id={CopyId}": { - "put": { - "tags": [ - "blob" - ], - "operationId": "Blob_AbortCopyFromURL", - "description": "The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination blob with zero length and full metadata.", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/CopyId" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "204": { - "description": "The delete request was accepted and the blob will be deleted.", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "copy" - ] - }, - { - "name": "x-ms-copy-action", - "x-ms-client-name": "copyActionAbortConstant", - "in": "header", - "required": true, - "type": "string", - "enum": [ - "abort" - ], - "x-ms-parameter-location": "method" - } - ] - }, - "/{containerName}/{blob}?comp=tier": { - "put": { - "tags": [ - "blobs" - ], - "operationId": "Blob_SetTier", - "description": "The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium storage account and on a block blob in a blob storage account (locally redundant storage only). A premium page blob's tier determines the allowed size, IOPS, and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive storage type. This operation does not update the blob's ETag.", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/AccessTier" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - } - ], - "responses": { - "200": { - "description": "The new tier will take effect immediately.", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and newer." - } - } - }, - "202": { - "description": "The transition to the new tier is pending.", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and newer." - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "tier" - ] - } - ] - }, - "/{containerName}/{blob}?restype=account&comp=properties": { - "get": { - "tags": [ - "blob" - ], - "operationId": "Blob_GetAccountInfo", - "description": "Returns the sku name and account kind ", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "Success (OK)", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "x-ms-sku-name": { - "x-ms-client-name": "SkuName", - "type": "string", - "enum": [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ], - "x-ms-enum": { - "name": "SkuName", - "modelAsString": false - }, - "description": "Identifies the sku name of the account" - }, - "x-ms-account-kind": { - "x-ms-client-name": "AccountKind", - "type": "string", - "enum": [ - "Storage", - "BlobStorage", - "StorageV2" - ], - "x-ms-enum": { - "name": "AccountKind", - "modelAsString": false - }, - "description": "Identifies the account kind" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "restype", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "account" - ] - }, - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "properties" - ] - } - ] - }, - "/{containerName}/{blob}?comp=block": { - "put": { - "tags": [ - "blockblob" - ], - "operationId": "BlockBlob_StageBlock", - "description": "The Stage Block operation creates a new block to be committed as part of a blob", - "consumes": [ - "application/octet-stream" - ], - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/BlockId" - }, - { - "$ref": "#/parameters/ContentLength" - }, - { - "$ref": "#/parameters/ContentMD5" - }, - { - "$ref": "#/parameters/Body" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/EncryptionKey" - }, - { - "$ref": "#/parameters/EncryptionKeySha256" - }, - { - "$ref": "#/parameters/EncryptionAlgorithm" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "201": { - "description": "The block was created.", - "headers": { - "Content-MD5": { - "type": "string", - "format": "byte", - "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "x-ms-request-server-encrypted": { - "x-ms-client-name": "IsServerEncrypted", - "type": "boolean", - "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." - }, - "x-ms-encryption-key-sha256": { - "x-ms-client-name": "EncryptionKeySha256", - "type": "string", - "description": "The SHA-256 hash of the encryption key used to encrypt the block. This header is only returned when the block was encrypted with a customer-provided key." - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "block" - ] - } - ] - }, - "/{containerName}/{blob}?comp=block&fromURL": { - "put": { - "tags": [ - "blockblob" - ], - "operationId": "BlockBlob_StageBlockFromURL", - "description": "The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from a URL.", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/BlockId" - }, - { - "$ref": "#/parameters/ContentLength" - }, - { - "$ref": "#/parameters/SourceUrl" - }, - { - "$ref": "#/parameters/SourceRange" - }, - { - "$ref": "#/parameters/SourceContentMD5" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/EncryptionKey" - }, - { - "$ref": "#/parameters/EncryptionKeySha256" - }, - { - "$ref": "#/parameters/EncryptionAlgorithm" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - }, - { - "$ref": "#/parameters/SourceIfModifiedSince" - }, - { - "$ref": "#/parameters/SourceIfUnmodifiedSince" - }, - { - "$ref": "#/parameters/SourceIfMatch" - }, - { - "$ref": "#/parameters/SourceIfNoneMatch" - } - ], - "responses": { - "201": { - "description": "The block was created.", - "headers": { - "Content-MD5": { - "type": "string", - "format": "byte", - "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "x-ms-request-server-encrypted": { - "x-ms-client-name": "IsServerEncrypted", - "type": "boolean", - "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." - }, - "x-ms-encryption-key-sha256": { - "x-ms-client-name": "EncryptionKeySha256", - "type": "string", - "description": "The SHA-256 hash of the encryption key used to encrypt the block. This header is only returned when the block was encrypted with a customer-provided key." - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "block" - ] - } - ] - }, - "/{containerName}/{blob}?comp=blocklist": { - "put": { - "tags": [ - "blockblob" - ], - "operationId": "BlockBlob_CommitBlockList", - "description": "The Commit Block List operation writes a blob by specifying the list of block IDs that make up the blob. In order to be written as part of a blob, a block must have been successfully written to the server in a prior Put Block operation. You can call Put Block List to update a blob by uploading only those blocks that have changed, then committing the new and existing blocks together. You can do this by specifying whether to commit a block from the committed block list or from the uncommitted block list, or to commit the most recently uploaded version of the block, whichever list it may belong to.", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/BlobCacheControl" - }, - { - "$ref": "#/parameters/BlobContentType" - }, - { - "$ref": "#/parameters/BlobContentEncoding" - }, - { - "$ref": "#/parameters/BlobContentLanguage" - }, - { - "$ref": "#/parameters/BlobContentMD5" - }, - { - "$ref": "#/parameters/Metadata" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/BlobContentDisposition" - }, - { - "$ref": "#/parameters/EncryptionKey" - }, - { - "$ref": "#/parameters/EncryptionKeySha256" - }, - { - "$ref": "#/parameters/EncryptionAlgorithm" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "name": "blocks", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/BlockLookupList" - } - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "201": { - "description": "The block list was recorded.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "Content-MD5": { - "type": "string", - "format": "byte", - "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "x-ms-version-id": { - "x-ms-client-name": "VersionId", - "type": "string", - "description": "UTC date/time value generated by the service that identifies a version of the blob. This header is returned for requests made against version 2018-11-09 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "x-ms-request-server-encrypted": { - "x-ms-client-name": "IsServerEncrypted", - "type": "boolean", - "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." - }, - "x-ms-encryption-key-sha256": { - "x-ms-client-name": "EncryptionKeySha256", - "type": "string", - "description": "The SHA-256 hash of the encryption key used to encrypt the blob. This header is only returned when the blob was encrypted with a customer-provided key." - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "get": { - "tags": [ - "blockblob" - ], - "operationId": "BlockBlob_GetBlockList", - "description": "The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block blob", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Snapshot" - }, - { - "$ref": "#/parameters/VersionId" - }, - { - "$ref": "#/parameters/BlockListType" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "The page range was written.", - "headers": { - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Content-Type": { - "type": "string", - "description": "The media type of the body of the response. For Get Block List this is 'application/xml'" - }, - "x-ms-blob-content-length": { - "x-ms-client-name": "BlobContentLength", - "type": "integer", - "format": "int64", - "description": "The size of the blob in bytes." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - }, - "schema": { - "$ref": "#/definitions/BlockList" - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "blocklist" - ] - } - ] - }, - "/{containerName}/{blob}?comp=page&update": { - "put": { - "tags": [ - "pageblob" - ], - "operationId": "PageBlob_UploadPages", - "description": "The Upload Pages operation writes a range of pages to a page blob", - "consumes": [ - "application/octet-stream" - ], - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Body" - }, - { - "$ref": "#/parameters/ContentLength" - }, - { - "$ref": "#/parameters/ContentMD5" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/Range" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/EncryptionKey" - }, - { - "$ref": "#/parameters/EncryptionKeySha256" - }, - { - "$ref": "#/parameters/EncryptionAlgorithm" - }, - { - "$ref": "#/parameters/IfSequenceNumberLessThanOrEqualTo" - }, - { - "$ref": "#/parameters/IfSequenceNumberLessThan" - }, - { - "$ref": "#/parameters/IfSequenceNumberEqualTo" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "201": { - "description": "The page range was written.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "Content-MD5": { - "type": "string", - "format": "byte", - "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." - }, - "x-ms-blob-sequence-number": { - "x-ms-client-name": "BlobSequenceNumber", - "type": "integer", - "format": "int64", - "description": "The current sequence number for the page blob." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "x-ms-request-server-encrypted": { - "x-ms-client-name": "IsServerEncrypted", - "type": "boolean", - "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." - }, - "x-ms-encryption-key-sha256": { - "x-ms-client-name": "EncryptionKeySha256", - "type": "string", - "description": "The SHA-256 hash of the encryption key used to encrypt the pages. This header is only returned when the pages were encrypted with a customer-provided key." - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "page" - ] - }, - { - "name": "x-ms-page-write", - "x-ms-client-name": "pageWrite", - "in": "header", - "required": true, - "x-ms-parameter-location": "method", - "description": "Required. You may specify one of the following options:\n - Update: Writes the bytes specified by the request body into the specified range. The Range and Content-Length headers must match to perform the update.\n - Clear: Clears the specified range and releases the space used in storage for that range. To clear a range, set the Content-Length header to zero, and the Range header to a value that indicates the range to clear, up to maximum blob size.", - "type": "string", - "enum": [ - "update" - ], - "x-ms-enum": { - "name": "PageWriteType", - "modelAsString": false - } - } - ] - }, - "/{containerName}/{blob}?comp=page&clear": { - "put": { - "tags": [ - "pageblob" - ], - "operationId": "PageBlob_ClearPages", - "description": "The Clear Pages operation clears a set of pages from a page blob", - "consumes": [ - "application/octet-stream" - ], - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/ContentLength" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/Range" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/IfSequenceNumberLessThanOrEqualTo" - }, - { - "$ref": "#/parameters/IfSequenceNumberLessThan" - }, - { - "$ref": "#/parameters/IfSequenceNumberEqualTo" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "201": { - "description": "The page range was cleared.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "Content-MD5": { - "type": "string", - "format": "byte", - "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." - }, - "x-ms-blob-sequence-number": { - "x-ms-client-name": "BlobSequenceNumber", - "type": "integer", - "format": "int64", - "description": "The current sequence number for the page blob." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "page" - ] - }, - { - "name": "x-ms-page-write", - "x-ms-client-name": "pageWrite", - "in": "header", - "required": true, - "x-ms-parameter-location": "method", - "description": "Required. You may specify one of the following options:\n - Update: Writes the bytes specified by the request body into the specified range. The Range and Content-Length headers must match to perform the update.\n - Clear: Clears the specified range and releases the space used in storage for that range. To clear a range, set the Content-Length header to zero, and the Range header to a value that indicates the range to clear, up to maximum blob size.", - "type": "string", - "enum": [ - "clear" - ], - "x-ms-enum": { - "name": "PageWriteType", - "modelAsString": false - } - } - ] - }, - "/{containerName}/{blob}?comp=page&update&fromUrl": { - "put": { - "tags": [ - "pageblob" - ], - "operationId": "PageBlob_UploadPagesFromURL", - "description": "The Upload Pages operation writes a range of pages to a page blob where the contents are read from a URL", - "consumes": [ - "application/octet-stream" - ], - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/SourceUrl" - }, - { - "$ref": "#/parameters/SourceRangeRequiredPutPageFromUrl" - }, - { - "$ref": "#/parameters/SourceContentMD5" - }, - { - "$ref": "#/parameters/ContentLength" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/RangeRequiredPutPageFromUrl" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/IfSequenceNumberLessThanOrEqualTo" - }, - { - "$ref": "#/parameters/IfSequenceNumberLessThan" - }, - { - "$ref": "#/parameters/IfSequenceNumberEqualTo" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/SourceIfModifiedSince" - }, - { - "$ref": "#/parameters/SourceIfUnmodifiedSince" - }, - { - "$ref": "#/parameters/SourceIfMatch" - }, - { - "$ref": "#/parameters/SourceIfNoneMatch" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "201": { - "description": "The page range was written.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "Content-MD5": { - "type": "string", - "format": "byte", - "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." - }, - "x-ms-blob-sequence-number": { - "x-ms-client-name": "BlobSequenceNumber", - "type": "integer", - "format": "int64", - "description": "The current sequence number for the page blob." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "x-ms-request-server-encrypted": { - "x-ms-client-name": "IsServerEncrypted", - "type": "boolean", - "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "page" - ] - }, - { - "name": "x-ms-page-write", - "x-ms-client-name": "pageWrite", - "in": "header", - "required": true, - "x-ms-parameter-location": "method", - "description": "Required. You may specify one of the following options:\n - Update: Writes the bytes specified by the request body into the specified range. The Range and Content-Length headers must match to perform the update.\n - Clear: Clears the specified range and releases the space used in storage for that range. To clear a range, set the Content-Length header to zero, and the Range header to a value that indicates the range to clear, up to maximum blob size.", - "type": "string", - "enum": [ - "update" - ], - "x-ms-enum": { - "name": "PageWriteType", - "modelAsString": false - } - } - ] - }, - "/{containerName}/{blob}?comp=pagelist": { - "get": { - "tags": [ - "pageblob" - ], - "operationId": "PageBlob_GetPageRanges", - "description": "The Get Page Ranges operation returns the list of valid page ranges for a page blob, version or snapshot of a page blob", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Snapshot" - }, - { - "$ref": "#/parameters/VersionId" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/Range" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "Information on the page blob was found.", - "headers": { - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "x-ms-blob-content-length": { - "x-ms-client-name": "BlobContentLength", - "type": "integer", - "format": "int64", - "description": "The size of the blob in bytes." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - }, - "schema": { - "$ref": "#/definitions/PageList" - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "pagelist" - ] - } - ] - }, - "/{containerName}/{blob}?comp=pagelist&diff": { - "get": { - "tags": [ - "pageblob" - ], - "operationId": "PageBlob_GetPageRangesDiff", - "description": "[Update] The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were changed between target blob and previous snapshot or version.", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Snapshot" - }, - { - "$ref": "#/parameters/VersionId" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/PrevSnapshot" - }, - { - "$ref": "#/parameters/Range" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "Information on the page blob was found.", - "headers": { - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "x-ms-blob-content-length": { - "x-ms-client-name": "BlobContentLength", - "type": "integer", - "format": "int64", - "description": "The size of the blob in bytes." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - }, - "schema": { - "$ref": "#/definitions/PageList" - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "pagelist" - ] - } - ] - }, - "/{containerName}/{blob}?comp=properties&Resize": { - "put": { - "tags": [ - "pageblob" - ], - "operationId": "PageBlob_Resize", - "description": "Resize the Blob", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/BlobContentLengthRequired" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "The Blob was resized successfully", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-blob-sequence-number": { - "x-ms-client-name": "BlobSequenceNumber", - "type": "integer", - "format": "int64", - "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "properties" - ] - } - ] - }, - "/{containerName}/{blob}?comp=properties&UpdateSequenceNumber": { - "put": { - "tags": [ - "pageblob" - ], - "operationId": "PageBlob_UpdateSequenceNumber", - "description": "Update the sequence number of the blob", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/SequenceNumberAction" - }, - { - "$ref": "#/parameters/BlobSequenceNumber" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "The sequence numbers were updated successfully.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-blob-sequence-number": { - "x-ms-client-name": "BlobSequenceNumber", - "type": "integer", - "format": "int64", - "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "properties" - ] - } - ] - }, - "/{containerName}/{blob}?comp=incrementalcopy": { - "put": { - "tags": [ - "pageblob" - ], - "operationId": "PageBlob_CopyIncremental", - "description": "The Copy Incremental operation copies a snapshot of the source page blob to a destination page blob. The snapshot is copied such that only the differential changes between the previously copied snapshot are transferred to the destination. The copied snapshots are complete copies of the original snapshot and can be read or copied from as usual. This API is supported since REST version 2016-05-31.", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/CopySource" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "202": { - "description": "The blob was copied.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "x-ms-copy-id": { - "x-ms-client-name": "CopyId", - "type": "string", - "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." - }, - "x-ms-copy-status": { - "x-ms-client-name": "CopyStatus", - "description": "State of the copy operation identified by x-ms-copy-id.", - "type": "string", - "enum": [ - "pending", - "success", - "aborted", - "failed" - ], - "x-ms-enum": { - "name": "CopyStatusType", - "modelAsString": false - } - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "incrementalcopy" - ] - } - ] - }, - "/{containerName}/{blob}?comp=appendblock": { - "put": { - "tags": [ - "appendblob" - ], - "consumes": [ - "application/octet-stream" - ], - "operationId": "AppendBlob_AppendBlock", - "description": "The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later.", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/Body" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ContentLength" - }, - { - "$ref": "#/parameters/ContentMD5" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/BlobConditionMaxSize" - }, - { - "$ref": "#/parameters/BlobConditionAppendPos" - }, - { - "$ref": "#/parameters/EncryptionKey" - }, - { - "$ref": "#/parameters/EncryptionKeySha256" - }, - { - "$ref": "#/parameters/EncryptionAlgorithm" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "201": { - "description": "The block was created.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "Content-MD5": { - "type": "string", - "format": "byte", - "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "x-ms-blob-append-offset": { - "x-ms-client-name": "BlobAppendOffset", - "type": "string", - "description": "This response header is returned only for append operations. It returns the offset at which the block was committed, in bytes." - }, - "x-ms-blob-committed-block-count": { - "x-ms-client-name": "BlobCommittedBlockCount", - "type": "integer", - "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." - }, - "x-ms-request-server-encrypted": { - "x-ms-client-name": "IsServerEncrypted", - "type": "boolean", - "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." - }, - "x-ms-encryption-key-sha256": { - "x-ms-client-name": "EncryptionKeySha256", - "type": "string", - "description": "The SHA-256 hash of the encryption key used to encrypt the block. This header is only returned when the block was encrypted with a customer-provided key." - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "appendblock" - ] - } - ] - }, - "/{containerName}/{blob}?comp=appendblock&fromUrl": { - "put": { - "tags": [ - "appendblob" - ], - "operationId": "AppendBlob_AppendBlockFromUrl", - "description": "The Append Block operation commits a new block of data to the end of an existing append blob where the contents are read from a source url. The Append Block operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later.", - "parameters": [ - { - "$ref": "#/parameters/ContainerName" - }, - { - "$ref": "#/parameters/Blob" - }, - { - "$ref": "#/parameters/SourceUrl" - }, - { - "$ref": "#/parameters/SourceRange" - }, - { - "$ref": "#/parameters/SourceContentMD5" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ContentLength" - }, - { - "$ref": "#/parameters/LeaseIdOptional" - }, - { - "$ref": "#/parameters/BlobConditionMaxSize" - }, - { - "$ref": "#/parameters/BlobConditionAppendPos" - }, - { - "$ref": "#/parameters/IfModifiedSince" - }, - { - "$ref": "#/parameters/IfUnmodifiedSince" - }, - { - "$ref": "#/parameters/IfMatch" - }, - { - "$ref": "#/parameters/IfNoneMatch" - }, - { - "$ref": "#/parameters/SourceIfModifiedSince" - }, - { - "$ref": "#/parameters/SourceIfUnmodifiedSince" - }, - { - "$ref": "#/parameters/SourceIfMatch" - }, - { - "$ref": "#/parameters/SourceIfNoneMatch" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "201": { - "description": "The block was created.", - "headers": { - "ETag": { - "type": "string", - "format": "etag", - "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123", - "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." - }, - "Content-MD5": { - "type": "string", - "format": "byte", - "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "x-ms-blob-append-offset": { - "x-ms-client-name": "BlobAppendOffset", - "type": "string", - "description": "This response header is returned only for append operations. It returns the offset at which the block was committed, in bytes." - }, - "x-ms-blob-committed-block-count": { - "x-ms-client-name": "BlobCommittedBlockCount", - "type": "integer", - "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "appendblock" - ] - } - ] - } - }, - "definitions": { - "KeyInfo": { - "type": "object", - "required": [ - "Start", - "Expiry" - ], - "description": "Key information", - "properties": { - "Start": { - "description": "The date-time the key is active in ISO 8601 UTC time", - "type": "string" - }, - "Expiry": { - "description": "The date-time the key expires in ISO 8601 UTC time", - "type": "string" - } - } - }, - "UserDelegationKey": { - "type": "object", - "required": [ - "SignedOid", - "SignedTid", - "SignedStart", - "SignedExpiry", - "SignedService", - "SignedVersion", - "Value" - ], - "description": "A user delegation key", - "properties": { - "SignedOid": { - "description": "The Azure Active Directory object ID in GUID format.", - "type": "string" - }, - "SignedTid": { - "description": "The Azure Active Directory tenant ID in GUID format", - "type": "string" - }, - "SignedStart": { - "description": "The date-time the key is active", - "type": "string", - "format": "date-time" - }, - "SignedExpiry": { - "description": "The date-time the key expires", - "type": "string", - "format": "date-time" - }, - "SignedService": { - "description": "Abbreviation of the Azure Storage service that accepts the key", - "type": "string" - }, - "SignedVersion": { - "description": "The service version that created the key", - "type": "string" - }, - "Value": { - "description": "The key as a base64 string", - "type": "string" - } - } - }, - "PublicAccessType": { - "type": "string", - "enum": [ - "container", - "blob" - ], - "x-ms-enum": { - "name": "PublicAccessType", - "modelAsString": true - } - }, - "CopyStatus": { - "type": "string", - "enum": [ - "pending", - "success", - "aborted", - "failed" - ], - "x-ms-enum": { - "name": "CopyStatusType", - "modelAsString": false - } - }, - "LeaseDuration": { - "type": "string", - "enum": [ - "infinite", - "fixed" - ], - "x-ms-enum": { - "name": "LeaseDurationType", - "modelAsString": false - } - }, - "LeaseState": { - "type": "string", - "enum": [ - "available", - "leased", - "expired", - "breaking", - "broken" - ], - "x-ms-enum": { - "name": "LeaseStateType", - "modelAsString": false - } - }, - "LeaseStatus": { - "type": "string", - "enum": [ - "locked", - "unlocked" - ], - "x-ms-enum": { - "name": "LeaseStatusType", - "modelAsString": false - } - }, - "StorageError": { - "type": "object", - "properties": { - "Code": { - "type": "string" - }, - "Message": { - "type": "string" - } - } - }, - "AccessPolicy": { - "type": "object", - "required": [ - "Start", - "Expiry", - "Permission" - ], - "description": "An Access policy", - "properties": { - "Start": { - "description": "the date-time the policy is active", - "type": "string", - "format": "date-time" - }, - "Expiry": { - "description": "the date-time the policy expires", - "type": "string", - "format": "date-time" - }, - "Permission": { - "description": "the permissions for the acl policy", - "type": "string" - } - } - }, - "AccessTier": { - "type": "string", - "enum": [ - "P4", - "P6", - "P10", - "P20", - "P30", - "P40", - "P50", - "Hot", - "Cool", - "Archive" - ], - "x-ms-enum": { - "name": "AccessTier", - "modelAsString": true - } - }, - "ArchiveStatus": { - "type": "string", - "enum": [ - "rehydrate-pending-to-hot", - "rehydrate-pending-to-cool" - ], - "x-ms-enum": { - "name": "ArchiveStatus", - "modelAsString": true - } - }, - "BlobItem": { - "xml": { - "name": "Blob" - }, - "description": "An Azure Storage blob", - "type": "object", - "required": [ - "Name", - "Deleted", - "Snapshot", - "VersionId", - "Properties" - ], - "properties": { - "Name": { - "type": "string" - }, - "Deleted": { - "type": "boolean" - }, - "Snapshot": { - "type": "string" - }, - "VersionId": { - "type": "string" - }, - "Properties": { - "$ref": "#/definitions/BlobProperties" - }, - "Metadata": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "IsPrefix": { - "type": "boolean" - } - } - }, - "BlobProperties": { - "xml": { - "name": "Properties" - }, - "description": "Properties of a blob", - "type": "object", - "required": [ - "Etag", - "Last-Modified" - ], - "properties": { - "Creation-Time": { - "type": "string", - "format": "date-time-rfc1123" - }, - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123" - }, - "Etag": { - "type": "string", - "format": "etag" - }, - "Content-Length": { - "type": "integer", - "format": "int64", - "description": "Size in bytes" - }, - "Content-Type": { - "type": "string" - }, - "Content-Encoding": { - "type": "string" - }, - "Content-Language": { - "type": "string" - }, - "Content-MD5": { - "type": "string", - "format": "byte" - }, - "Content-Disposition": { - "type": "string" - }, - "Cache-Control": { - "type": "string" - }, - "x-ms-blob-sequence-number": { - "x-ms-client-name": "blobSequenceNumber", - "type": "integer", - "format": "int64" - }, - "BlobType": { - "type": "string", - "enum": [ - "BlockBlob", - "PageBlob", - "AppendBlob" - ], - "x-ms-enum": { - "name": "BlobType", - "modelAsString": false - } - }, - "LeaseStatus": { - "$ref": "#/definitions/LeaseStatus" - }, - "LeaseState": { - "$ref": "#/definitions/LeaseState" - }, - "LeaseDuration": { - "$ref": "#/definitions/LeaseDuration" - }, - "CopyId": { - "type": "string" - }, - "CopyStatus": { - "$ref": "#/definitions/CopyStatus" - }, - "CopySource": { - "type": "string" - }, - "CopyProgress": { - "type": "string" - }, - "CopyCompletionTime": { - "type": "string", - "format": "date-time-rfc1123" - }, - "CopyStatusDescription": { - "type": "string" - }, - "ServerEncrypted": { - "type": "boolean" - }, - "IncrementalCopy": { - "type": "boolean" - }, - "DestinationSnapshot": { - "type": "string" - }, - "DeletedTime": { - "type": "string", - "format": "date-time-rfc1123" - }, - "RemainingRetentionDays": { - "type": "integer" - }, - "AccessTier": { - "$ref": "#/definitions/AccessTier" - }, - "AccessTierInferred": { - "type": "boolean" - }, - "ArchiveStatus": { - "$ref": "#/definitions/ArchiveStatus" - }, - "CustomerProvidedKeySha256": { - "type": "string" - }, - "AccessTierChangeTime": { - "type": "string", - "format": "date-time-rfc1123" - } - } - }, - "ListBlobsFlatSegmentResponse": { - "xml": { - "name": "EnumerationResults" - }, - "description": "An enumeration of blobs", - "type": "object", - "required": [ - "ServiceEndpoint", - "ContainerName", - "Prefix", - "Marker", - "MaxResults", - "Delimiter", - "Segment", - "NextMarker" - ], - "properties": { - "ServiceEndpoint": { - "type": "string", - "xml": { - "attribute": true - } - }, - "ContainerName": { - "type": "string", - "xml": { - "attribute": true - } - }, - "Prefix": { - "type": "string" - }, - "Marker": { - "type": "string" - }, - "MaxResults": { - "type": "integer" - }, - "Delimiter": { - "type": "string" - }, - "Segment": { - "$ref": "#/definitions/BlobFlatListSegment" - }, - "NextMarker": { - "type": "string" - } - } - }, - "ListBlobsHierarchySegmentResponse": { - "xml": { - "name": "EnumerationResults" - }, - "description": "An enumeration of blobs", - "type": "object", - "required": [ - "ServiceEndpoint", - "ContainerName", - "Prefix", - "Marker", - "MaxResults", - "Delimiter", - "Segment", - "NextMarker" - ], - "properties": { - "ServiceEndpoint": { - "type": "string", - "xml": { - "attribute": true - } - }, - "ContainerName": { - "type": "string", - "xml": { - "attribute": true - } - }, - "Prefix": { - "type": "string" - }, - "Marker": { - "type": "string" - }, - "MaxResults": { - "type": "integer" - }, - "Delimiter": { - "type": "string" - }, - "Segment": { - "$ref": "#/definitions/BlobHierarchyListSegment" - }, - "NextMarker": { - "type": "string" - } - } - }, - "BlobFlatListSegment": { - "xml": { - "name": "Blobs" - }, - "required": [ - "BlobItems" - ], - "type": "object", - "properties": { - "BlobItems": { - "type": "array", - "items": { - "$ref": "#/definitions/BlobItem" - } - } - } - }, - "BlobHierarchyListSegment": { - "xml": { - "name": "Blobs" - }, - "type": "object", - "required": [ - "BlobItems" - ], - "properties": { - "BlobPrefixes": { - "type": "array", - "items": { - "$ref": "#/definitions/BlobPrefix" - } - }, - "BlobItems": { - "type": "array", - "items": { - "$ref": "#/definitions/BlobItem" - } - } - } - }, - "BlobPrefix": { - "type": "object", - "required": [ - "Name" - ], - "properties": { - "Name": { - "type": "string" - } - } - }, - "Block": { - "type": "object", - "required": [ - "Name", - "Size" - ], - "description": "Represents a single block in a block blob. It describes the block's ID and size.", - "properties": { - "Name": { - "description": "The base64 encoded block ID.", - "type": "string" - }, - "Size": { - "description": "The block size in bytes.", - "type": "integer" - } - } - }, - "BlockList": { - "type": "object", - "properties": { - "CommittedBlocks": { - "xml": { - "wrapped": true - }, - "type": "array", - "items": { - "$ref": "#/definitions/Block" - } - }, - "UncommittedBlocks": { - "xml": { - "wrapped": true - }, - "type": "array", - "items": { - "$ref": "#/definitions/Block" - } - } - } - }, - "BlockLookupList": { - "type": "object", - "properties": { - "Committed": { - "type": "array", - "items": { - "type": "string", - "xml": { - "name": "Committed" - } - } - }, - "Uncommitted": { - "type": "array", - "items": { - "type": "string", - "xml": { - "name": "Uncommitted" - } - } - }, - "Latest": { - "type": "array", - "items": { - "type": "string", - "xml": { - "name": "Latest" - } - } - } - }, - "xml": { - "name": "BlockList" - } - }, - "ContainerItem": { - "xml": { - "name": "Container" - }, - "type": "object", - "required": [ - "Name", - "Properties" - ], - "description": "An Azure Storage container", - "properties": { - "Name": { - "type": "string" - }, - "Properties": { - "$ref": "#/definitions/ContainerProperties" - }, - "Metadata": { - "$ref": "#/definitions/ContainerMetadata" - } - } - }, - "ContainerProperties": { - "type": "object", - "required": [ - "Last-Modified", - "Etag" - ], - "description": "Properties of a container", - "properties": { - "Last-Modified": { - "type": "string", - "format": "date-time-rfc1123" - }, - "Etag": { - "type": "string", - "format": "etag" - }, - "LeaseStatus": { - "$ref": "#/definitions/LeaseStatus" - }, - "LeaseState": { - "$ref": "#/definitions/LeaseState" - }, - "LeaseDuration": { - "$ref": "#/definitions/LeaseDuration" - }, - "PublicAccess": { - "$ref": "#/definitions/PublicAccessType" - }, - "HasImmutabilityPolicy": { - "type": "boolean" - }, - "HasLegalHold": { - "type": "boolean" - } - } - }, - "ListContainersSegmentResponse": { - "xml": { - "name": "EnumerationResults" - }, - "description": "An enumeration of containers", - "type": "object", - "required": [ - "ServiceEndpoint", - "Prefix", - "MaxResults", - "NextMarker", - "ContainerItems" - ], - "properties": { - "ServiceEndpoint": { - "type": "string", - "xml": { - "attribute": true - } - }, - "Prefix": { - "type": "string" - }, - "Marker": { - "type": "string" - }, - "MaxResults": { - "type": "integer" - }, - "ContainerItems": { - "xml": { - "wrapped": true, - "name": "Containers" - }, - "type": "array", - "items": { - "$ref": "#/definitions/ContainerItem" - } - }, - "NextMarker": { - "type": "string" - } - } - }, - "CorsRule": { - "description": "CORS is an HTTP feature that enables a web application running under one domain to access resources in another domain. Web browsers implement a security restriction known as same-origin policy that prevents a web page from calling APIs in a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs in another domain", - "type": "object", - "required": [ - "AllowedOrigins", - "AllowedMethods", - "AllowedHeaders", - "ExposedHeaders", - "MaxAgeInSeconds" - ], - "properties": { - "AllowedOrigins": { - "description": "The origin domains that are permitted to make a request against the storage service via CORS. The origin domain is the domain from which the request originates. Note that the origin must be an exact case-sensitive match with the origin that the user age sends to the service. You can also use the wildcard character '*' to allow all origin domains to make requests via CORS.", - "type": "string" - }, - "AllowedMethods": { - "description": "The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated)", - "type": "string" - }, - "AllowedHeaders": { - "description": "the request headers that the origin domain may specify on the CORS request.", - "type": "string" - }, - "ExposedHeaders": { - "description": "The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer", - "type": "string" - }, - "MaxAgeInSeconds": { - "description": "The maximum amount time that a browser should cache the preflight OPTIONS request.", - "type": "integer", - "minimum": 0 - } - } - }, - "ErrorCode": { - "description": "Error codes returned by the service", - "type": "string", - "enum": [ - "AccountAlreadyExists", - "AccountBeingCreated", - "AccountIsDisabled", - "AuthenticationFailed", - "AuthorizationFailure", - "ConditionHeadersNotSupported", - "ConditionNotMet", - "EmptyMetadataKey", - "InsufficientAccountPermissions", - "InternalError", - "InvalidAuthenticationInfo", - "InvalidHeaderValue", - "InvalidHttpVerb", - "InvalidInput", - "InvalidMd5", - "InvalidMetadata", - "InvalidQueryParameterValue", - "InvalidRange", - "InvalidResourceName", - "InvalidUri", - "InvalidXmlDocument", - "InvalidXmlNodeValue", - "Md5Mismatch", - "MetadataTooLarge", - "MissingContentLengthHeader", - "MissingRequiredQueryParameter", - "MissingRequiredHeader", - "MissingRequiredXmlNode", - "MultipleConditionHeadersNotSupported", - "OperationTimedOut", - "OutOfRangeInput", - "OutOfRangeQueryParameterValue", - "RequestBodyTooLarge", - "ResourceTypeMismatch", - "RequestUrlFailedToParse", - "ResourceAlreadyExists", - "ResourceNotFound", - "ServerBusy", - "UnsupportedHeader", - "UnsupportedXmlNode", - "UnsupportedQueryParameter", - "UnsupportedHttpVerb", - "AppendPositionConditionNotMet", - "BlobAlreadyExists", - "BlobNotFound", - "BlobOverwritten", - "BlobTierInadequateForContentLength", - "BlockCountExceedsLimit", - "BlockListTooLong", - "CannotChangeToLowerTier", - "CannotVerifyCopySource", - "ContainerAlreadyExists", - "ContainerBeingDeleted", - "ContainerDisabled", - "ContainerNotFound", - "ContentLengthLargerThanTierLimit", - "CopyAcrossAccountsNotSupported", - "CopyIdMismatch", - "FeatureVersionMismatch", - "IncrementalCopyBlobMismatch", - "IncrementalCopyOfEralierVersionSnapshotNotAllowed", - "IncrementalCopySourceMustBeSnapshot", - "InfiniteLeaseDurationRequired", - "InvalidBlobOrBlock", - "InvalidBlobTier", - "InvalidBlobType", - "InvalidBlockId", - "InvalidBlockList", - "InvalidOperation", - "InvalidPageRange", - "InvalidSourceBlobType", - "InvalidSourceBlobUrl", - "InvalidVersionForPageBlobOperation", - "LeaseAlreadyPresent", - "LeaseAlreadyBroken", - "LeaseIdMismatchWithBlobOperation", - "LeaseIdMismatchWithContainerOperation", - "LeaseIdMismatchWithLeaseOperation", - "LeaseIdMissing", - "LeaseIsBreakingAndCannotBeAcquired", - "LeaseIsBreakingAndCannotBeChanged", - "LeaseIsBrokenAndCannotBeRenewed", - "LeaseLost", - "LeaseNotPresentWithBlobOperation", - "LeaseNotPresentWithContainerOperation", - "LeaseNotPresentWithLeaseOperation", - "MaxBlobSizeConditionNotMet", - "NoPendingCopyOperation", - "OperationNotAllowedOnIncrementalCopyBlob", - "PendingCopyOperation", - "PreviousSnapshotCannotBeNewer", - "PreviousSnapshotNotFound", - "PreviousSnapshotOperationNotSupported", - "SequenceNumberConditionNotMet", - "SequenceNumberIncrementTooLarge", - "SnapshotCountExceeded", - "SnaphotOperationRateExceeded", - "SnapshotsPresent", - "SourceConditionNotMet", - "SystemInUse", - "TargetConditionNotMet", - "UnauthorizedBlobOverwrite", - "BlobBeingRehydrated", - "BlobArchived", - "BlobNotArchived" - ], - "x-ms-enum": { - "name": "StorageErrorCode", - "modelAsString": true - } - }, - "GeoReplication": { - "description": "Geo-Replication information for the Secondary Storage Service", - "type": "object", - "required": [ - "Status", - "LastSyncTime" - ], - "properties": { - "Status": { - "description": "The status of the secondary location", - "type": "string", - "enum": [ - "live", - "bootstrap", - "unavailable" - ], - "x-ms-enum": { - "name": "GeoReplicationStatusType", - "modelAsString": true - } - }, - "LastSyncTime": { - "description": "A GMT date/time value, to the second. All primary writes preceding this value are guaranteed to be available for read operations at the secondary. Primary writes after this point in time may or may not be available for reads.", - "type": "string", - "format": "date-time-rfc1123" - } - } - }, - "Logging": { - "description": "Azure Analytics Logging settings.", - "type": "object", - "required": [ - "Version", - "Delete", - "Read", - "Write", - "RetentionPolicy" - ], - "properties": { - "Version": { - "description": "The version of Storage Analytics to configure.", - "type": "string" - }, - "Delete": { - "description": "Indicates whether all delete requests should be logged.", - "type": "boolean" - }, - "Read": { - "description": "Indicates whether all read requests should be logged.", - "type": "boolean" - }, - "Write": { - "description": "Indicates whether all write requests should be logged.", - "type": "boolean" - }, - "RetentionPolicy": { - "$ref": "#/definitions/RetentionPolicy" - } - } - }, - "ContainerMetadata": { - "type": "object", - "xml": { - "name": "Metadata" - }, - "additionalProperties": { - "type": "string" - } - }, - "BlobMetadata": { - "type": "object", - "xml": { - "name": "Metadata" - }, - "properties": { - "Encrypted": { - "type": "string", - "xml": { - "attribute": true - } - } - }, - "additionalProperties": { - "type": "string" - } - }, - "Metrics": { - "description": "a summary of request statistics grouped by API in hour or minute aggregates for blobs", - "required": [ - "Enabled" - ], - "properties": { - "Version": { - "description": "The version of Storage Analytics to configure.", - "type": "string" - }, - "Enabled": { - "description": "Indicates whether metrics are enabled for the Blob service.", - "type": "boolean" - }, - "IncludeAPIs": { - "description": "Indicates whether metrics should generate summary statistics for called API operations.", - "type": "boolean" - }, - "RetentionPolicy": { - "$ref": "#/definitions/RetentionPolicy" - } - } - }, - "PageList": { - "description": "the list of pages", - "type": "object", - "properties": { - "PageRange": { - "type": "array", - "items": { - "$ref": "#/definitions/PageRange" - } - }, - "ClearRange": { - "type": "array", - "items": { - "$ref": "#/definitions/ClearRange" - } - } - } - }, - "PageRange": { - "type": "object", - "required": [ - "Start", - "End" - ], - "properties": { - "Start": { - "type": "integer", - "format": "int64", - "xml": { - "name": "Start" - } - }, - "End": { - "type": "integer", - "format": "int64", - "xml": { - "name": "End" - } - } - }, - "xml": { - "name": "PageRange" - } - }, - "ClearRange": { - "type": "object", - "required": [ - "Start", - "End" - ], - "properties": { - "Start": { - "type": "integer", - "format": "int64", - "xml": { - "name": "Start" - } - }, - "End": { - "type": "integer", - "format": "int64", - "xml": { - "name": "End" - } - } - }, - "xml": { - "name": "ClearRange" - } - }, - "RetentionPolicy": { - "description": "the retention policy which determines how long the associated data should persist", - "type": "object", - "required": [ - "Enabled" - ], - "properties": { - "Enabled": { - "description": "Indicates whether a retention policy is enabled for the storage service", - "type": "boolean" - }, - "Days": { - "description": "Indicates the number of days that metrics or logging or soft-deleted data should be retained. All data older than this value will be deleted", - "type": "integer", - "minimum": 1 - } - } - }, - "SignedIdentifier": { - "description": "signed identifier", - "type": "object", - "required": [ - "Id", - "AccessPolicy" - ], - "properties": { - "Id": { - "type": "string", - "description": "a unique id" - }, - "AccessPolicy": { - "$ref": "#/definitions/AccessPolicy" - } - } - }, - "SignedIdentifiers": { - "description": "a collection of signed identifiers", - "type": "array", - "items": { - "$ref": "#/definitions/SignedIdentifier", - "xml": { - "name": "SignedIdentifier" - } - }, - "xml": { - "wrapped": true, - "name": "SignedIdentifiers" - } - }, - "StaticWebsite": { - "description": "The properties that enable an account to host a static website", - "type": "object", - "required": [ - "Enabled" - ], - "properties": { - "Enabled": { - "description": "Indicates whether this account is hosting a static website", - "type": "boolean" - }, - "IndexDocument": { - "description": "The default name of the index page under each directory", - "type": "string" - }, - "ErrorDocument404Path": { - "description": "The absolute path of the custom 404 page", - "type": "string" - } - } - }, - "StorageServiceProperties": { - "description": "Storage Service Properties.", - "type": "object", - "properties": { - "Logging": { - "$ref": "#/definitions/Logging" - }, - "HourMetrics": { - "$ref": "#/definitions/Metrics" - }, - "MinuteMetrics": { - "$ref": "#/definitions/Metrics" - }, - "Cors": { - "description": "The set of CORS rules.", - "type": "array", - "items": { - "$ref": "#/definitions/CorsRule" - }, - "xml": { - "wrapped": true - } - }, - "DefaultServiceVersion": { - "description": "The default version to use for requests to the Blob service if an incoming request's version is not specified. Possible values include version 2008-10-27 and all more recent versions", - "type": "string" - }, - "DeleteRetentionPolicy": { - "$ref": "#/definitions/RetentionPolicy" - }, - "StaticWebsite": { - "$ref": "#/definitions/StaticWebsite" - } - } - }, - "StorageServiceStats": { - "description": "Stats for the storage service.", - "type": "object", - "properties": { - "GeoReplication": { - "$ref": "#/definitions/GeoReplication" - } - } - } - }, - "parameters": { - "Url": { - "name": "url", - "description": "The URL of the service account, container, or blob that is the targe of the desired operation.", - "required": true, - "type": "string", - "in": "path", - "x-ms-skip-url-encoding": true - }, - "ApiVersionParameter": { - "name": "x-ms-version", - "x-ms-client-name": "version", - "in": "header", - "required": true, - "type": "string", - "description": "Specifies the version of the operation to use for this request.", - "enum": [ - "2018-11-09" - ] - }, - "Blob": { - "name": "blob", - "in": "path", - "required": true, - "type": "string", - "pattern": "^[a-zA-Z0-9]+(?:/[a-zA-Z0-9]+)*(?:\\.[a-zA-Z0-9]+){0,1}$", - "minLength": 1, - "maxLength": 1024, - "x-ms-parameter-location": "method", - "description": "The blob name." - }, - "BlobCacheControl": { - "name": "x-ms-blob-cache-control", - "x-ms-client-name": "blobCacheControl", - "in": "header", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "blob-HTTP-headers" - }, - "description": "Optional. Sets the blob's cache control. If specified, this property is stored with the blob and returned with a read request." - }, - "BlobConditionAppendPos": { - "name": "x-ms-blob-condition-appendpos", - "x-ms-client-name": "appendPosition", - "in": "header", - "required": false, - "type": "integer", - "format": "int64", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "append-position-access-conditions" - }, - "description": "Optional conditional header, used only for the Append Block operation. A number indicating the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition Failed)." - }, - "BlobConditionMaxSize": { - "name": "x-ms-blob-condition-maxsize", - "x-ms-client-name": "maxSize", - "in": "header", - "required": false, - "type": "integer", - "format": "int64", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "append-position-access-conditions" - }, - "description": "Optional conditional header. The max length in bytes permitted for the append blob. If the Append Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 - Precondition Failed)." - }, - "BlobPublicAccess": { - "name": "x-ms-blob-public-access", - "x-ms-client-name": "access", - "in": "header", - "required": false, - "x-ms-parameter-location": "method", - "description": "Specifies whether data in the container may be accessed publicly and the level of access", - "type": "string", - "enum": [ - "container", - "blob" - ], - "x-ms-enum": { - "name": "PublicAccessType", - "modelAsString": true - } - }, - "AccessTier": { - "name": "x-ms-access-tier", - "x-ms-client-name": "tier", - "in": "header", - "required": true, - "type": "string", - "enum": [ - "P4", - "P6", - "P10", - "P20", - "P30", - "P40", - "P50", - "Hot", - "Cool", - "Archive" - ], - "x-ms-enum": { - "name": "AccessTier", - "modelAsString": true - }, - "x-ms-parameter-location": "method", - "description": "Indicates the tier to be set on the blob." - }, - "BlobContentDisposition": { - "name": "x-ms-blob-content-disposition", - "x-ms-client-name": "blobContentDisposition", - "in": "header", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "blob-HTTP-headers" - }, - "description": "Optional. Sets the blob's Content-Disposition header." - }, - "BlobContentEncoding": { - "name": "x-ms-blob-content-encoding", - "x-ms-client-name": "blobContentEncoding", - "in": "header", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "blob-HTTP-headers" - }, - "description": "Optional. Sets the blob's content encoding. If specified, this property is stored with the blob and returned with a read request." - }, - "BlobContentLanguage": { - "name": "x-ms-blob-content-language", - "x-ms-client-name": "blobContentLanguage", - "in": "header", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "blob-HTTP-headers" - }, - "description": "Optional. Set the blob's content language. If specified, this property is stored with the blob and returned with a read request." - }, - "BlobContentLengthOptional": { - "name": "x-ms-blob-content-length", - "x-ms-client-name": "blobContentLength", - "in": "header", - "required": false, - "type": "integer", - "format": "int64", - "x-ms-parameter-location": "method", - "description": "This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned to a 512-byte boundary." - }, - "BlobContentLengthRequired": { - "name": "x-ms-blob-content-length", - "x-ms-client-name": "blobContentLength", - "in": "header", - "required": true, - "type": "integer", - "format": "int64", - "x-ms-parameter-location": "method", - "description": "This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned to a 512-byte boundary." - }, - "BlobContentMD5": { - "name": "x-ms-blob-content-md5", - "x-ms-client-name": "blobContentMD5", - "in": "header", - "required": false, - "type": "string", - "format": "byte", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "blob-HTTP-headers" - }, - "description": "Optional. An MD5 hash of the blob content. Note that this hash is not validated, as the hashes for the individual blocks were validated when each was uploaded." - }, - "BlobContentType": { - "name": "x-ms-blob-content-type", - "x-ms-client-name": "blobContentType", - "in": "header", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "blob-HTTP-headers" - }, - "description": "Optional. Sets the blob's content type. If specified, this property is stored with the blob and returned with a read request." - }, - "BlobSequenceNumber": { - "name": "x-ms-blob-sequence-number", - "x-ms-client-name": "blobSequenceNumber", - "in": "header", - "required": false, - "type": "integer", - "format": "int64", - "default": 0, - "x-ms-parameter-location": "method", - "description": "Set for page blobs only. The sequence number is a user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 2^63 - 1." - }, - "BlockId": { - "name": "blockid", - "x-ms-client-name": "blockId", - "in": "query", - "type": "string", - "required": true, - "x-ms-parameter-location": "method", - "description": "A valid Base64 string value that identifies the block. Prior to encoding, the string must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter must be the same size for each block." - }, - "BlockListType": { - "name": "blocklisttype", - "x-ms-client-name": "listType", - "in": "query", - "required": true, - "default": "committed", - "x-ms-parameter-location": "method", - "description": "Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both lists together.", - "type": "string", - "enum": [ - "committed", - "uncommitted", - "all" - ], - "x-ms-enum": { - "name": "BlockListType", - "modelAsString": false - } - }, - "Body": { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "format": "file" - }, - "x-ms-parameter-location": "method", - "description": "Initial data" - }, - "CacheControl": { - "name": "Cache-Control", - "x-ms-client-name": "cacheControl", - "in": "header", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "description": "Cache control for given resource" - }, - "ContainerAcl": { - "name": "containerAcl", - "in": "body", - "schema": { - "$ref": "#/definitions/SignedIdentifiers" - }, - "x-ms-parameter-location": "method", - "description": "the acls for the container" - }, - "CopyId": { - "name": "copyid", - "x-ms-client-name": "copyId", - "in": "query", - "required": true, - "type": "string", - "x-ms-parameter-location": "method", - "description": "The copy identifier provided in the x-ms-copy-id header of the original Copy Blob operation." - }, - "ClientRequestId": { - "name": "x-ms-client-request-id", - "x-ms-client-name": "requestId", - "in": "header", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "description": "Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled." - }, - "ContainerName": { - "name": "containerName", - "in": "path", - "required": true, - "type": "string", - "x-ms-parameter-location": "method", - "description": "The container name." - }, - "ContentCrc64": { - "name": "x-ms-content-crc64", - "x-ms-client-name": "transactionalContentCrc64", - "in": "header", - "required": false, - "type": "string", - "format": "byte", - "x-ms-parameter-location": "method", - "description": "Specify the transactional crc64 for the body, to be validated by the service." - }, - "ContentLength": { - "name": "Content-Length", - "in": "header", - "required": true, - "type": "integer", - "format": "int64", - "x-ms-parameter-location": "method", - "description": "The length of the request." - }, - "ContentMD5": { - "name": "Content-MD5", - "x-ms-client-name": "transactionalContentMD5", - "in": "header", - "required": false, - "type": "string", - "format": "byte", - "x-ms-parameter-location": "method", - "description": "Specify the transactional md5 for the body, to be validated by the service." - }, - "CopySource": { - "name": "x-ms-copy-source", - "x-ms-client-name": "copySource", - "in": "header", - "required": true, - "type": "string", - "format": "url", - "x-ms-parameter-location": "method", - "description": "Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. The source blob must either be public or must be authenticated via a shared access signature." - }, - "DeleteSnapshots": { - "name": "x-ms-delete-snapshots", - "x-ms-client-name": "deleteSnapshots", - "description": "Required if the blob has associated snapshots. Specify one of the following two options: include: Delete the base blob and all of its snapshots. only: Delete only the blob's snapshots and not the blob itself", - "x-ms-parameter-location": "method", - "in": "header", - "required": false, - "type": "string", - "enum": [ - "include", - "only" - ], - "x-ms-enum": { - "name": "DeleteSnapshotsOptionType", - "modelAsString": false - } - }, - "Delimiter": { - "name": "delimiter", - "description": "When the request includes this parameter, the operation returns a BlobPrefix element in the response body that acts as a placeholder for all blobs whose names begin with the same substring up to the appearance of the delimiter character. The delimiter may be a single character or a string.", - "type": "string", - "x-ms-parameter-location": "method", - "in": "query", - "required": true - }, - "EncryptionKey": { - "name": "x-ms-encryption-key", - "x-ms-client-name": "EncryptionKey", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method", - "description": "Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services." - }, - "EncryptionKeySha256": { - "name": "x-ms-encryption-key-sha256", - "x-ms-client-name": "encryptionKeySha256", - "type": "string", - "in": "query", - "required": false, - "x-ms-parameter-location": "method", - "description": "The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided." - }, - "EncryptionAlgorithm": { - "name": "x-ms-encryption-algorithm", - "x-ms-client-name": "EncryptionAlgorithm", - "type": "string", - "in": "query", - "required": false, - "enum": [ - "AES256" - ], - "x-ms-enum": { - "name": "EncryptionAlgorithmType", - "modelAsString": false - }, - "x-ms-parameter-location": "method", - "description": "The algorithm used to produce the encryption key hash. Currently, the only accepted value is \"AES256\". Must be provided if the x-ms-encryption-key header is provided." - }, - "GetRangeContentMD5": { - "name": "x-ms-range-get-content-md5", - "x-ms-client-name": "rangeGetContentMD5", - "in": "header", - "required": false, - "type": "boolean", - "x-ms-parameter-location": "method", - "description": "When set to true and specified together with the Range, the service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size." - }, - "IfMatch": { - "name": "If-Match", - "x-ms-client-name": "ifMatch", - "in": "header", - "required": false, - "type": "string", - "format": "etag", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "modified-access-conditions" - }, - "description": "Specify an ETag value to operate only on blobs with a matching value." - }, - "IfModifiedSince": { - "name": "If-Modified-Since", - "x-ms-client-name": "ifModifiedSince", - "in": "header", - "required": false, - "type": "string", - "format": "date-time-rfc1123", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "modified-access-conditions" - }, - "description": "Specify this header value to operate only on a blob if it has been modified since the specified date/time." - }, - "IfNoneMatch": { - "name": "If-None-Match", - "x-ms-client-name": "ifNoneMatch", - "in": "header", - "required": false, - "type": "string", - "format": "etag", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "modified-access-conditions" - }, - "description": "Specify an ETag value to operate only on blobs without a matching value." - }, - "IfUnmodifiedSince": { - "name": "If-Unmodified-Since", - "x-ms-client-name": "ifUnmodifiedSince", - "in": "header", - "required": false, - "type": "string", - "format": "date-time-rfc1123", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "modified-access-conditions" - }, - "description": "Specify this header value to operate only on a blob if it has not been modified since the specified date/time." - }, - "IfSequenceNumberEqualTo": { - "name": "x-ms-if-sequence-number-eq", - "x-ms-client-name": "ifSequenceNumberEqualTo", - "in": "header", - "required": false, - "type": "integer", - "format": "int64", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "sequence-number-access-conditions" - }, - "description": "Specify this header value to operate only on a blob if it has the specified sequence number." - }, - "IfSequenceNumberLessThan": { - "name": "x-ms-if-sequence-number-lt", - "x-ms-client-name": "ifSequenceNumberLessThan", - "in": "header", - "required": false, - "type": "integer", - "format": "int64", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "sequence-number-access-conditions" - }, - "description": "Specify this header value to operate only on a blob if it has a sequence number less than the specified." - }, - "IfSequenceNumberLessThanOrEqualTo": { - "name": "x-ms-if-sequence-number-le", - "x-ms-client-name": "ifSequenceNumberLessThanOrEqualTo", - "in": "header", - "required": false, - "type": "integer", - "format": "int64", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "sequence-number-access-conditions" - }, - "description": "Specify this header value to operate only on a blob if it has a sequence number less than or equal to the specified." - }, - "KeyInfo": { - "name": "KeyInfo", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/KeyInfo" - } - }, - "ListBlobsInclude": { - "name": "include", - "in": "query", - "required": false, - "type": "array", - "collectionFormat": "csv", - "items": { - "type": "string", - "enum": [ - "copy", - "deleted", - "metadata", - "snapshots", - "uncommittedblobs" - ], - "x-ms-enum": { - "name": "ListBlobsIncludeItem", - "modelAsString": false - } - }, - "x-ms-parameter-location": "method", - "description": "Include this parameter to specify one or more datasets to include in the response." - }, - "ListContainersInclude": { - "name": "include", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "metadata" - ], - "x-ms-enum": { - "name": "ListContainersIncludeType", - "modelAsString": false - }, - "x-ms-parameter-location": "method", - "description": "Include this parameter to specify that the container's metadata be returned as part of the response body." - }, - "LeaseBreakPeriod": { - "name": "x-ms-lease-break-period", - "x-ms-client-name": "breakPeriod", - "in": "header", - "required": false, - "type": "integer", - "x-ms-parameter-location": "method", - "description": "For a break operation, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. If longer, the time remaining on the lease is used. A new lease will not be available before the break period has expired, but the lease may be held for longer than the break period. If this header does not appear with a break operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks immediately." - }, - "LeaseDuration": { - "name": "x-ms-lease-duration", - "x-ms-client-name": "duration", - "in": "header", - "required": false, - "type": "integer", - "x-ms-parameter-location": "method", - "description": "Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or change." - }, - "LeaseIdOptional": { - "name": "x-ms-lease-id", - "x-ms-client-name": "leaseId", - "in": "header", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "lease-access-conditions" - }, - "description": "If specified, the operation only succeeds if the resource's lease is active and matches this ID." - }, - "LeaseIdRequired": { - "name": "x-ms-lease-id", - "x-ms-client-name": "leaseId", - "in": "header", - "required": true, - "type": "string", - "x-ms-parameter-location": "method", - "description": "Specifies the current lease ID on the resource." - }, - "Marker": { - "name": "marker", - "in": "query", - "required": false, - "type": "string", - "description": "A string value that identifies the portion of the list of containers to be returned with the next listing operation. The operation returns the NextMarker value within the response body if the listing operation did not return all containers remaining to be listed with the current page. The NextMarker value can be used as the value for the marker parameter in a subsequent call to request the next page of list items. The marker value is opaque to the client.", - "x-ms-parameter-location": "method" - }, - "MaxResults": { - "name": "maxresults", - "in": "query", - "required": false, - "type": "integer", - "minimum": 1, - "x-ms-parameter-location": "method", - "description": "Specifies the maximum number of containers to return. If the request does not specify maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the listing operation crosses a partition boundary, then the service will return a continuation token for retrieving the remainder of the results. For this reason, it is possible that the service will return fewer results than specified by maxresults, or than the default of 5000." - }, - "Metadata": { - "name": "x-ms-meta", - "x-ms-client-name": "metadata", - "in": "header", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "description": "Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information.", - "x-ms-header-collection-prefix": "x-ms-meta-" - }, - "Prefix": { - "name": "prefix", - "in": "query", - "required": false, - "type": "string", - "description": "Filters the results to return only containers whose name begins with the specified prefix.", - "x-ms-parameter-location": "method" - }, - "PrevSnapshot": { - "name": "prevsnapshot", - "in": "query", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "description": "Optional in version 2015-07-08 and newer. The prevsnapshot parameter is a DateTime value that specifies that the response will contain only pages that were changed between target blob and previous snapshot. Changed pages include both updated and cleared pages. The target blob may be a snapshot, as long as the snapshot specified by prevsnapshot is the older of the two. Note that incremental snapshots are currently supported only for blobs created on or after January 1, 2016." - }, - "ProposedLeaseIdOptional": { - "name": "x-ms-proposed-lease-id", - "x-ms-client-name": "proposedLeaseId", - "in": "header", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "description": "Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID string formats." - }, - "ProposedLeaseIdRequired": { - "name": "x-ms-proposed-lease-id", - "x-ms-client-name": "proposedLeaseId", - "in": "header", - "required": true, - "type": "string", - "x-ms-parameter-location": "method", - "description": "Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID string formats." - }, - "Range": { - "name": "x-ms-range", - "x-ms-client-name": "range", - "in": "header", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "description": "Return only the bytes of the blob in the specified range." - }, - "RangeRequiredPutPageFromUrl": { - "name": "x-ms-range", - "x-ms-client-name": "range", - "in": "header", - "required": true, - "type": "string", - "x-ms-parameter-location": "method", - "description": "The range of bytes to which the source range would be written. The range should be 512 aligned and range-end is required." - }, - "SequenceNumberAction": { - "name": "x-ms-sequence-number-action", - "x-ms-client-name": "sequenceNumberAction", - "in": "header", - "required": true, - "x-ms-parameter-location": "method", - "description": "Required if the x-ms-blob-sequence-number header is set for the request. This property applies to page blobs only. This property indicates how the service should modify the blob's sequence number", - "type": "string", - "enum": [ - "max", - "update", - "increment" - ], - "x-ms-enum": { - "name": "SequenceNumberActionType", - "modelAsString": false - } - }, - "Snapshot": { - "name": "snapshot", - "in": "query", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "description": "The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more information on working with blob snapshots, see Creating a Snapshot of a Blob." - }, - "SourceContentMD5": { - "name": "x-ms-source-content-md5", - "x-ms-client-name": "sourceContentMD5", - "in": "header", - "required": false, - "type": "string", - "format": "byte", - "x-ms-parameter-location": "method", - "description": "Specify the md5 calculated for the range of bytes that must be read from the copy source." - }, - "SourceRange": { - "name": "x-ms-source-range", - "x-ms-client-name": "sourceRange", - "in": "header", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "description": "Bytes of source data in the specified range." - }, - "SourceRangeRequiredPutPageFromUrl": { - "name": "x-ms-source-range", - "x-ms-client-name": "sourceRange", - "in": "header", - "required": true, - "type": "string", - "x-ms-parameter-location": "method", - "description": "Bytes of source data in the specified range. The length of this range should match the ContentLength header and x-ms-range/Range destination range header." - }, - "SourceIfMatch": { - "name": "x-ms-source-if-match", - "x-ms-client-name": "sourceIfMatch", - "in": "header", - "required": false, - "type": "string", - "format": "etag", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "source-modified-access-conditions" - }, - "description": "Specify an ETag value to operate only on blobs with a matching value." - }, - "SourceIfModifiedSince": { - "name": "x-ms-source-if-modified-since", - "x-ms-client-name": "sourceIfModifiedSince", - "in": "header", - "required": false, - "type": "string", - "format": "date-time-rfc1123", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "source-modified-access-conditions" - }, - "description": "Specify this header value to operate only on a blob if it has been modified since the specified date/time." - }, - "SourceIfNoneMatch": { - "name": "x-ms-source-if-none-match", - "x-ms-client-name": "sourceIfNoneMatch", - "in": "header", - "required": false, - "type": "string", - "format": "etag", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "source-modified-access-conditions" - }, - "description": "Specify an ETag value to operate only on blobs without a matching value." - }, - "SourceIfUnmodifiedSince": { - "name": "x-ms-source-if-unmodified-since", - "x-ms-client-name": "sourceIfUnmodifiedSince", - "in": "header", - "required": false, - "type": "string", - "format": "date-time-rfc1123", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "source-modified-access-conditions" - }, - "description": "Specify this header value to operate only on a blob if it has not been modified since the specified date/time." - }, - "SourceLeaseId": { - "name": "x-ms-source-lease-id", - "x-ms-client-name": "sourceLeaseId", - "in": "header", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "description": "A lease ID for the source path. If specified, the source path must have an active lease and the leaase ID must match." - }, - "SourceUrl": { - "name": "x-ms-copy-source", - "x-ms-client-name": "sourceUrl", - "in": "header", - "required": true, - "type": "string", - "format": "url", - "x-ms-parameter-location": "method", - "description": "Specify a URL to the copy source." - }, - "StorageServiceProperties": { - "name": "StorageServiceProperties", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/StorageServiceProperties" - }, - "x-ms-parameter-location": "method", - "description": "The StorageService properties." - }, - "Timeout": { - "name": "timeout", - "in": "query", - "required": false, - "type": "integer", - "minimum": 0, - "x-ms-parameter-location": "method", - "description": "The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations." - }, - "VersionId": { - "name": "versionid", - "x-ms-client-name": "versionId", - "in": "query", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "description": "The version ID parameter is an opaque DateTime value that, when present, specifies the blob version to retrieve." - }, - "XMsCacheControl": { - "name": "x-ms-cache-control", - "x-ms-client-name": "cacheControl", - "in": "header", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "directory-http-headers" - }, - "description": "Cache control for given resource" - }, - "XMsContentType": { - "name": "x-ms-content-type", - "x-ms-client-name": "contentType", - "in": "header", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "directory-http-headers" - }, - "description": "Content type for given resource" - }, - "XMsContentEncoding": { - "name": "x-ms-content-encoding", - "x-ms-client-name": "contentEncoding", - "in": "header", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "directory-http-headers" - }, - "description": "Content encoding for given resource" - }, - "XMsContentLanguage": { - "name": "x-ms-content-language", - "x-ms-client-name": "contentLanguage", - "in": "header", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "directory-http-headers" - }, - "description": "Content language for given resource" - }, - "XMsContentDisposition": { - "name": "x-ms-content-disposition", - "x-ms-client-name": "contentDisposition", - "in": "header", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "x-ms-parameter-grouping": { - "name": "directory-http-headers" - }, - "description": "Content disposition for given resource" - } - } -} diff --git a/sdk/storage/azure-storage-common/pom.xml b/sdk/storage/azure-storage-common/pom.xml index e50ea1d13cd8..7eb369b5174a 100644 --- a/sdk/storage/azure-storage-common/pom.xml +++ b/sdk/storage/azure-storage-common/pom.xml @@ -15,7 +15,8 @@ azure-storage-common 12.0.0-preview.3 - azure-storage-common + Microsoft Azure common module for Storage + This module contains common code based for all Microsoft Azure Storage client libraries. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/storage/azure-storage-file/pom.xml b/sdk/storage/azure-storage-file/pom.xml index 91058c7dcdb7..f12383df2f0b 100644 --- a/sdk/storage/azure-storage-file/pom.xml +++ b/sdk/storage/azure-storage-file/pom.xml @@ -15,7 +15,8 @@ azure-storage-file 12.0.0-preview.3 - azure-storage-file + Microsoft Azure client library for File Storage + This module contains client library for Microsoft Azure File Storage. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/implementation/AzureFileStorageBuilder.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/implementation/AzureFileStorageBuilder.java index 39584a1738f9..61cd8b5218c9 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/implementation/AzureFileStorageBuilder.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/implementation/AzureFileStorageBuilder.java @@ -67,14 +67,15 @@ public AzureFileStorageBuilder pipeline(HttpPipeline pipeline) { * @return an instance of AzureFileStorageImpl. */ public AzureFileStorageImpl build() { + if (version == null) { + this.version = "2018-11-09"; + } if (pipeline == null) { this.pipeline = RestProxy.createDefaultPipeline(); } AzureFileStorageImpl client = new AzureFileStorageImpl(pipeline); if (this.version != null) { client.setVersion(this.version); - } else { - client.setVersion("2018-11-09"); } if (this.url != null) { client.setUrl(this.url); diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/implementation/AzureFileStorageImpl.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/implementation/AzureFileStorageImpl.java index 54e5f47f763f..5d154709eec4 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/implementation/AzureFileStorageImpl.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/implementation/AzureFileStorageImpl.java @@ -29,9 +29,11 @@ public String getVersion() { * Sets Specifies the version of the operation to use for this request. * * @param version the version value. + * @return the service client itself. */ - void setVersion(String version) { + AzureFileStorageImpl setVersion(String version) { this.version = version; + return this; } /** @@ -52,9 +54,11 @@ public String getUrl() { * Sets The URL of the service account, share, directory or file that is the target of the desired operation. * * @param url the url value. + * @return the service client itself. */ - void setUrl(String url) { + AzureFileStorageImpl setUrl(String url) { this.url = url; + return this; } /** diff --git a/sdk/storage/azure-storage-file/swagger/README.md b/sdk/storage/azure-storage-file/swagger/README.md new file mode 100644 index 000000000000..e27a308da24c --- /dev/null +++ b/sdk/storage/azure-storage-file/swagger/README.md @@ -0,0 +1,446 @@ +# Azure File Storage for Java + +> see https://aka.ms/autorest + +### Setup +```ps +cd C:\work +git clone --recursive https://github.com/Azure/autorest.java/ +cd autorest.java +git checkout v3 +npm install +cd .. +git clone --recursive https://github.com/jianghaolu/autorest.modeler/ +cd autorest.modeler +git checkout headerprefixfix +npm install +``` + +### Generation +```ps +cd +autorest --use=C:/work/autorest.java --use=C:/work/autorest.modeler --version=2.0.4280 +``` + +### Code generation settings +``` yaml +input-file: ./file-2018-11-09.json +java: true +output-folder: ../ +namespace: com.azure.storage.file +enable-xml: true +generate-client-interfaces: false +sync-methods: none +license-header: MICROSOFT_MIT_SMALL +add-context-parameter: true +``` + +### Query Parameters +``` yaml +directive: +- from: swagger-document + where: $.parameters + transform: > + if (!$.DirectoryPath) { + $.DirectoryPath = { + "name": "directoryPath", + "in": "path", + "description": "The path of the target directory.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": false + }; + } + if (!$.FilePath) { + $.FilePath = { + "name": "filePath", + "in": "path", + "description": "The path of the target file.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": false + }; + } + if (!$.ShareName) { + $.ShareName = { + "name": "shareName", + "in": "path", + "description": "The name of the target share.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }; + } +``` + +### FileServiceProperties +``` yaml +directive: +- from: swagger-document + where: $.definitions + transform: > + if (!$.FileServiceProperties) { + const props = $.FileServiceProperties = $.StorageServiceProperties; + props.xml = { "name": "StorageServiceProperties" }; + delete $.StorageServiceProperties; + } +- from: swagger-document + where: $.parameters + transform: > + if (!$.FileServiceProperties) { + const props = $.FileServiceProperties = $.StorageServiceProperties; + props.name = "FileServiceProperties"; + props.description = "The FileStorage properties."; + props.schema = { "$ref": props.schema.$ref.replace(/[#].*$/, "#/definitions/FileServiceProperties") }; + delete $.StorageServiceProperties; + } +- from: swagger-document + where: $["x-ms-paths"]["/?restype=service&comp=properties"] + transform: > + const param = $.put.parameters[0]; + if (param && param["$ref"] && param["$ref"].endsWith("StorageServiceProperties")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/FileServiceProperties"); + $.put.parameters[0] = { "$ref": path }; + } + const def = $.get.responses["200"].schema; + if (def && def["$ref"] && def["$ref"].endsWith("StorageServiceProperties")) { + const path = def["$ref"].replace(/[#].*$/, "#/definitions/FileServiceProperties"); + $.get.responses["200"].schema = { "$ref": path }; + } +``` + +### /{shareName}?restype=share +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{shareName}?restype=share"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ShareName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/ShareName"); + $.put.parameters.splice(0, 0, { "$ref": path }); + $.get.parameters.splice(0, 0, { "$ref": path }); + $.delete.parameters.splice(0, 0, { "$ref": path }); + } +``` + +### /{shareName}?restype=share&comp=properties +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{shareName}?restype=share&comp=properties"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ShareName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/ShareName"); + $.put.parameters.splice(0, 0, { "$ref": path }); + } +``` + +### /{shareName}?restype=share&comp=snapshot +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{shareName}?restype=share&comp=snapshot"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ShareName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/ShareName"); + $.put.parameters.splice(0, 0, { "$ref": path }); + } +``` + +### /{shareName}?restype=share&comp=metadata +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{shareName}?restype=share&comp=metadata"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ShareName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/ShareName"); + $.put.parameters.splice(0, 0, { "$ref": path }); + } +``` + +### /{shareName}?restype=share&comp=acl +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{shareName}?restype=share&comp=acl"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("ShareName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/ShareName"); + $.put.parameters.splice(0, 0, { "$ref": path }); + $.get.parameters.splice(0, 0, { "$ref": path }); + } +``` + + +### /{shareName}?restype=share&comp=stats +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{shareName}?restype=share&comp=stats"] + transform: > + let param = $.get.parameters[0]; + if (!param["$ref"].endsWith("ShareName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/ShareName"); + $.get.parameters.splice(0, 0, { "$ref": path }); + } +``` + +### /{shareName}/{directoryPath}?restype=directory +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"] + transform: > + if (!$["/{shareName}/{directoryPath}?restype=directory"]) { + const op = $["/{shareName}/{directoryPath}?restype=directory"] = $["/{shareName}/{directory}?restype=directory"]; + const path = op.put.parameters[0].$ref.replace(/[#].*$/, "#/parameters/"); + op.put.parameters.splice(0, 0, { "$ref": path + "ShareName" }); + op.put.parameters.splice(1, 0, { "$ref": path + "DirectoryPath" }); + op.get.parameters.splice(0, 0, { "$ref": path + "ShareName" }); + op.get.parameters.splice(1, 0, { "$ref": path + "DirectoryPath" }); + op.delete.parameters.splice(0, 0, { "$ref": path + "ShareName" }); + op.delete.parameters.splice(1, 0, { "$ref": path + "DirectoryPath" }); + delete $["/{shareName}/{directory}?restype=directory"]; + } +``` + +### /{shareName}/{directoryPath}?restype=directory&comp=metadata +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"] + transform: > + if (!$["/{shareName}/{directoryPath}?restype=directory&comp=metadata"]) { + const op = $["/{shareName}/{directoryPath}?restype=directory&comp=metadata"] = $["/{shareName}/{directory}?restype=directory&comp=metadata"]; + const path = op.put.parameters[0].$ref.replace(/[#].*$/, "#/parameters/"); + op.put.parameters.splice(0, 0, { "$ref": path + "ShareName" }); + op.put.parameters.splice(1, 0, { "$ref": path + "DirectoryPath" }); + delete $["/{shareName}/{directory}?restype=directory&comp=metadata"]; + } +``` + +### /{shareName}/{directoryPath}?restype=directory&comp=list +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"] + transform: > + if (!$["/{shareName}/{directoryPath}?restype=directory&comp=list"]) { + const op = $["/{shareName}/{directoryPath}?restype=directory&comp=list"] = $["/{shareName}/{directory}?restype=directory&comp=list"]; + const path = op.get.parameters[0].$ref.replace(/[#].*$/, "#/parameters/"); + op.get.parameters.splice(0, 0, { "$ref": path + "ShareName" }); + op.get.parameters.splice(1, 0, { "$ref": path + "DirectoryPath" }); + delete $["/{shareName}/{directory}?restype=directory&comp=list"]; + } +``` + +### /{shareName}/{directoryPath}?comp=listhandles +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"] + transform: > + if (!$["/{shareName}/{directoryPath}?comp=listhandles"]) { + const op = $["/{shareName}/{directoryPath}?comp=listhandles"] = $["/{shareName}/{directory}?comp=listhandles"]; + const path = op.get.parameters[0].$ref.replace(/[#].*$/, "#/parameters/"); + op.get.parameters.splice(0, 0, { "$ref": path + "ShareName" }); + op.get.parameters.splice(1, 0, { "$ref": path + "DirectoryPath" }); + delete $["/{shareName}/{directory}?comp=listhandles"]; + } +``` + +### /{shareName}/{directoryPath}?comp=forceclosehandles +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"] + transform: > + if (!$["/{shareName}/{directoryPath}?comp=forceclosehandles"]) { + const op = $["/{shareName}/{directoryPath}?comp=forceclosehandles"] = $["/{shareName}/{directory}?comp=forceclosehandles"]; + const path = op.put.parameters[0].$ref.replace(/[#].*$/, "#/parameters/"); + op.put.parameters.splice(0, 0, { "$ref": path + "ShareName" }); + op.put.parameters.splice(1, 0, { "$ref": path + "DirectoryPath" }); + delete $["/{shareName}/{directory}?comp=forceclosehandles"]; + } +``` + +### /{shareName}/{filePath} +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"] + transform: > + if (!$["/{shareName}/{filePath}"]) { + const op = $["/{shareName}/{filePath}"] = $["/{shareName}/{directory}/{fileName}"]; + const path = op.put.parameters[0].$ref.replace(/[#].*$/, "#/parameters/"); + op.put.parameters.splice(0, 0, { "$ref": path + "ShareName" }); + op.put.parameters.splice(1, 0, { "$ref": path + "FilePath" }); + op.get.parameters.splice(0, 0, { "$ref": path + "ShareName" }); + op.get.parameters.splice(1, 0, { "$ref": path + "FilePath" }); + op.head.parameters.splice(0, 0, { "$ref": path + "ShareName" }); + op.head.parameters.splice(1, 0, { "$ref": path + "FilePath" }); + delete op.head.responses.default.schema; + op.delete.parameters.splice(0, 0, { "$ref": path + "ShareName" }); + op.delete.parameters.splice(1, 0, { "$ref": path + "FilePath" }); + delete $["/{shareName}/{directory}/{fileName}"]; + } +``` + +### /{shareName}/{filePath}?comp=properties +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"] + transform: > + if (!$["/{shareName}/{filePath}?comp=properties"]) { + const op = $["/{shareName}/{filePath}?comp=properties"] = $["/{shareName}/{directory}/{fileName}?comp=properties"]; + const path = op.put.parameters[0].$ref.replace(/[#].*$/, "#/parameters/"); + op.put.parameters.splice(0, 0, { "$ref": path + "ShareName" }); + op.put.parameters.splice(1, 0, { "$ref": path + "FilePath" }); + delete $["/{shareName}/{directory}/{fileName}?comp=properties"]; + } +``` + +### /{shareName}/{filePath}?comp=metadata +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"] + transform: > + if (!$["/{shareName}/{filePath}?comp=metadata"]) { + const op = $["/{shareName}/{filePath}?comp=metadata"] = $["/{shareName}/{directory}/{fileName}?comp=metadata"]; + const path = op.put.parameters[0].$ref.replace(/[#].*$/, "#/parameters/"); + op.put.parameters.splice(0, 0, { "$ref": path + "ShareName" }); + op.put.parameters.splice(1, 0, { "$ref": path + "FilePath" }); + delete $["/{shareName}/{directory}/{fileName}?comp=metadata"]; + } +``` + +### /{shareName}/{filePath}?comp=range +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"] + transform: > + if (!$["/{shareName}/{filePath}?comp=range"]) { + const op = $["/{shareName}/{filePath}?comp=range"] = $["/{shareName}/{directory}/{fileName}?comp=range"]; + const path = op.put.parameters[0].$ref.replace(/[#].*$/, "#/parameters/"); + op.put.parameters.splice(0, 0, { "$ref": path + "ShareName" }); + op.put.parameters.splice(1, 0, { "$ref": path + "FilePath" }); + delete $["/{shareName}/{directory}/{fileName}?comp=range"]; + } +``` + +### /{shareName}/{filePath}?comp=rangelist +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"] + transform: > + if (!$["/{shareName}/{filePath}?comp=rangelist"]) { + const op = $["/{shareName}/{filePath}?comp=rangelist"] = $["/{shareName}/{directory}/{fileName}?comp=rangelist"]; + const path = op.get.parameters[0].$ref.replace(/[#].*$/, "#/parameters/"); + op.get.parameters.splice(0, 0, { "$ref": path + "ShareName" }); + op.get.parameters.splice(1, 0, { "$ref": path + "FilePath" }); + delete $["/{shareName}/{directory}/{fileName}?comp=rangelist"]; + } +``` + +### /{shareName}/{filePath}?comp=copy +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"] + transform: > + if (!$["/{shareName}/{filePath}?comp=copy"]) { + const op = $["/{shareName}/{filePath}?comp=copy"] = $["/{shareName}/{directory}/{fileName}?comp=copy"]; + const path = op.put.parameters[0].$ref.replace(/[#].*$/, "#/parameters/"); + op.put.parameters.splice(0, 0, { "$ref": path + "ShareName" }); + op.put.parameters.splice(1, 0, { "$ref": path + "FilePath" }); + delete $["/{shareName}/{directory}/{fileName}?comp=copy"]; + } +``` + +### /{shareName}/{filePath}?comp=copy©id={CopyId} +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"] + transform: > + if (!$["/{shareName}/{filePath}?comp=copy©id={CopyId}"]) { + const op = $["/{shareName}/{filePath}?comp=copy©id={CopyId}"] = $["/{shareName}/{directory}/{fileName}?comp=copy©id={CopyId}"]; + const path = op.put.parameters[0].$ref.replace(/[#].*$/, "#/parameters/"); + op.put.parameters.splice(0, 0, { "$ref": path + "ShareName" }); + op.put.parameters.splice(1, 0, { "$ref": path + "FilePath" }); + delete $["/{shareName}/{directory}/{fileName}?comp=copy©id={CopyId}"]; + } +``` + +### /{shareName}/{filePath}?comp=listhandles +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"] + transform: > + if (!$["/{shareName}/{filePath}?comp=listhandles"]) { + const op = $["/{shareName}/{filePath}?comp=listhandles"] = $["/{shareName}/{directory}/{fileName}?comp=listhandles"]; + const path = op.get.parameters[0].$ref.replace(/[#].*$/, "#/parameters/"); + op.get.parameters.splice(0, 0, { "$ref": path + "ShareName" }); + op.get.parameters.splice(1, 0, { "$ref": path + "FilePath" }); + delete $["/{shareName}/{directory}/{fileName}?comp=listhandles"]; + } +``` + +### /{shareName}/{filePath}?comp=forceclosehandles +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"] + transform: > + if (!$["/{shareName}/{filePath}?comp=forceclosehandles"]) { + const op = $["/{shareName}/{filePath}?comp=forceclosehandles"] = $["/{shareName}/{directory}/{fileName}?comp=forceclosehandles"]; + const path = op.put.parameters[0].$ref.replace(/[#].*$/, "#/parameters/"); + op.put.parameters.splice(0, 0, { "$ref": path + "ShareName" }); + op.put.parameters.splice(1, 0, { "$ref": path + "FilePath" }); + delete $["/{shareName}/{directory}/{fileName}?comp=forceclosehandles"]; + } +``` + +### ShareProperties +``` yaml +directive: +- from: swagger-document + where: $.definitions + transform: > + if (!$.ShareProperties.properties.Metadata) { + const path = $.ShareItem.properties.Metadata.$ref; + $.ShareProperties.properties.Metadata = { "$ref": path }; + } +``` + +### ShareUsageBytes +``` yaml +directive: +- from: swagger-document + where: $.definitions.ShareStats.properties.ShareUsageBytes + transform: > + $.description = "The approximate size of the data stored in bytes, rounded up to the nearest gigabyte. Note that this value may not include all recently created or recently resized files."; + $.format = "int64"; +``` + +### ApiVersionParameter +``` yaml +directive: +- from: swagger-document + where: $.parameters.ApiVersionParameter + transform: > + $.enum = [ "2018-11-09" ]; +``` diff --git a/sdk/storage/azure-storage-file/swagger/file.json b/sdk/storage/azure-storage-file/swagger/file-2018-11-09.json similarity index 95% rename from sdk/storage/azure-storage-file/swagger/file.json rename to sdk/storage/azure-storage-file/swagger/file-2018-11-09.json index 26efc70f6af0..fbe80a1d8198 100644 --- a/sdk/storage/azure-storage-file/swagger/file.json +++ b/sdk/storage/azure-storage-file/swagger/file-2018-11-09.json @@ -44,7 +44,7 @@ "operationId": "Service_SetProperties", "description": "Sets properties for a storage account's File service endpoint, including properties for Storage Analytics metrics and CORS (Cross-Origin Resource Sharing) rules.", "parameters": [{ - "$ref": "#/parameters/FileServiceProperties" + "$ref": "#/parameters/StorageServiceProperties" }, { "$ref": "#/parameters/Timeout" @@ -112,7 +112,7 @@ } }, "schema": { - "$ref": "#/definitions/FileServiceProperties" + "$ref": "#/definitions/StorageServiceProperties" } }, "default": { @@ -228,11 +228,7 @@ ], "operationId": "Share_Create", "description": "Creates a new share under the specified account. If the share with the same name already exists, the operation fails.", - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { + "parameters": [{ "$ref": "#/parameters/Timeout" }, { @@ -296,11 +292,7 @@ ], "operationId": "Share_GetProperties", "description": "Returns all user-defined metadata and system properties for the specified share or share snapshot. The data returned does not include the share's list of files.", - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { + "parameters": [{ "$ref": "#/parameters/ShareSnapshot" }, { @@ -372,11 +364,7 @@ ], "operationId": "Share_Delete", "description": "Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any files contained within it are later deleted during garbage collection.", - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { + "parameters": [{ "$ref": "#/parameters/ShareSnapshot" }, { @@ -441,11 +429,7 @@ ], "operationId": "Share_CreateSnapshot", "description": "Creates a read-only snapshot of a share.", - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { + "parameters": [{ "$ref": "#/parameters/Timeout" }, { @@ -532,11 +516,7 @@ ], "operationId": "Share_SetQuota", "description": "Sets quota for the specified share.", - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { + "parameters": [{ "$ref": "#/parameters/Timeout" }, { @@ -618,11 +598,7 @@ ], "operationId": "Share_SetMetadata", "description": "Sets one or more user-defined name-value pairs for the specified share.", - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { + "parameters": [{ "$ref": "#/parameters/Timeout" }, { @@ -704,11 +680,7 @@ ], "operationId": "Share_GetAccessPolicy", "description": "Returns information about stored access policies specified on the share.", - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { + "parameters": [{ "$ref": "#/parameters/Timeout" }, { @@ -769,11 +741,7 @@ ], "operationId": "Share_SetAccessPolicy", "description": "Sets a stored access policy for use with shared access signatures.", - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { + "parameters": [{ "$ref": "#/parameters/ShareAcl" }, { @@ -855,11 +823,7 @@ ], "operationId": "Share_GetStatistics", "description": "Retrieves statistics related to the share.", - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { + "parameters": [{ "$ref": "#/parameters/Timeout" }, { @@ -934,21 +898,14 @@ } ] }, - "/{shareName}/{directoryPath}?restype=directory": { + "/{shareName}/{directory}?restype=directory": { "put": { "tags": [ "directory" ], "operationId": "Directory_Create", "description": "Creates a new directory under the specified share or parent directory.", - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { - "$ref": "#/parameters/DirectoryPath" - }, - { + "parameters": [{ "$ref": "#/parameters/Timeout" }, { @@ -1014,14 +971,7 @@ ], "operationId": "Directory_GetProperties", "description": "Returns all system properties for the specified directory, and can also be used to check the existence of a directory. The data returned does not include the files in the directory or any subdirectories.", - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { - "$ref": "#/parameters/DirectoryPath" - }, - { + "parameters": [{ "$ref": "#/parameters/ShareSnapshot" }, { @@ -1093,14 +1043,7 @@ ], "operationId": "Directory_Delete", "description": "Removes the specified empty directory. Note that the directory must be empty before it can be deleted.", - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { - "$ref": "#/parameters/DirectoryPath" - }, - { + "parameters": [{ "$ref": "#/parameters/Timeout" }, { @@ -1152,21 +1095,14 @@ ] }] }, - "/{shareName}/{directoryPath}?restype=directory&comp=metadata": { + "/{shareName}/{directory}?restype=directory&comp=metadata": { "put": { "tags": [ "directory" ], "operationId": "Directory_SetMetadata", "description": "Updates user defined metadata for the specified directory.", - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { - "$ref": "#/parameters/DirectoryPath" - }, - { + "parameters": [{ "$ref": "#/parameters/Timeout" }, { @@ -1241,7 +1177,7 @@ } ] }, - "/{shareName}/{directoryPath}?restype=directory&comp=list": { + "/{shareName}/{directory}?restype=directory&comp=list": { "get": { "tags": [ "directory" @@ -1249,12 +1185,6 @@ "operationId": "Directory_ListFilesAndDirectoriesSegment", "description": "Returns a list of files or directories under the specified share or directory. It lists the contents only for a single level of the directory hierarchy.", "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { - "$ref": "#/parameters/DirectoryPath" - }, { "$ref": "#/parameters/Prefix" }, @@ -1339,7 +1269,7 @@ } ] }, - "/{shareName}/{directoryPath}?comp=listhandles": { + "/{shareName}/{directory}?comp=listhandles": { "get":{ "tags": [ "directory" @@ -1347,12 +1277,6 @@ "operationId": "Directory_ListHandles", "description": "Lists handles for directory.", "parameters":[ - { - "$ref": "#/parameters/ShareName" - }, - { - "$ref": "#/parameters/DirectoryPath" - }, { "$ref": "#/parameters/Marker" }, @@ -1425,7 +1349,7 @@ } ] }, - "/{shareName}/{directoryPath}?comp=forceclosehandles": { + "/{shareName}/{directory}?comp=forceclosehandles": { "put": { "tags": [ "directory" @@ -1433,12 +1357,6 @@ "operationId": "Directory_ForceCloseHandles", "description": "Closes all handles open for given directory.", "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { - "$ref": "#/parameters/DirectoryPath" - }, { "$ref": "#/parameters/Timeout" }, @@ -1514,21 +1432,14 @@ } ] }, - "/{shareName}/{filePath}": { + "/{shareName}/{directory}/{fileName}": { "put": { "tags": [ "file" ], "operationId": "File_Create", "description": "Creates a new file or replaces a file. Note it only initializes the file with no content.", - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { - "$ref": "#/parameters/FilePath" - }, - { + "parameters": [{ "$ref": "#/parameters/Timeout" }, { @@ -1624,14 +1535,7 @@ ], "operationId": "File_Download", "description": "Reads or downloads a file from the system, including its metadata and properties.", - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { - "$ref": "#/parameters/FilePath" - }, - { + "parameters": [{ "$ref": "#/parameters/Timeout" }, { @@ -1925,14 +1829,7 @@ ], "operationId": "File_GetProperties", "description": "Returns all user-defined metadata, standard HTTP properties, and system properties for the file. It does not return the content of the file.", - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { - "$ref": "#/parameters/FilePath" - }, - { + "parameters": [{ "$ref": "#/parameters/ShareSnapshot" }, { @@ -2070,6 +1967,9 @@ "x-ms-client-name": "ErrorCode", "type": "string" } + }, + "schema": { + "$ref": "#/definitions/StorageError" } } } @@ -2080,14 +1980,7 @@ ], "operationId": "File_Delete", "description": "removes the file from the storage account.", - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { - "$ref": "#/parameters/FilePath" - }, - { + "parameters": [{ "$ref": "#/parameters/Timeout" }, { @@ -2133,21 +2026,14 @@ ] }, - "/{shareName}/{filePath}?comp=properties": { + "/{shareName}/{directory}/{fileName}?comp=properties": { "put": { "tags": [ "file" ], "operationId": "File_SetHTTPHeaders", "description": "Sets HTTP headers on the file.", - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { - "$ref": "#/parameters/FilePath" - }, - { + "parameters": [{ "$ref": "#/parameters/Timeout" }, { @@ -2241,21 +2127,14 @@ ] }] }, - "/{shareName}/{filePath}?comp=metadata": { + "/{shareName}/{directory}/{fileName}?comp=metadata": { "put": { "tags": [ "file" ], "operationId": "File_SetMetadata", "description": "Updates user-defined metadata for the specified file.", - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { - "$ref": "#/parameters/FilePath" - }, - { + "parameters": [{ "$ref": "#/parameters/Timeout" }, { @@ -2320,7 +2199,7 @@ ] }] }, - "/{shareName}/{filePath}?comp=range": { + "/{shareName}/{directory}/{fileName}?comp=range": { "put": { "tags": [ "file" @@ -2330,14 +2209,7 @@ "consumes": [ "application/octet-stream" ], - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { - "$ref": "#/parameters/FilePath" - }, - { + "parameters": [{ "$ref": "#/parameters/OptionalBody" }, { @@ -2443,21 +2315,14 @@ ] }] }, - "/{shareName}/{filePath}?comp=rangelist": { + "/{shareName}/{directory}/{fileName}?comp=rangelist": { "get": { "tags": [ "file" ], "operationId": "File_GetRangeList", "description": "Returns the list of valid ranges for a file.", - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { - "$ref": "#/parameters/FilePath" - }, - { + "parameters": [{ "$ref": "#/parameters/ShareSnapshot" }, { @@ -2539,21 +2404,14 @@ ] }] }, - "/{shareName}/{filePath}?comp=copy": { + "/{shareName}/{directory}/{fileName}?comp=copy": { "put": { "tags": [ "file" ], "operationId": "File_StartCopy", "description": "Copies a blob or file to a destination file within the storage account.", - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { - "$ref": "#/parameters/FilePath" - }, - { + "parameters": [{ "$ref": "#/parameters/Timeout" }, { @@ -2635,21 +2493,14 @@ ] }, - "/{shareName}/{filePath}?comp=copy©id={CopyId}": { + "/{shareName}/{directory}/{fileName}?comp=copy©id={CopyId}": { "put": { "tags": [ "file" ], "operationId": "File_AbortCopy", "description": "Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata.", - "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { - "$ref": "#/parameters/FilePath" - }, - { + "parameters": [{ "$ref": "#/parameters/CopyId" }, { @@ -2707,7 +2558,7 @@ ] }] }, - "/{shareName}/{filePath}?comp=listhandles": { + "/{shareName}/{directory}/{fileName}?comp=listhandles": { "get":{ "tags": [ "file" @@ -2715,12 +2566,6 @@ "operationId": "File_ListHandles", "description": "Lists handles for file", "parameters":[ - { - "$ref": "#/parameters/ShareName" - }, - { - "$ref": "#/parameters/FilePath" - }, { "$ref": "#/parameters/Marker" }, @@ -2790,7 +2635,7 @@ } ] }, - "/{shareName}/{filePath}?comp=forceclosehandles": { + "/{shareName}/{directory}/{fileName}?comp=forceclosehandles": { "put": { "tags": [ "file" @@ -2798,12 +2643,6 @@ "operationId": "File_ForceCloseHandles", "description": "Closes all handles open for given file", "parameters": [ - { - "$ref": "#/parameters/ShareName" - }, - { - "$ref": "#/parameters/FilePath" - }, { "$ref": "#/parameters/Timeout" }, @@ -3383,9 +3222,6 @@ }, "Quota": { "type": "integer" - }, - "Metadata": { - "$ref": "#/definitions/Metadata" } } }, @@ -3397,9 +3233,8 @@ ], "properties": { "ShareUsageBytes": { - "description": "The approximate size of the data stored in bytes, rounded up to the nearest gigabyte. Note that this value may not include all recently created or recently resized files.", - "type": "integer", - "format": "int64" + "description": "The approximate size of the data stored in bytes. Note that this value may not include all recently created or recently resized files.", + "type": "integer" } } }, @@ -3434,7 +3269,7 @@ "name": "SignedIdentifiers" } }, - "FileServiceProperties": { + "StorageServiceProperties": { "description": "Storage service properties.", "type": "object", "properties": { @@ -3456,9 +3291,6 @@ "wrapped": true } } - }, - "xml": { - "name": "StorageServiceProperties" } } }, @@ -3469,10 +3301,7 @@ "in": "header", "description": "Specifies the version of the operation to use for this request.", "required": true, - "type": "string", - "enum": [ - "2018-11-09" - ] + "type": "string" }, "ContentLength": { "name": "Content-Length", @@ -3539,15 +3368,6 @@ }, "x-ms-parameter-location": "method" }, - "DirectoryPath": { - "name": "directoryPath", - "in": "path", - "description": "The path of the target directory.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method", - "x-ms-skip-url-encoding": false - }, "FileCacheControl": { "name": "x-ms-cache-control", "x-ms-client-name": "fileCacheControl", @@ -3621,15 +3441,6 @@ "name": "file-HTTP-headers" } }, - "FilePath": { - "name": "filePath", - "in": "path", - "description": "The path of the target file.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method", - "x-ms-skip-url-encoding": false - }, "FileType": { "name": "x-ms-type", "x-ms-client-name": "fileTypeConstant", @@ -3761,14 +3572,6 @@ }, "x-ms-parameter-location": "method" }, - "ShareName": { - "name": "shareName", - "in": "path", - "description": "The name of the target share.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, "ShareQuota": { "name": "x-ms-share-quota", "x-ms-client-name": "quota", @@ -3787,13 +3590,13 @@ "type": "string", "x-ms-parameter-location": "method" }, - "FileServiceProperties": { - "name": "FileServiceProperties", + "StorageServiceProperties": { + "name": "StorageServiceProperties", "in": "body", - "description": "The FileStorage properties.", + "description": "The StorageService properties.", "required": true, "schema": { - "$ref": "#/definitions/FileServiceProperties" + "$ref": "#/definitions/StorageServiceProperties" }, "x-ms-parameter-location": "method" }, diff --git a/sdk/storage/azure-storage-queue/pom.xml b/sdk/storage/azure-storage-queue/pom.xml index 8956e06c351c..f67c81028a75 100644 --- a/sdk/storage/azure-storage-queue/pom.xml +++ b/sdk/storage/azure-storage-queue/pom.xml @@ -15,7 +15,8 @@ azure-storage-queue 12.0.0-preview.3 - azure-storage-queue + Microsoft Azure client library for Queue Storage + This module contains client library for Microsoft Azure Queue Storage. https://github.com/Azure/azure-sdk-for-java @@ -53,20 +54,11 @@ 1.0.0-preview.4 test + - com.azure - azure-identity - 1.0.0-preview.3 - test - - - junit - junit - test - - - org.slf4j - slf4j-simple + org.spockframework + spock-core + 1.3-groovy-2.5 test @@ -74,10 +66,5 @@ reactor-test test - - com.microsoft.azure - adal4j - test - diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java index 659d128dc243..86931937896f 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java @@ -24,6 +24,7 @@ import com.azure.storage.queue.models.SignedIdentifier; import com.azure.storage.queue.models.StorageErrorException; import com.azure.storage.queue.models.UpdatedMessage; +import java.util.Objects; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -62,6 +63,7 @@ public final class QueueAsyncClient { * @param queueName Name of the queue */ QueueAsyncClient(AzureQueueStorageImpl client, String queueName) { + Objects.requireNonNull(queueName); this.queueName = queueName; this.client = new AzureQueueStorageBuilder().pipeline(client.getHttpPipeline()) @@ -79,6 +81,7 @@ public final class QueueAsyncClient { * @param queueName Name of the queue */ QueueAsyncClient(URL endpoint, HttpPipeline httpPipeline, String queueName) { + Objects.requireNonNull(queueName); this.queueName = queueName; this.client = new AzureQueueStorageBuilder().pipeline(httpPipeline) diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClientBuilder.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClientBuilder.java index 944bba023606..73583db7f684 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClientBuilder.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClientBuilder.java @@ -140,7 +140,6 @@ public QueueClient buildClient() { */ public QueueAsyncClient buildAsyncClient() { Objects.requireNonNull(endpoint); - Objects.requireNonNull(queueName); if (sasTokenCredential == null && sharedKeyCredential == null && bearerTokenCredential == null) { LOGGER.logExceptionAsError(new IllegalArgumentException("Credentials are required for authorization")); diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/AzureQueueStorageBuilder.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/AzureQueueStorageBuilder.java index bf79a8453997..d38e8c043629 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/AzureQueueStorageBuilder.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/AzureQueueStorageBuilder.java @@ -67,6 +67,9 @@ public AzureQueueStorageBuilder pipeline(HttpPipeline pipeline) { * @return an instance of AzureQueueStorageImpl. */ public AzureQueueStorageImpl build() { + if (version == null) { + this.version = "2018-03-28"; + } if (pipeline == null) { this.pipeline = RestProxy.createDefaultPipeline(); } @@ -76,8 +79,6 @@ public AzureQueueStorageImpl build() { } if (this.version != null) { client.setVersion(this.version); - } else { - client.setVersion("2018-03-28"); } return client; } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/AzureQueueStorageImpl.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/AzureQueueStorageImpl.java index 1ee2de77a19a..29b4b3a947e7 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/AzureQueueStorageImpl.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/AzureQueueStorageImpl.java @@ -29,9 +29,11 @@ public String getUrl() { * Sets The URL of the service account, queue or message that is the targe of the desired operation. * * @param url the url value. + * @return the service client itself. */ - void setUrl(String url) { + AzureQueueStorageImpl setUrl(String url) { this.url = url; + return this; } /** @@ -52,9 +54,11 @@ public String getVersion() { * Sets Specifies the version of the operation to use for this request. * * @param version the version value. + * @return the service client itself. */ - void setVersion(String version) { + AzureQueueStorageImpl setVersion(String version) { this.version = version; + return this; } /** diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/StorageErrorCode.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/StorageErrorCode.java index dfa27d5fed94..a7366b0a8b6b 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/StorageErrorCode.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/StorageErrorCode.java @@ -27,6 +27,11 @@ public final class StorageErrorCode extends ExpandableStringEnum new QueueClientBuilder() - .connectionString(connectionString) - .queueName(queueName) - .httpClient(interceptorManager.getPlaybackClient()) - .httpLogDetailLevel(HttpLogDetailLevel.BODY_AND_HEADERS) - .buildAsyncClient(), true, logger); - } else { - client = helper.setupClient((connectionString, endpoint) -> new QueueClientBuilder() - .connectionString(connectionString) - .queueName(queueName) - .httpClient(HttpClient.createDefault().wiretap(true)) - .httpLogDetailLevel(HttpLogDetailLevel.BODY_AND_HEADERS) - .addPolicy(interceptorManager.getRecordPolicy()) - .buildAsyncClient(), false, logger); - } - } - - @Override - protected void afterTest() { - try { - client.clearMessages().block(); - client.delete().block(); - } catch (StorageErrorException ex) { - // Queue already delete, that's what we wanted anyways. - } - } - - @Override - public void createWithSharedKey() { - - } - - @Override - public void createWithSASToken() { - // Need to find a way to get SAS tokens from the storage account - } - - @Override - public void createWithMetadata() { - Map metadata = new HashMap<>(); - metadata.put("metadata1", "value1"); - metadata.put("metadata2", "value2"); - - StepVerifier.create(client.create(metadata)) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.getProperties()) - .assertNext(response -> { - helper.assertResponseStatusCode(response, 200); - assertEquals(0, response.value().approximateMessagesCount()); - assertEquals(metadata, response.value().metadata()); - }) - .verifyComplete(); - } - - @Override - public void createTwiceSameMetadata() { - Map metadata = new HashMap<>(); - metadata.put("metadata1", "value1"); - metadata.put("metadata2", "value2"); - - StepVerifier.create(client.create(metadata)) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.create(metadata)) - .assertNext(response -> helper.assertResponseStatusCode(response, 204)) - .verifyComplete(); - } - - @Override - public void createTwiceDifferentMetadata() { - Map metadata = new HashMap<>(); - metadata.put("metadata1", "value1"); - metadata.put("metadata2", "value2"); - - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.create(metadata)) - .verifyErrorSatisfies(throwable -> helper.assertExceptionStatusCode(throwable, 409)); - } - - @Override - public void deleteExisting() { - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.enqueueMessage("This queue will be deleted")) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.delete()) - .assertNext(response -> helper.assertResponseStatusCode(response, 204)) - .verifyComplete(); - - helper.sleepInRecordMode(Duration.ofSeconds(30)); - - StepVerifier.create(client.enqueueMessage("This should fail")) - .verifyErrorSatisfies(throwable -> helper.assertExceptionStatusCode(throwable, 404)); - } - - @Override - public void deleteNonExistent() { - StepVerifier.create(client.delete()) - .verifyErrorSatisfies(throwable -> helper.assertExceptionStatusCode(throwable, 404)); - } - - @Override - public void getProperties() { - Map metadata = new HashMap<>(); - metadata.put("metadata1", "value1"); - metadata.put("metadata2", "value2"); - - StepVerifier.create(client.create(metadata)) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.getProperties()) - .assertNext(response -> { - helper.assertResponseStatusCode(response, 200); - assertEquals(0, response.value().approximateMessagesCount()); - assertEquals(metadata, response.value().metadata()); - }) - .verifyComplete(); - } - - @Override - public void getPropertiesQueueDoesNotExist() { - StepVerifier.create(client.getProperties()) - .verifyErrorSatisfies(throwable -> helper.assertExceptionStatusCode(throwable, 404)); - } - - @Override - public void setMetadata() { - Map metadata = new HashMap<>(); - metadata.put("metadata1", "value1"); - metadata.put("metadata2", "value2"); - - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.setMetadata(metadata)) - .assertNext(response -> helper.assertResponseStatusCode(response, 204)) - .verifyComplete(); - - StepVerifier.create(client.getProperties()) - .assertNext(response -> { - helper.assertResponseStatusCode(response, 200); - assertEquals(0, response.value().approximateMessagesCount()); - assertEquals(metadata, response.value().metadata()); - }) - .verifyComplete(); - } - - @Override - public void setMetadataQueueDoesNotExist() { - Map metadata = new HashMap<>(); - metadata.put("metadata1", "value1"); - metadata.put("metadata2", "value2"); - - StepVerifier.create(client.setMetadata(metadata)) - .verifyErrorSatisfies(throwable -> helper.assertExceptionStatusCode(throwable, 404)); - } - - @Override - public void setInvalidMetadata() { - Map badMetadata = Collections.singletonMap("", "bad metadata"); - - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.setMetadata(badMetadata)) - .verifyErrorSatisfies(throwable -> helper.assertExceptionStatusCode(throwable, 400)); - } - - @Override - public void deleteMetadata() { - Map metadata = new HashMap<>(); - metadata.put("metadata1", "value1"); - metadata.put("metadata2", "value2"); - - StepVerifier.create(client.create(metadata)) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.getProperties()) - .assertNext(response -> { - helper.assertResponseStatusCode(response, 200); - assertEquals(0, response.value().approximateMessagesCount()); - assertEquals(metadata, response.value().metadata()); - }) - .verifyComplete(); - - StepVerifier.create(client.setMetadata(null)) - .assertNext(response -> helper.assertResponseStatusCode(response, 204)) - .verifyComplete(); - - StepVerifier.create(client.getProperties()) - .assertNext(response -> { - helper.assertResponseStatusCode(response, 200); - assertEquals(Collections.EMPTY_MAP, response.value().metadata()); - }) - .verifyComplete(); - } - - @Override - public void getAccessPolicy() { - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.getAccessPolicy()) - .expectNextCount(0) - .verifyComplete(); - } - - @Override - public void getAccessPolicyQueueDoesNotExist() { - StepVerifier.create(client.getAccessPolicy()) - .verifyErrorSatisfies(throwable -> helper.assertExceptionStatusCode(throwable, 404)); - } - - @Override - public void setAccessPolicy() { - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - AccessPolicy accessPolicy = new AccessPolicy() - .permission("raup") - .start(OffsetDateTime.of(LocalDateTime.of(2000, 1, 1, 0, 0), ZoneOffset.UTC)) - .expiry(OffsetDateTime.of(LocalDateTime.of(2020, 1, 1, 0, 0), ZoneOffset.UTC)); - - SignedIdentifier permission = new SignedIdentifier() - .id("testpermission") - .accessPolicy(accessPolicy); - - StepVerifier.create(client.setAccessPolicy(Collections.singletonList(permission))) - .assertNext(response -> helper.assertResponseStatusCode(response, 204)) - .verifyComplete(); - - StepVerifier.create(client.getAccessPolicy()) - .assertNext(response -> helper.assertPermissionsAreEqual(permission, response)) - .verifyComplete(); - } - - @Override - public void setAccessPolicyQueueDoesNotExist() { - AccessPolicy accessPolicy = new AccessPolicy() - .permission("r") - .start(OffsetDateTime.now()) - .expiry(OffsetDateTime.now()); - - SignedIdentifier permission = new SignedIdentifier() - .id("test-permission") - .accessPolicy(accessPolicy); - - StepVerifier.create(client.setAccessPolicy(Collections.singletonList(permission))) - .verifyErrorSatisfies(throwable -> helper.assertExceptionStatusCode(throwable, 400)); - } - - @Override - public void setInvalidAccessPolicy() { - AccessPolicy accessPolicy = new AccessPolicy() - .permission("r") - .start(OffsetDateTime.of(LocalDateTime.of(2000, 1, 1, 0, 0), ZoneOffset.UTC)) - .expiry(OffsetDateTime.of(LocalDateTime.of(2020, 1, 1, 0, 0), ZoneOffset.UTC)); - - SignedIdentifier permission = new SignedIdentifier() - .id("theidofthispermissionislongerthanwhatisallowedbytheserviceandshouldfail") - .accessPolicy(accessPolicy); - - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.setAccessPolicy(Collections.singletonList(permission))) - .verifyErrorSatisfies(throwable -> helper.assertExceptionStatusCode(throwable, 400)); - } - - @Override - public void setTooManyAccessPolicies() { - AccessPolicy accessPolicy = new AccessPolicy() - .permission("r") - .start(OffsetDateTime.of(LocalDateTime.of(2000, 1, 1, 0, 0), ZoneOffset.UTC)) - .expiry(OffsetDateTime.of(LocalDateTime.of(2020, 1, 1, 0, 0), ZoneOffset.UTC)); - - List permissions = new ArrayList<>(); - for (int i = 0; i < 6; i++) { - permissions.add(new SignedIdentifier() - .id("policy" + i) - .accessPolicy(accessPolicy)); - } - - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.setAccessPolicy(permissions)) - .verifyErrorSatisfies(throwable -> helper.assertExceptionStatusCode(throwable, 400)); - } - - @Override - public void enqueueMessage() { - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - String messageText = "test message"; - StepVerifier.create(client.enqueueMessage(messageText)) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.peekMessages()) - .assertNext(peekedMessage -> assertEquals(messageText, peekedMessage.messageText())) - .verifyComplete(); - } - - @Override - public void enqueueEmptyMessage() { - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - String messageText = ""; - StepVerifier.create(client.enqueueMessage(messageText)) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.peekMessages()) - .assertNext(peekedMessage -> assertNull(peekedMessage.messageText())) - .verifyComplete(); - } - - @Override - public void enqueueShortTimeToLiveMessage() { - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - String messageText = "test message"; - StepVerifier.create(client.enqueueMessage(messageText, Duration.ofSeconds(0), Duration.ofSeconds(2))) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.peekMessages().delaySubscription(Duration.ofSeconds(5))) - .expectNextCount(0) - .verifyComplete(); - } - - @Override - public void enqueueQueueDoesNotExist() { - StepVerifier.create(client.enqueueMessage("this should fail")) - .verifyErrorSatisfies(throwable -> helper.assertExceptionStatusCode(throwable, 404)); - } - - @Override - public void dequeueMessage() { - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - String messageText = "test message"; - StepVerifier.create(client.enqueueMessage(messageText)) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.dequeueMessages()) - .assertNext(dequeuedMessage -> assertEquals(messageText, dequeuedMessage.messageText())) - .verifyComplete(); - } - - @Override - public void dequeueMultipleMessages() { - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - String messageText = "test message"; - String messageText2 = "test message 2"; - StepVerifier.create(client.enqueueMessage(messageText)) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.enqueueMessage(messageText2)) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.dequeueMessages(2)) - .assertNext(dequeuedMessage -> assertEquals(messageText, dequeuedMessage.messageText())) - .assertNext(dequeuedMessage -> assertEquals(messageText2, dequeuedMessage.messageText())) - .verifyComplete(); - } - - @Override - public void dequeueTooManyMessages() { - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.dequeueMessages(64)) - .verifyErrorSatisfies(throwable -> helper.assertExceptionStatusCode(throwable, 400)); - } - - @Override - public void dequeueQueueDoesNotExist() { - StepVerifier.create(client.dequeueMessages()) - .verifyErrorSatisfies(throwable -> helper.assertExceptionStatusCode(throwable, 404)); - } - - @Override - public void peekMessage() { - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - String messageText = "test message"; - StepVerifier.create(client.enqueueMessage(messageText)) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.peekMessages()) - .assertNext(peekedMessage -> assertEquals(messageText, peekedMessage.messageText())) - .verifyComplete(); - } - - @Override - public void peekMultipleMessages() { - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - String messageText = "test message"; - String messageText2 = "test message 2"; - StepVerifier.create(client.enqueueMessage(messageText)) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.enqueueMessage(messageText2)) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.peekMessages(2)) - .assertNext(peekedMessage -> assertEquals(messageText, peekedMessage.messageText())) - .assertNext(peekedMessage -> assertEquals(messageText2, peekedMessage.messageText())) - .verifyComplete(); - } - - @Override - public void peekTooManyMessages() { - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.peekMessages(64)) - .verifyErrorSatisfies(throwable -> helper.assertExceptionStatusCode(throwable, 400)); - } - - @Override - public void peekQueueDoesNotExist() { - StepVerifier.create(client.peekMessages()) - .verifyErrorSatisfies(throwable -> helper.assertExceptionStatusCode(throwable, 404)); - } - - @Override - public void clearMessages() { - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.enqueueMessage("test message")) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - StepVerifier.create(client.enqueueMessage("test message")) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - StepVerifier.create(client.enqueueMessage("test message")) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(client.getProperties()) - .assertNext(response -> { - helper.assertResponseStatusCode(response, 200); - assertEquals(3, response.value().approximateMessagesCount()); - }) - .verifyComplete(); - - StepVerifier.create(client.clearMessages()) - .assertNext(response -> helper.assertResponseStatusCode(response, 204)) - .verifyComplete(); - - StepVerifier.create(client.getProperties()) - .assertNext(response -> { - helper.assertResponseStatusCode(response, 200); - assertEquals(0, response.value().approximateMessagesCount()); - }) - .verifyComplete(); - } - - @Override - public void clearMessagesQueueDoesNotExist() { - StepVerifier.create(client.clearMessages()) - .verifyErrorSatisfies(throwable -> helper.assertExceptionStatusCode(throwable, 404)); - } - - @Override - public void deleteMessage() { - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - String messageText = "test message"; - StepVerifier.create(client.enqueueMessage(messageText)) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - DequeuedMessage dequeuedMessage = client.dequeueMessages().blockFirst(); - assertEquals(messageText, dequeuedMessage.messageText()); - StepVerifier.create(client.deleteMessage(dequeuedMessage.messageId(), dequeuedMessage.popReceipt())) - .assertNext(response -> helper.assertResponseStatusCode(response, 204)) - .verifyComplete(); - - StepVerifier.create(client.getProperties()) - .assertNext(response -> { - helper.assertResponseStatusCode(response, 200); - assertEquals(0, response.value().approximateMessagesCount()); - }) - .verifyComplete(); - } - - @Override - public void deleteMessageInvalidMessageId() { - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - String messageText = "test message"; - StepVerifier.create(client.enqueueMessage(messageText)) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - DequeuedMessage dequeuedMessage = new DequeuedMessage(); - StepVerifier.create(client.dequeueMessages()) - .assertNext(response -> { - assertEquals(messageText, response.messageText()); - dequeuedMessage.popReceipt(response.popReceipt()).messageId(response.messageId()); - }) - .verifyComplete(); - - StepVerifier.create(client.deleteMessage(dequeuedMessage.messageId() + "random", dequeuedMessage.popReceipt())) - .verifyErrorSatisfies(throwable -> helper.assertExceptionStatusCode(throwable, 404)); - } - - @Override - public void deleteMessageInvalidPopReceipt() { - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - String messageText = "test message"; - StepVerifier.create(client.enqueueMessage(messageText)) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - DequeuedMessage dequeuedMessage = new DequeuedMessage(); - StepVerifier.create(client.dequeueMessages()) - .assertNext(response -> { - assertEquals(messageText, response.messageText()); - dequeuedMessage.popReceipt(response.popReceipt()).messageId(response.messageId()); - }) - .verifyComplete(); - - StepVerifier.create(client.deleteMessage(dequeuedMessage.messageId(), dequeuedMessage.popReceipt() + "random")) - .verifyErrorSatisfies(throwable -> helper.assertExceptionStatusCode(throwable, 400)); - } - - @Override - public void deleteMessageQueueDoesNotExist() { - StepVerifier.create(client.deleteMessage("invalid", "call")) - .verifyErrorSatisfies(throwable -> helper.assertExceptionStatusCode(throwable, 404)); - } - - @Override - public void updateMessage() { - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - String messageText = "test message"; - StepVerifier.create(client.enqueueMessage(messageText)) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - DequeuedMessage dequeuedMessage = client.dequeueMessages().blockFirst(); - assertEquals(messageText, dequeuedMessage.messageText()); - - String updatedMessageText = "updated test message"; - StepVerifier.create(client.updateMessage(updatedMessageText, dequeuedMessage.messageId(), dequeuedMessage.popReceipt(), Duration.ofSeconds(1))) - .assertNext(response -> helper.assertResponseStatusCode(response, 204)) - .verifyComplete(); - - StepVerifier.create(client.peekMessages().delaySubscription(Duration.ofSeconds(2))) - .assertNext(response -> assertEquals(updatedMessageText, response.messageText())) - .verifyComplete(); - } - - @Override - public void updateMessageInvalidMessageId() { - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - String messageText = "test message"; - StepVerifier.create(client.enqueueMessage(messageText)) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - DequeuedMessage dequeuedMessage = client.dequeueMessages().blockFirst(); - assertEquals(messageText, dequeuedMessage.messageText()); - - String updatedMessageText = "updated test message"; - StepVerifier.create(client.updateMessage(updatedMessageText, dequeuedMessage.messageId() + "random", dequeuedMessage.popReceipt(), Duration.ofSeconds(1))) - .verifyErrorSatisfies(throwable -> helper.assertExceptionStatusCode(throwable, 404)); - } - - @Override - public void updateMessageInvalidPopReceipt() { - StepVerifier.create(client.create()) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - String messageText = "test message"; - StepVerifier.create(client.enqueueMessage(messageText)) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - DequeuedMessage dequeuedMessage = client.dequeueMessages().blockFirst(); - assertEquals(messageText, dequeuedMessage.messageText()); - - String updatedMessageText = "updated test message"; - StepVerifier.create(client.updateMessage(updatedMessageText, dequeuedMessage.messageId(), dequeuedMessage.popReceipt() + "random", Duration.ofSeconds(1))) - .verifyErrorSatisfies(throwable -> helper.assertExceptionStatusCode(throwable, 400)); - } - - @Override - public void updateMessageQueueDoesNotExist() { - StepVerifier.create(client.updateMessage("queue", "doesn't", "exist", Duration.ofSeconds(5))) - .verifyErrorSatisfies(throwable -> helper.assertExceptionStatusCode(throwable, 400)); - } -} diff --git a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueClientTests.java b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueClientTests.java deleted file mode 100644 index 4e3f782d7ec6..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueClientTests.java +++ /dev/null @@ -1,653 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.storage.queue; - -import com.azure.core.http.HttpClient; -import com.azure.core.http.policy.HttpLogDetailLevel; -import com.azure.core.http.rest.Response; -import com.azure.core.util.logging.ClientLogger; -import com.azure.storage.queue.models.AccessPolicy; -import com.azure.storage.queue.models.DequeuedMessage; -import com.azure.storage.queue.models.PeekedMessage; -import com.azure.storage.queue.models.QueueProperties; -import com.azure.storage.queue.models.SignedIdentifier; -import com.azure.storage.queue.models.StorageErrorException; -import com.azure.storage.queue.models.UpdatedMessage; - -import java.time.Duration; -import java.time.LocalDateTime; -import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.fail; - -public class QueueClientTests extends QueueClientTestsBase { - private final ClientLogger logger = new ClientLogger(QueueClientTests.class); - - private QueueClient client; - - @Override - protected void beforeTest() { - queueName = getQueueName(); - helper = new TestHelpers(); - - if (interceptorManager.isPlaybackMode()) { - client = helper.setupClient((connectionString, endpoint) -> new QueueClientBuilder() - .connectionString(connectionString) - .queueName(queueName) - .httpClient(interceptorManager.getPlaybackClient()) - .httpLogDetailLevel(HttpLogDetailLevel.BODY_AND_HEADERS) - .buildClient(), true, logger); - } else { - client = helper.setupClient((connectionString, endpoint) -> new QueueClientBuilder() - .connectionString(connectionString) - .queueName(queueName) - .httpClient(HttpClient.createDefault().wiretap(true)) - .httpLogDetailLevel(HttpLogDetailLevel.BODY_AND_HEADERS) - .addPolicy(interceptorManager.getRecordPolicy()) - .buildClient(), false, logger); - } - } - - @Override - protected void afterTest() { - try { - client.clearMessages(); - client.delete(); - } catch (StorageErrorException ex) { - // Queue already delete, that's what we wanted anyways. - } - } - - @Override - public void createWithSharedKey() { - - } - - @Override - public void createWithSASToken() { - // Need to find a way to get SAS tokens from the storage account - } - - @Override - public void createWithMetadata() { - Map metadata = new HashMap<>(); - metadata.put("metadata1", "value1"); - metadata.put("metadata2", "value2"); - - helper.assertResponseStatusCode(client.create(metadata), 201); - - QueueProperties properties = client.getProperties().value(); - assertEquals(metadata, properties.metadata()); - } - - @Override - public void createTwiceSameMetadata() { - Map metadata = new HashMap<>(); - metadata.put("metadata1", "value1"); - metadata.put("metadata2", "value2"); - - helper.assertResponseStatusCode(client.create(metadata), 201); - helper.assertResponseStatusCode(client.create(metadata), 204); - } - - @Override - public void createTwiceDifferentMetadata() { - Map metadata = new HashMap<>(); - metadata.put("metadata1", "value1"); - metadata.put("metadata2", "value2"); - - helper.assertResponseStatusCode(client.create(), 201); - - try { - client.create(metadata); - fail("Creating a queue twice with different metadata values should throw an exception."); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 409); - } - } - - @Override - public void deleteExisting() { - helper.assertResponseStatusCode(client.create(), 201); - helper.assertResponseStatusCode(client.enqueueMessage("This queue will be deleted"), 201); - helper.assertResponseStatusCode(client.delete(), 204); - - helper.sleepInRecordMode(Duration.ofSeconds(30)); - - try { - client.enqueueMessage("This should fail"); - fail("Attempting to work with a queue that has been deleted should throw an exception."); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 404); - } - } - - @Override - public void deleteNonExistent() { - try { - client.delete(); - fail("Attempting to delete a queue that doesn't exist should throw an exception"); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 404); - } - } - - @Override - public void getProperties() { - Map metadata = new HashMap<>(); - metadata.put("metadata1", "value1"); - metadata.put("metadata2", "value2"); - - helper.assertResponseStatusCode(client.create(metadata), 201); - - Response response = client.getProperties(); - helper.assertResponseStatusCode(response, 200); - assertEquals(0, response.value().approximateMessagesCount()); - assertEquals(metadata, response.value().metadata()); - } - - @Override - public void getPropertiesQueueDoesNotExist() { - try { - client.getProperties(); - fail("Attempting to get properties of a queue that doesn't exist should throw an exception"); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 404); - } - } - - @Override - public void setMetadata() { - Map metadata = new HashMap<>(); - metadata.put("metadata1", "value1"); - metadata.put("metadata2", "value2"); - - helper.assertResponseStatusCode(client.create(), 201); - - helper.assertResponseStatusCode(client.setMetadata(metadata), 204); - - Response response = client.getProperties(); - helper.assertResponseStatusCode(response, 200); - assertEquals(0, response.value().approximateMessagesCount()); - assertEquals(metadata, response.value().metadata()); - } - - @Override - public void setMetadataQueueDoesNotExist() { - Map metadata = new HashMap<>(); - metadata.put("metadata1", "value1"); - metadata.put("metadata2", "value2"); - - try { - client.setMetadata(metadata); - fail("Attempting to set metadata on a queue that doesn't exist should throw an exception"); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 404); - } - } - - @Override - public void setInvalidMetadata() { - Map badMetadata = Collections.singletonMap("", "bad metadata"); - - helper.assertResponseStatusCode(client.create(), 201); - try { - client.setMetadata(badMetadata); - fail("Attempting to set invalid metadata on a queue that doesn't exist should throw an exception"); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 400); - } - } - - @Override - public void deleteMetadata() { - Map metadata = new HashMap<>(); - metadata.put("metadata1", "value1"); - metadata.put("metadata2", "value2"); - - helper.assertResponseStatusCode(client.create(metadata), 201); - - Response response = client.getProperties(); - helper.assertResponseStatusCode(response, 200); - assertEquals(0, response.value().approximateMessagesCount()); - assertEquals(metadata, response.value().metadata()); - - helper.assertResponseStatusCode(client.setMetadata(null), 204); - - response = client.getProperties(); - helper.assertResponseStatusCode(response, 200); - assertEquals(0, response.value().approximateMessagesCount()); - assertEquals(Collections.EMPTY_MAP, response.value().metadata()); - } - - @Override - public void getAccessPolicy() { - helper.assertResponseStatusCode(client.create(), 201); - - Iterable accessPolicies = client.getAccessPolicy(); - assertFalse(accessPolicies.iterator().hasNext()); - } - - @Override - public void getAccessPolicyQueueDoesNotExist() { - try { - client.getAccessPolicy().iterator().hasNext(); - fail("Attempting to get access policies on a queue that doesn't exist should throw an exception"); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 404); - } - } - - @Override - public void setAccessPolicy() { - helper.assertResponseStatusCode(client.create(), 201); - - AccessPolicy accessPolicy = new AccessPolicy() - .permission("raup") - .start(OffsetDateTime.of(LocalDateTime.of(2000, 1, 1, 0, 0), ZoneOffset.UTC)) - .expiry(OffsetDateTime.of(LocalDateTime.of(2020, 1, 1, 0, 0), ZoneOffset.UTC)); - - SignedIdentifier permission = new SignedIdentifier() - .id("testpermission") - .accessPolicy(accessPolicy); - - helper.assertResponseStatusCode(client.setAccessPolicy(Collections.singletonList(permission)), 204); - - Iterator accessPolicies = client.getAccessPolicy().iterator(); - helper.assertPermissionsAreEqual(permission, accessPolicies.next()); - assertFalse(accessPolicies.hasNext()); - } - - @Override - public void setAccessPolicyQueueDoesNotExist() { - AccessPolicy accessPolicy = new AccessPolicy() - .permission("r") - .start(OffsetDateTime.now()) - .expiry(OffsetDateTime.now()); - - SignedIdentifier permission = new SignedIdentifier() - .id("test-permission") - .accessPolicy(accessPolicy); - - try { - client.setAccessPolicy(Collections.singletonList(permission)); - fail("Attempting to set access policies on a queue that doesn't exist should throw an exception"); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 400); - } - } - - @Override - public void setInvalidAccessPolicy() { - AccessPolicy accessPolicy = new AccessPolicy() - .permission("r") - .start(OffsetDateTime.of(LocalDateTime.of(2000, 1, 1, 0, 0), ZoneOffset.UTC)) - .expiry(OffsetDateTime.of(LocalDateTime.of(2020, 1, 1, 0, 0), ZoneOffset.UTC)); - - SignedIdentifier permission = new SignedIdentifier() - .id("theidofthispermissionislongerthanwhatisallowedbytheserviceandshouldfail") - .accessPolicy(accessPolicy); - - helper.assertResponseStatusCode(client.create(), 201); - - try { - client.setAccessPolicy(Collections.singletonList(permission)); - fail("Attempting to set invalid access policies on a queue that doesn't exist should throw an exception"); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 400); - } - } - - @Override - public void setTooManyAccessPolicies() { - List permissions = new ArrayList<>(); - - AccessPolicy accessPolicy = new AccessPolicy() - .permission("r") - .start(OffsetDateTime.of(LocalDateTime.of(2000, 1, 1, 0, 0), ZoneOffset.UTC)) - .expiry(OffsetDateTime.of(LocalDateTime.of(2020, 1, 1, 0, 0), ZoneOffset.UTC)); - - for (int i = 0; i < 6; i++) { - permissions.add(new SignedIdentifier() - .id("policy" + i) - .accessPolicy(accessPolicy)); - } - - helper.assertResponseStatusCode(client.create(), 201); - - try { - client.setAccessPolicy(permissions); - fail("Attempting to set more than five access policies on a queue that doesn't exist should throw an exception"); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 400); - } - } - - @Override - public void enqueueMessage() { - helper.assertResponseStatusCode(client.create(), 201); - - String messageText = "test message"; - helper.assertResponseStatusCode(client.enqueueMessage(messageText), 201); - - Iterator response = client.peekMessages().iterator(); - assertEquals(messageText, response.next().messageText()); - assertFalse(response.hasNext()); - } - - @Override - public void enqueueEmptyMessage() { - helper.assertResponseStatusCode(client.create(), 201); - - String messageText = ""; - helper.assertResponseStatusCode(client.enqueueMessage(messageText), 201); - - Iterator response = client.peekMessages().iterator(); - assertNull(response.next().messageText()); - assertFalse(response.hasNext()); - } - - @Override - public void enqueueShortTimeToLiveMessage() { - helper.assertResponseStatusCode(client.create(), 201); - - String messageText = "test message"; - helper.assertResponseStatusCode(client.enqueueMessage(messageText, Duration.ofSeconds(0), Duration.ofSeconds(2)), 201); - - helper.sleepInRecordMode(Duration.ofSeconds(5)); - Iterator response = client.peekMessages().iterator(); - assertFalse(response.hasNext()); - } - - @Override - public void enqueueQueueDoesNotExist() { - try { - client.enqueueMessage("This should fail"); - fail("Attempting to enqueue a message on a queue that doesn't exist should throw an exception"); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 404); - } - } - - @Override - public void dequeueMessage() { - helper.assertResponseStatusCode(client.create(), 201); - - String messageText = "test message"; - helper.assertResponseStatusCode(client.enqueueMessage(messageText), 201); - - Iterator response = client.dequeueMessages().iterator(); - assertEquals(messageText, response.next().messageText()); - assertFalse(response.hasNext()); - } - - @Override - public void dequeueMultipleMessages() { - helper.assertResponseStatusCode(client.create(), 201); - - String messageText = "test message"; - String messageText2 = "test message 2"; - helper.assertResponseStatusCode(client.enqueueMessage(messageText), 201); - helper.assertResponseStatusCode(client.enqueueMessage(messageText2), 201); - - Iterator response = client.dequeueMessages(2).iterator(); - assertEquals(messageText, response.next().messageText()); - assertEquals(messageText2, response.next().messageText()); - assertFalse(response.hasNext()); - } - - @Override - public void dequeueTooManyMessages() { - helper.assertResponseStatusCode(client.create(), 201); - - try { - client.dequeueMessages(64).iterator().hasNext(); - fail("Attempting to get more than 32 messages from a queue should throw an exception"); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 400); - } - } - - @Override - public void dequeueQueueDoesNotExist() { - try { - client.dequeueMessages().iterator().hasNext(); - fail("Attempting to get messages from a queue that doesn't exist should throw an exception"); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 404); - } - } - - @Override - public void peekMessage() { - helper.assertResponseStatusCode(client.create(), 201); - - String messageText = "test message"; - helper.assertResponseStatusCode(client.enqueueMessage(messageText), 201); - - Iterator response = client.peekMessages().iterator(); - assertEquals(messageText, response.next().messageText()); - assertFalse(response.hasNext()); - } - - @Override - public void peekMultipleMessages() { - helper.assertResponseStatusCode(client.create(), 201); - - String messageText = "test message"; - String messageText2 = "test message 2"; - helper.assertResponseStatusCode(client.enqueueMessage(messageText), 201); - helper.assertResponseStatusCode(client.enqueueMessage(messageText2), 201); - - Iterator response = client.peekMessages(2).iterator(); - assertEquals(messageText, response.next().messageText()); - assertEquals(messageText2, response.next().messageText()); - assertFalse(response.hasNext()); - } - - @Override - public void peekTooManyMessages() { - helper.assertResponseStatusCode(client.create(), 201); - - try { - client.peekMessages(64).iterator().hasNext(); - fail("Attempting to peek more than 32 messages from a queue should throw an exception"); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 400); - } - } - - @Override - public void peekQueueDoesNotExist() { - try { - client.peekMessages().iterator().hasNext(); - fail("Attempting to peek messages from a queue that doesn't exist should throw an exception"); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 404); - } - } - - @Override - public void clearMessages() { - helper.assertResponseStatusCode(client.create(), 201); - - for (int i = 0; i < 3; i++) { - helper.assertResponseStatusCode(client.enqueueMessage("test message"), 201); - } - - Response response = client.getProperties(); - helper.assertResponseStatusCode(response, 200); - assertEquals(3, response.value().approximateMessagesCount()); - - helper.assertResponseStatusCode(client.clearMessages(), 204); - - response = client.getProperties(); - helper.assertResponseStatusCode(response, 200); - assertEquals(0, response.value().approximateMessagesCount()); - } - - @Override - public void clearMessagesQueueDoesNotExist() { - try { - client.clearMessages(); - fail("Attempting to clear messages of a queue that doesn't exist should throw an exception"); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 404); - } - } - - @Override - public void deleteMessage() { - helper.assertResponseStatusCode(client.create(), 201); - - String messageText = "test message"; - helper.assertResponseStatusCode(client.enqueueMessage(messageText), 201); - - Iterator response = client.dequeueMessages().iterator(); - DequeuedMessage message = response.next(); - assertFalse(response.hasNext()); - assertEquals(messageText, message.messageText()); - - helper.assertResponseStatusCode(client.deleteMessage(message.messageId(), message.popReceipt()), 204); - - Response propertiesResponse = client.getProperties(); - helper.assertResponseStatusCode(propertiesResponse, 200); - assertEquals(0, propertiesResponse.value().approximateMessagesCount()); - } - - @Override - public void deleteMessageInvalidMessageId() { - helper.assertResponseStatusCode(client.create(), 201); - - String messageText = "test message"; - helper.assertResponseStatusCode(client.enqueueMessage(messageText), 201); - - Iterator response = client.dequeueMessages().iterator(); - DequeuedMessage message = response.next(); - assertFalse(response.hasNext()); - assertEquals(messageText, message.messageText()); - - try { - client.deleteMessage(message.messageId() + "random", message.popReceipt()); - fail("Attempting to delete a message with an invalid ID should throw an exception."); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 404); - } - } - - @Override - public void deleteMessageInvalidPopReceipt() { - helper.assertResponseStatusCode(client.create(), 201); - - String messageText = "test message"; - helper.assertResponseStatusCode(client.enqueueMessage(messageText), 201); - - Iterator response = client.dequeueMessages().iterator(); - DequeuedMessage message = response.next(); - assertFalse(response.hasNext()); - assertEquals(messageText, message.messageText()); - - try { - client.deleteMessage(message.messageId(), message.popReceipt() + "random"); - fail("Attempting to delete a message with an invalid popReceipt should throw an exception."); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 400); - } - } - - @Override - public void deleteMessageQueueDoesNotExist() { - try { - client.deleteMessage("invalid", "call"); - fail("Attempting to delete a message from a queue that doesn't exist should throw an exception."); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 404); - } - } - - @Override - public void updateMessage() { - helper.assertResponseStatusCode(client.create(), 201); - - String messageText = "test message"; - helper.assertResponseStatusCode(client.enqueueMessage(messageText), 201); - - Iterator response = client.dequeueMessages().iterator(); - DequeuedMessage message = response.next(); - assertEquals(messageText, message.messageText()); - assertFalse(response.hasNext()); - - String updatedMessageText = "updated test message"; - Response updatedMessageResponse = client.updateMessage(updatedMessageText, message.messageId(), message.popReceipt(), Duration.ofSeconds(1)); - helper.assertResponseStatusCode(updatedMessageResponse, 204); - - helper.sleepInRecordMode(Duration.ofSeconds(2)); - - Iterator peekedMessageIterator = client.peekMessages().iterator(); - PeekedMessage peekedMessage = peekedMessageIterator.next(); - assertEquals(updatedMessageText, peekedMessage.messageText()); - assertFalse(peekedMessageIterator.hasNext()); - } - - @Override - public void updateMessageInvalidMessageId() { - helper.assertResponseStatusCode(client.create(), 201); - - String messageText = "test message"; - helper.assertResponseStatusCode(client.enqueueMessage(messageText), 201); - - Iterator response = client.dequeueMessages().iterator(); - DequeuedMessage message = response.next(); - assertEquals(messageText, message.messageText()); - assertFalse(response.hasNext()); - - String updatedMessageText = "updated test message"; - try { - client.updateMessage(updatedMessageText, message.messageId() + "random", message.popReceipt(), Duration.ofSeconds(1)); - fail("Attempting to update a message with an invalid ID should throw an exception."); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 404); - } - } - - @Override - public void updateMessageInvalidPopReceipt() { - helper.assertResponseStatusCode(client.create(), 201); - - String messageText = "test message"; - helper.assertResponseStatusCode(client.enqueueMessage(messageText), 201); - - Iterator response = client.dequeueMessages().iterator(); - DequeuedMessage message = response.next(); - assertEquals(messageText, message.messageText()); - assertFalse(response.hasNext()); - - String updatedMessageText = "updated test message"; - try { - client.updateMessage(updatedMessageText, message.messageId(), message.popReceipt() + "random", Duration.ofSeconds(1)); - fail("Attempting to update a message with an invalid popReceipt should throw an exception."); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 400); - } - } - - @Override - public void updateMessageQueueDoesNotExist() { - try { - client.updateMessage("queue", "doesn't", "exist", Duration.ofSeconds(5)); - fail("Attempting to update a message on a queue that doesn't exist should throw an exception."); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 400); - } - } -} diff --git a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueClientTestsBase.java b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueClientTestsBase.java deleted file mode 100644 index b83d9a1459bb..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueClientTestsBase.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.storage.queue; - -import com.azure.core.test.TestBase; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TestName; - -public abstract class QueueClientTestsBase extends TestBase { - String queueName; - TestHelpers helper; - - @Rule - public TestName testName = new TestName(); - - @Override - public String testName() { - return testName.getMethodName(); - } - - String getQueueName() { - return testResourceNamer.randomName("queue", 16).toLowerCase(); - } - - @Test - public abstract void createWithSharedKey(); - - @Test - public abstract void createWithSASToken(); - - @Test - public abstract void createWithMetadata(); - - @Test - public abstract void createTwiceSameMetadata(); - - @Test - public abstract void createTwiceDifferentMetadata(); - - @Test - public abstract void deleteExisting(); - - @Test - public abstract void deleteNonExistent(); - - @Test - public abstract void getProperties(); - - @Test - public abstract void getPropertiesQueueDoesNotExist(); - - @Test - public abstract void setMetadata(); - - @Test - public abstract void setMetadataQueueDoesNotExist(); - - @Test - public abstract void setInvalidMetadata(); - - @Test - public abstract void deleteMetadata(); - - @Test - public abstract void getAccessPolicy(); - - @Test - public abstract void getAccessPolicyQueueDoesNotExist(); - - @Test - public abstract void setAccessPolicy(); - - @Test - public abstract void setAccessPolicyQueueDoesNotExist(); - - @Test - public abstract void setInvalidAccessPolicy(); - - @Test - public abstract void setTooManyAccessPolicies(); - - @Test - public abstract void enqueueMessage(); - - @Test - public abstract void enqueueEmptyMessage(); - - @Test - public abstract void enqueueShortTimeToLiveMessage(); - - @Test - public abstract void enqueueQueueDoesNotExist(); - - @Test - public abstract void dequeueMessage(); - - @Test - public abstract void dequeueMultipleMessages(); - - @Test - public abstract void dequeueTooManyMessages(); - - @Test - public abstract void dequeueQueueDoesNotExist(); - - @Test - public abstract void peekMessage(); - - @Test - public abstract void peekMultipleMessages(); - - @Test - public abstract void peekTooManyMessages(); - - @Test - public abstract void peekQueueDoesNotExist(); - - @Test - public abstract void clearMessages(); - - @Test - public abstract void clearMessagesQueueDoesNotExist(); - - @Test - public abstract void deleteMessage(); - - @Test - public abstract void deleteMessageInvalidMessageId(); - - @Test - public abstract void deleteMessageInvalidPopReceipt(); - - @Test - public abstract void deleteMessageQueueDoesNotExist(); - - @Test - public abstract void updateMessage(); - - @Test - public abstract void updateMessageInvalidMessageId(); - - @Test - public abstract void updateMessageInvalidPopReceipt(); - - @Test - public abstract void updateMessageQueueDoesNotExist(); -} diff --git a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueServiceAsyncClientTests.java b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueServiceAsyncClientTests.java deleted file mode 100644 index 1be35f6a8910..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueServiceAsyncClientTests.java +++ /dev/null @@ -1,251 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.storage.queue; - -import com.azure.core.http.HttpClient; -import com.azure.core.http.policy.HttpLogDetailLevel; -import com.azure.core.util.logging.ClientLogger; -import com.azure.storage.queue.models.Logging; -import com.azure.storage.queue.models.Metrics; -import com.azure.storage.queue.models.QueueItem; -import com.azure.storage.queue.models.QueuesSegmentOptions; -import com.azure.storage.queue.models.RetentionPolicy; -import com.azure.storage.queue.models.StorageErrorException; -import com.azure.storage.queue.models.StorageServiceProperties; -import reactor.test.StepVerifier; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.Map; - -import static org.junit.Assert.assertEquals; - -public class QueueServiceAsyncClientTests extends QueueServiceClientTestsBase { - private final ClientLogger logger = new ClientLogger(QueueServiceAsyncClientTests.class); - - private QueueServiceAsyncClient serviceClient; - - @Override - protected void beforeTest() { - queueName = getQueueName(); - helper = new TestHelpers(); - - if (interceptorManager.isPlaybackMode()) { - serviceClient = helper.setupClient((connectionString, endpoint) -> new QueueServiceClientBuilder() - .connectionString(connectionString) - .httpClient(interceptorManager.getPlaybackClient()) - .httpLogDetailLevel(HttpLogDetailLevel.BODY_AND_HEADERS) - .buildAsyncClient(), true, logger); - } else { - serviceClient = helper.setupClient((connectionString, endpoint) -> new QueueServiceClientBuilder() - .connectionString(connectionString) - .httpClient(HttpClient.createDefault().wiretap(true)) - .httpLogDetailLevel(HttpLogDetailLevel.BODY_AND_HEADERS) - .addPolicy(interceptorManager.getRecordPolicy()) - .buildAsyncClient(), false, logger); - } - } - - @Override - protected void afterTest() { - serviceClient.listQueues(new QueuesSegmentOptions().prefix(queueName)) - .collectList() - .block() - .forEach(queue -> { - QueueAsyncClient client = serviceClient.getQueueAsyncClient(queue.name()); - try { - client.clearMessages().then(client.delete()).block(); - } catch (StorageErrorException ex) { - // Queue already delete, that's what we wanted anyways. - } - }); - } - - @Override - public void getQueueDoesNotCreateAQueue() { - StepVerifier.create(serviceClient.getQueueAsyncClient(queueName).enqueueMessage("Expecting an exception")); - } - - @Override - public void createQueue() { - StepVerifier.create(serviceClient.createQueue(queueName).block().value().enqueueMessage("Testing service client creating a queue")) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - } - - @Override - public void createQueueWithMetadata() { - Map metadata = new HashMap<>(); - metadata.put("metadata1", "value1"); - metadata.put("metadata2", "value2"); - QueueAsyncClient client = serviceClient.createQueue(queueName, metadata).block().value(); - - StepVerifier.create(client.getProperties()) - .assertNext(response -> { - assertEquals(metadata, response.value().metadata()); - }) - .verifyComplete(); - } - - @Override - public void createQueueTwiceSameMetadata() { - final String messageText = "Testing service client creating the same queue twice does not modify the queue"; - Map metadata = new HashMap<>(); - metadata.put("metadata1", "value1"); - metadata.put("metadata2", "value2"); - - StepVerifier.create(serviceClient.createQueue(queueName, metadata).block().value().enqueueMessage(messageText)) - .assertNext(response -> helper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - - StepVerifier.create(serviceClient.createQueue(queueName, metadata).block().value().peekMessages()) - .assertNext(response -> assertEquals(messageText, response.messageText())) - .verifyComplete(); - } - - @Override - public void createQueueTwiceDifferentMetadata() { - Map metadata = new HashMap<>(); - metadata.put("metadata1", "value1"); - metadata.put("metadata2", "value2"); - - try { - serviceClient.createQueue(queueName); - serviceClient.createQueue(queueName, metadata); - } catch (Exception exception) { - } - } - - @Override - public void deleteExistingQueue() { - QueueAsyncClient client = serviceClient.createQueue(queueName).block().value(); - serviceClient.deleteQueue(queueName).block(); - - StepVerifier.create(client.enqueueMessage("Expecting an exception")); - } - - @Override - public void deleteNonExistentQueue() { - try { - serviceClient.deleteQueue(queueName); - } catch (Exception exception) { - } - } - - @Override - public void listQueues() { - LinkedList testQueues = new LinkedList<>(); - for (int i = 0; i < 3; i++) { - QueueItem queue = new QueueItem().name(queueName + i); - testQueues.add(queue); - serviceClient.createQueue(queue.name(), queue.metadata()).block(); - } - - StepVerifier.create(serviceClient.listQueues(defaultSegmentOptions())) - .assertNext(result -> helper.assertQueuesAreEqual(testQueues.pop(), result)) - .assertNext(result -> helper.assertQueuesAreEqual(testQueues.pop(), result)) - .assertNext(result -> helper.assertQueuesAreEqual(testQueues.pop(), result)) - .verifyComplete(); - } - - @Override - public void listQueuesIncludeMetadata() { - Map metadata = new HashMap<>(); - metadata.put("metadata1", "value1"); - metadata.put("metadata2", "value2"); - - LinkedList testQueues = new LinkedList<>(); - for (int i = 0; i < 3; i++) { - QueueItem queue = new QueueItem().name(queueName + i); - if (i % 2 == 0) { - queue.metadata(metadata); - } - - testQueues.add(queue); - serviceClient.createQueue(queue.name(), queue.metadata()).block(); - } - - StepVerifier.create(serviceClient.listQueues(defaultSegmentOptions().includeMetadata(true))) - .assertNext(result -> helper.assertQueuesAreEqual(testQueues.pop(), result)) - .assertNext(result -> helper.assertQueuesAreEqual(testQueues.pop(), result)) - .assertNext(result -> helper.assertQueuesAreEqual(testQueues.pop(), result)) - .verifyComplete(); - } - - @Override - public void listQueuesWithPrefix() { - LinkedList testQueues = new LinkedList<>(); - for (int i = 0; i < 3; i++) { - QueueItem queue = new QueueItem(); - if (i % 2 == 0) { - queue.name(queueName + "prefix" + i); - testQueues.add(queue); - } else { - queue.name(queueName + i); - } - - serviceClient.createQueue(queue.name(), queue.metadata()).block(); - } - - StepVerifier.create(serviceClient.listQueues(defaultSegmentOptions().prefix(queueName + "prefix"))) - .assertNext(result -> helper.assertQueuesAreEqual(testQueues.pop(), result)) - .assertNext(result -> helper.assertQueuesAreEqual(testQueues.pop(), result)) - .verifyComplete(); - } - - @Override - public void listQueuesWithLimit() { - LinkedList testQueues = new LinkedList<>(); - for (int i = 0; i < 3; i++) { - QueueItem queue = new QueueItem().name(queueName + i); - testQueues.add(queue); - serviceClient.createQueue(queue.name(), queue.metadata()).block(); - } - - StepVerifier.create(serviceClient.listQueues(defaultSegmentOptions().maxResults(2))) - .assertNext(queueItem -> helper.assertQueuesAreEqual(queueItem, testQueues.pop())) - .assertNext(queueItem -> helper.assertQueuesAreEqual(queueItem, testQueues.pop())) - .assertNext(queueItem -> helper.assertQueuesAreEqual(queueItem, testQueues.pop())) - .verifyComplete(); - } - - @Override - public void setProperties() { - StorageServiceProperties originalProperties = serviceClient.getProperties().block().value(); - - RetentionPolicy retentionPolicy = new RetentionPolicy().enabled(true) - .days(3); - - Logging logging = new Logging().version("1.0") - .delete(true) - .write(true) - .retentionPolicy(retentionPolicy); - - Metrics metrics = new Metrics().enabled(true) - .includeAPIs(false) - .retentionPolicy(retentionPolicy) - .version("1.0"); - - StorageServiceProperties updatedProperties = new StorageServiceProperties().logging(logging) - .hourMetrics(metrics) - .minuteMetrics(metrics) - .cors(new ArrayList<>()); - - StepVerifier.create(serviceClient.setProperties(updatedProperties)) - .assertNext(response -> helper.assertResponseStatusCode(response, 202)) - .verifyComplete(); - - StepVerifier.create(serviceClient.getProperties()) - .assertNext(response -> helper.assertQueueServicePropertiesAreEqual(updatedProperties, response.value())) - .verifyComplete(); - - StepVerifier.create(serviceClient.setProperties(originalProperties)) - .assertNext(response -> helper.assertResponseStatusCode(response, 202)) - .verifyComplete(); - - StepVerifier.create(serviceClient.getProperties()) - .assertNext(response -> helper.assertQueueServicePropertiesAreEqual(originalProperties, response.value())) - .verifyComplete(); - } -} diff --git a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueServiceClientTests.java b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueServiceClientTests.java deleted file mode 100644 index 39e1b9d2beb4..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueServiceClientTests.java +++ /dev/null @@ -1,255 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.storage.queue; - -import com.azure.core.http.HttpClient; -import com.azure.core.http.policy.HttpLogDetailLevel; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.VoidResponse; -import com.azure.core.util.logging.ClientLogger; -import com.azure.storage.queue.models.EnqueuedMessage; -import com.azure.storage.queue.models.Logging; -import com.azure.storage.queue.models.Metrics; -import com.azure.storage.queue.models.PeekedMessage; -import com.azure.storage.queue.models.QueueItem; -import com.azure.storage.queue.models.QueueProperties; -import com.azure.storage.queue.models.QueuesSegmentOptions; -import com.azure.storage.queue.models.RetentionPolicy; -import com.azure.storage.queue.models.StorageErrorException; -import com.azure.storage.queue.models.StorageServiceProperties; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.Map; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.fail; - -public class QueueServiceClientTests extends QueueServiceClientTestsBase { - private final ClientLogger logger = new ClientLogger(QueueServiceClientTests.class); - - private QueueServiceClient serviceClient; - - @Override - protected void beforeTest() { - queueName = getQueueName(); - helper = new TestHelpers(); - - if (interceptorManager.isPlaybackMode()) { - serviceClient = helper.setupClient((connectionString, endpoint) -> new QueueServiceClientBuilder() - .connectionString(connectionString) - .httpClient(interceptorManager.getPlaybackClient()) - .httpLogDetailLevel(HttpLogDetailLevel.BODY_AND_HEADERS) - .buildClient(), true, logger); - } else { - serviceClient = helper.setupClient((connectionString, endpoint) -> new QueueServiceClientBuilder() - .connectionString(connectionString) - .httpClient(HttpClient.createDefault().wiretap(true)) - .httpLogDetailLevel(HttpLogDetailLevel.BODY_AND_HEADERS) - .addPolicy(interceptorManager.getRecordPolicy()) - .buildClient(), false, logger); - } - } - - @Override - protected void afterTest() { - serviceClient.listQueues(new QueuesSegmentOptions().prefix(queueName)) - .forEach(queueToDelete -> { - try { - QueueClient client = serviceClient.getQueueClient(queueToDelete.name()); - client.clearMessages(); - client.delete(); - } catch (StorageErrorException ex) { - // Queue already delete, that's what we wanted anyways. - } - }); - } - - @Override - public void getQueueDoesNotCreateAQueue() { - try { - serviceClient.getQueueClient(queueName).enqueueMessage("Expecting an exception"); - fail("getQueueClient doesn't create a queue in Azure Storage."); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 404); - } - } - - @Override - public void createQueue() { - QueueClient client = serviceClient.createQueue(queueName).value(); - Response response = client.enqueueMessage("Testing service client creating a queue"); - helper.assertResponseStatusCode(response, 201); - } - - @Override - public void createQueueWithMetadata() { - Map metadata = new HashMap<>(); - metadata.put("metadata1", "value1"); - metadata.put("metadata2", "value2"); - QueueClient client = serviceClient.createQueue(queueName, metadata).value(); - - Response propertiesResponse = client.getProperties(); - helper.assertResponseStatusCode(propertiesResponse, 200); - assertEquals(metadata, propertiesResponse.value().metadata()); - } - - @Override - public void createQueueTwiceSameMetadata() { - final String messageText = "Testing service client creating the same queue twice does not modify the queue"; - Map metadata = new HashMap<>(); - metadata.put("metadata1", "value1"); - metadata.put("metadata2", "value2"); - - EnqueuedMessage enqueuedMessage = serviceClient.createQueue(queueName, metadata).value().enqueueMessage(messageText).value(); - assertNotNull(enqueuedMessage); - - PeekedMessage peekedMessage = serviceClient.createQueue(queueName, metadata).value().peekMessages().iterator().next(); - assertEquals(messageText, peekedMessage.messageText()); - } - - @Override - public void createQueueTwiceDifferentMetadata() { - Map metadata = new HashMap<>(); - metadata.put("metadata1", "value1"); - metadata.put("metadata2", "value2"); - - try { - serviceClient.createQueue(queueName); - serviceClient.createQueue(queueName, metadata); - fail("Creating a queue twice with different metadata should throw an exception."); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 409); - } - } - - @Override - public void deleteExistingQueue() { - QueueClient client = serviceClient.createQueue(queueName).value(); - serviceClient.deleteQueue(queueName); - - try { - client.enqueueMessage("Expecting an exception"); - fail("Attempting to enqueue a message on a client that has been delete should throw an exception."); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 404); - } - } - - @Override - public void deleteNonExistentQueue() { - try { - serviceClient.deleteQueue(queueName); - fail("Attempting to delete a queue that doesn't exist should throw an exception."); - } catch (Exception exception) { - helper.assertExceptionStatusCode(exception, 404); - } - } - - @Override - public void listQueues() { - LinkedList testQueues = new LinkedList<>(); - for (int i = 0; i < 3; i++) { - QueueItem queue = new QueueItem().name(queueName + i); - testQueues.add(queue); - serviceClient.createQueue(queue.name(), queue.metadata()); - } - - for (QueueItem queue : serviceClient.listQueues(defaultSegmentOptions())) { - helper.assertQueuesAreEqual(testQueues.pop(), queue); - } - } - - @Override - public void listQueuesIncludeMetadata() { - Map metadata = new HashMap<>(); - metadata.put("metadata1", "value1"); - metadata.put("metadata2", "value2"); - - LinkedList testQueues = new LinkedList<>(); - for (int i = 0; i < 3; i++) { - QueueItem queue = new QueueItem().name(queueName + i); - if (i % 2 == 0) { - queue.metadata(metadata); - } - - testQueues.add(queue); - serviceClient.createQueue(queue.name(), queue.metadata()); - } - - for (QueueItem queue : serviceClient.listQueues(defaultSegmentOptions().includeMetadata(true))) { - helper.assertQueuesAreEqual(testQueues.pop(), queue); - } - } - - @Override - public void listQueuesWithPrefix() { - LinkedList testQueues = new LinkedList<>(); - for (int i = 0; i < 3; i++) { - QueueItem queue = new QueueItem(); - if (i % 2 == 0) { - queue.name(queueName + "prefix" + i); - testQueues.add(queue); - } else { - queue.name(queueName + i); - } - - serviceClient.createQueue(queue.name(), queue.metadata()); - } - - for (QueueItem queue : serviceClient.listQueues(defaultSegmentOptions().prefix(queueName + "prefix"))) { - helper.assertQueuesAreEqual(testQueues.pop(), queue); - } - } - - @Override - public void listQueuesWithLimit() { - LinkedList testQueues = new LinkedList<>(); - for (int i = 0; i < 3; i++) { - QueueItem queue = new QueueItem().name(queueName + i); - testQueues.add(queue); - serviceClient.createQueue(queue.name(), queue.metadata()); - } - - for (QueueItem queue : serviceClient.listQueues(defaultSegmentOptions().maxResults(2))) { - helper.assertQueuesAreEqual(testQueues.pop(), queue); - } - } - - @Override - public void setProperties() { - StorageServiceProperties originalProperties = serviceClient.getProperties().value(); - - RetentionPolicy retentionPolicy = new RetentionPolicy().enabled(true) - .days(3); - - Logging logging = new Logging().version("1.0") - .delete(true) - .write(true) - .retentionPolicy(retentionPolicy); - - Metrics metrics = new Metrics().enabled(true) - .includeAPIs(false) - .retentionPolicy(retentionPolicy) - .version("1.0"); - - StorageServiceProperties updatedProperties = new StorageServiceProperties().logging(logging) - .hourMetrics(metrics) - .minuteMetrics(metrics) - .cors(new ArrayList<>()); - - VoidResponse setResponse = serviceClient.setProperties(updatedProperties); - helper.assertResponseStatusCode(setResponse, 202); - - Response getResponse = serviceClient.getProperties(); - helper.assertQueueServicePropertiesAreEqual(updatedProperties, getResponse.value()); - - setResponse = serviceClient.setProperties(originalProperties); - helper.assertResponseStatusCode(setResponse, 202); - - getResponse = serviceClient.getProperties(); - helper.assertQueueServicePropertiesAreEqual(originalProperties, getResponse.value()); - } -} diff --git a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueServiceClientTestsBase.java b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueServiceClientTestsBase.java deleted file mode 100644 index f090814fbfc9..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueServiceClientTestsBase.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.storage.queue; - -import com.azure.core.test.TestBase; -import com.azure.storage.queue.models.QueuesSegmentOptions; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TestName; - -public abstract class QueueServiceClientTestsBase extends TestBase { - String queueName; - TestHelpers helper; - - @Rule - public TestName testName = new TestName(); - - @Override - public String testName() { - return testName.getMethodName(); - } - - String getQueueName() { - return testResourceNamer.randomName("queue", 16).toLowerCase(); - } - - @Test - public abstract void getQueueDoesNotCreateAQueue(); - - @Test - public abstract void createQueue(); - - @Test - public abstract void createQueueWithMetadata(); - - @Test - public abstract void createQueueTwiceSameMetadata(); - - @Test - public abstract void createQueueTwiceDifferentMetadata(); - - @Test - public abstract void deleteExistingQueue(); - - @Test - public abstract void deleteNonExistentQueue(); - - @Test - public abstract void listQueues(); - - @Test - public abstract void listQueuesIncludeMetadata(); - - @Test - public abstract void listQueuesWithPrefix(); - - @Test - public abstract void listQueuesWithLimit(); - - @Test - public abstract void setProperties(); - - QueuesSegmentOptions defaultSegmentOptions() { - return new QueuesSegmentOptions().prefix(queueName); - } -} diff --git a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/TestHelpers.java b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/TestHelpers.java deleted file mode 100644 index 48639715112f..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/TestHelpers.java +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.storage.queue; - -import com.azure.core.http.rest.Response; -import com.azure.core.implementation.util.ImplUtils; -import com.azure.core.util.configuration.ConfigurationManager; -import com.azure.core.util.logging.ClientLogger; -import com.azure.storage.queue.models.CorsRule; -import com.azure.storage.queue.models.Logging; -import com.azure.storage.queue.models.Metrics; -import com.azure.storage.queue.models.QueueItem; -import com.azure.storage.queue.models.RetentionPolicy; -import com.azure.storage.queue.models.SignedIdentifier; -import com.azure.storage.queue.models.StorageErrorException; -import com.azure.storage.queue.models.StorageServiceProperties; - -import java.time.Duration; -import java.util.List; -import java.util.function.BiFunction; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -/** - * Contains helper methods for unit tests. - */ -class TestHelpers { - private final String azureStorageConnectionString = "AZURE_STORAGE_CONNECTION_STRING"; - private final String azureStorageQueueEndpoint = "AZURE_STORAGE_QUEUE_ENDPOINT"; - - T setupClient(BiFunction clientBuilder, boolean isPlaybackMode, ClientLogger logger) { - String connectionString = "DefaultEndpointsProtocol=https;AccountName=teststorage;AccountKey=atestaccountkey;EndpointSuffix=core.windows.net"; - String queueEndpoint = "https://teststorage.queue.core.windows.net/"; - - if (!isPlaybackMode) { - connectionString = ConfigurationManager.getConfiguration().get(azureStorageConnectionString); - queueEndpoint = ConfigurationManager.getConfiguration().get(azureStorageQueueEndpoint); - } - - if (ImplUtils.isNullOrEmpty(connectionString) && ImplUtils.isNullOrEmpty(queueEndpoint)) { - logger.warning("{} and {} must be set to build the testing client", azureStorageConnectionString, azureStorageQueueEndpoint); - fail(); - return null; - } - - return clientBuilder.apply(connectionString, queueEndpoint); - } - - void assertQueuesAreEqual(QueueItem expected, QueueItem actual) { - if (expected == null) { - assertNull(actual); - } else { - assertEquals(expected.name(), actual.name()); - - if (expected.metadata() != null && !ImplUtils.isNullOrEmpty(actual.metadata())) { - assertEquals(expected.metadata(), actual.metadata()); - } - } - } - - void assertQueueServicePropertiesAreEqual(StorageServiceProperties expected, StorageServiceProperties actual) { - if (expected == null) { - assertNull(actual); - } else { - assertMetricsAreEqual(expected.hourMetrics(), actual.hourMetrics()); - assertMetricsAreEqual(expected.minuteMetrics(), actual.minuteMetrics()); - assertLoggingAreEqual(expected.logging(), actual.logging()); - assertCorsAreEqual(expected.cors(), actual.cors()); - } - } - - private void assertMetricsAreEqual(Metrics expected, Metrics actual) { - if (expected == null) { - assertNull(actual); - } else { - assertEquals(expected.enabled(), actual.enabled()); - assertEquals(expected.includeAPIs(), actual.includeAPIs()); - assertEquals(expected.version(), actual.version()); - assertRetentionPoliciesAreEqual(expected.retentionPolicy(), actual.retentionPolicy()); - } - } - - private void assertLoggingAreEqual(Logging expected, Logging actual) { - if (expected == null) { - assertNull(actual); - } else { - assertEquals(expected.read(), actual.read()); - assertEquals(expected.write(), actual.write()); - assertEquals(expected.delete(), actual.delete()); - assertEquals(expected.version(), actual.version()); - assertRetentionPoliciesAreEqual(expected.retentionPolicy(), actual.retentionPolicy()); - } - } - - private void assertRetentionPoliciesAreEqual(RetentionPolicy expected, RetentionPolicy actual) { - if (expected == null) { - assertNull(actual); - } else { - assertEquals(expected.days(), actual.days()); - assertEquals(expected.enabled(), actual.enabled()); - } - } - - private void assertCorsAreEqual(List expected, List actual) { - if (expected == null) { - assertTrue(ImplUtils.isNullOrEmpty(actual)); - } else { - assertEquals(expected.size(), actual.size()); - for (int i = 0; i < expected.size(); i++) { - assertCorRulesAreEqual(expected.get(i), actual.get(i)); - } - } - } - - private void assertCorRulesAreEqual(CorsRule expected, CorsRule actual) { - if (expected == null) { - assertNull(actual); - } else { - assertEquals(expected.allowedHeaders(), actual.allowedHeaders()); - assertEquals(expected.allowedMethods(), actual.allowedMethods()); - assertEquals(expected.allowedOrigins(), actual.allowedOrigins()); - assertEquals(expected.exposedHeaders(), actual.exposedHeaders()); - assertEquals(expected.maxAgeInSeconds(), actual.maxAgeInSeconds()); - } - } - - void assertPermissionsAreEqual(SignedIdentifier expected, SignedIdentifier actual) { - assertEquals(expected.id(), actual.id()); - assertEquals(expected.accessPolicy().permission(), actual.accessPolicy().permission()); - assertEquals(expected.accessPolicy().start(), actual.accessPolicy().start()); - assertEquals(expected.accessPolicy().expiry(), actual.accessPolicy().expiry()); - } - - void assertResponseStatusCode(Response response, int expectedStatusCode) { - assertEquals(expectedStatusCode, response.statusCode()); - } - - void assertExceptionStatusCode(Throwable throwable, int expectedStatusCode) { - assertTrue(throwable instanceof StorageErrorException); - StorageErrorException storageErrorException = (StorageErrorException) throwable; - assertEquals(expectedStatusCode, storageErrorException.response().statusCode()); - } - - void sleepInRecordMode(Duration duration) { - String azureTestMode = ConfigurationManager.getConfiguration().get("AZURE_TEST_MODE"); - if ("RECORD".equalsIgnoreCase(azureTestMode)) { - sleep(duration); - } - } - - void sleep(Duration duration) { - try { - Thread.sleep(duration.toMillis()); - } catch (InterruptedException ex) { - // Ignore the error - } - } -} diff --git a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/spock/APISpec.groovy b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/spock/APISpec.groovy new file mode 100644 index 000000000000..51618c5a2a74 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/spock/APISpec.groovy @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.storage.queue.spock + +import com.azure.core.test.InterceptorManager +import com.azure.core.test.TestMode +import com.azure.core.test.utils.TestResourceNamer +import com.azure.core.util.configuration.ConfigurationManager +import com.azure.core.util.logging.ClientLogger +import com.azure.storage.queue.QueueClientBuilder +import com.azure.storage.queue.QueueServiceClient +import com.azure.storage.queue.QueueServiceClientBuilder +import com.azure.storage.queue.models.QueuesSegmentOptions +import spock.lang.Specification + +class APISpec extends Specification { + // Field common used for all APIs. + def logger = new ClientLogger(APISpec.class) + def AZURE_TEST_MODE = "AZURE_TEST_MODE" + def interceptorManager + def testResourceName + + // Clients for API tests + def primaryQueueServiceClient + def primaryQueueServiceAsyncClient + + + // Test name for test method name. + def methodName + def testMode = getTestMode() + def connectionString = ConfigurationManager.getConfiguration().get("AZURE_STORAGE_QUEUE_CONNECTION_STRING") + + /** + * Setup the QueueServiceClient and QueueClient common used for the API tests. + */ + def setup() { + String testName = refactorName(specificationContext.currentIteration.getName()) + String className = specificationContext.getCurrentSpec().getName() + methodName = className + testName + logger.info("Test Mode: {}, Name: {}", testMode, methodName) + interceptorManager = new InterceptorManager(methodName, testMode) + testResourceName = new TestResourceNamer(methodName, testMode, + interceptorManager.getRecordedData()) + } + + /** + * Clean up the test queues and messages for the account. + */ + def cleanup() { + + interceptorManager.close() + if (getTestMode() == TestMode.RECORD) { + QueueServiceClient cleanupQueueServiceClient = new QueueServiceClientBuilder() + .connectionString(connectionString) + .buildClient() + cleanupQueueServiceClient.listQueues(new QueuesSegmentOptions().prefix(methodName.toLowerCase())).each { + queueItem -> cleanupQueueServiceClient.deleteQueue(queueItem.name()) + } + } + } + + /** + * Test mode is initialized whenever test is executed. Helper method which is used to determine what to do under + * certain test mode. + * @return The TestMode: + *
    + *
  • Playback: (default if no test mode setup)
  • + *
+ */ + def getTestMode() { + def azureTestMode = ConfigurationManager.getConfiguration().get(AZURE_TEST_MODE) + + if (azureTestMode != null) { + try { + return TestMode.valueOf(azureTestMode.toUpperCase(Locale.US)) + } catch (IllegalArgumentException e) { + logger.error("Could not parse '{}' into TestEnum. Using 'Playback' mode.", azureTestMode) + return TestMode.PLAYBACK + } + } + + logger.info("Environment variable '{}' has not been set yet. Using 'Playback' mode.", AZURE_TEST_MODE) + return TestMode.PLAYBACK + } + + def queueServiceBuilderHelper(final InterceptorManager interceptorManager) { + if (testMode == TestMode.RECORD) { + return new QueueServiceClientBuilder() + .connectionString(connectionString) + .addPolicy(interceptorManager.getRecordPolicy()) + } else { + return new QueueServiceClientBuilder() + .connectionString(connectionString) + .httpClient(interceptorManager.getPlaybackClient()) + } + } + + def queueBuilderHelper(final InterceptorManager interceptorManager) { + def queueName = testResourceName.randomName("queue", 16) + if (testMode == TestMode.RECORD) { + return new QueueClientBuilder() + .connectionString(connectionString) + .queueName(queueName) + .addPolicy(interceptorManager.getRecordPolicy()) + } else { + return new QueueClientBuilder() + .connectionString(connectionString) + .queueName(queueName) + .httpClient(interceptorManager.getPlaybackClient()) + } + } + + private def refactorName(String text) { + def fullName = text.split(" ").collect { it.capitalize() }.join("") + def matcher = (fullName =~ /(.*)(\[)(.*)(\])/) + + if (!matcher.find()) { + return fullName + } + return matcher[0][1] + matcher[0][3] + } +} diff --git a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/spock/QueueAPITests.groovy b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/spock/QueueAPITests.groovy new file mode 100644 index 000000000000..46b52436bf4c --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/spock/QueueAPITests.groovy @@ -0,0 +1,446 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.storage.queue.spock + + +import com.azure.storage.queue.models.AccessPolicy +import com.azure.storage.queue.models.SignedIdentifier +import com.azure.storage.queue.models.StorageErrorCode +import com.azure.storage.queue.models.StorageErrorException +import reactor.test.StepVerifier +import spock.lang.Ignore +import spock.lang.Unroll + +import java.time.Duration +import java.time.LocalDateTime +import java.time.OffsetDateTime +import java.time.ZoneOffset + +class QueueAPITests extends APISpec { + def queueClient + + static def testMetadata = Collections.singletonMap("metadata", "value") + static def createMetadata = Collections.singletonMap("metadata1", "value") + + def setup() { + primaryQueueServiceClient = queueServiceBuilderHelper(interceptorManager).buildClient() + queueClient = primaryQueueServiceClient.getQueueClient(testResourceName.randomName(methodName, 60)) + } + + def "Create queue with shared key"() { + expect: + QueueTestHelper.assertResponseStatusCode(queueClient.create(), 201) + } + + // TODO: Will implement the test after introduce the sas token generator + @Ignore + def "Create queue with sas token"() { + + } + + def "Delete exist queue"() { + given: + queueClient.create() + when: + def deleteQueueResponse = queueClient.delete() + then: + QueueTestHelper.assertResponseStatusCode(deleteQueueResponse, 204) + + } + + def "Delete queue error"() { + when: + queueClient.delete() + then: + def e = thrown(StorageErrorException) + QueueTestHelper.assertExceptionStatusCodeAndMessage(e, 404, StorageErrorCode.QUEUE_NOT_FOUND) + } + + def "Get properties"() { + given: + queueClient.create(testMetadata) + when: + def getPropertiesResponse = queueClient.getProperties() + then: + QueueTestHelper.assertResponseStatusCode(getPropertiesResponse, 200) + getPropertiesResponse.value().approximateMessagesCount() == 0 + testMetadata.equals(getPropertiesResponse.value().metadata()) + } + + def "Get properties error"() { + when: + queueClient.getProperties() + then: + def e = thrown(StorageErrorException) + QueueTestHelper.assertExceptionStatusCodeAndMessage(e, 404, StorageErrorCode.QUEUE_NOT_FOUND) + } + + @Unroll + def "Set and clear metadata"() { + given: + queueClient.create(matadataInCreate) + when: + def getPropertiesResponseBefore = queueClient.getProperties() + def setMetadataResponse = queueClient.setMetadata(metadataInSet) + def getPropertiesResponseAfter = queueClient.getProperties() + then: + QueueTestHelper.assertResponseStatusCode(getPropertiesResponseBefore, 200) + expectMetadataInCreate.equals(getPropertiesResponseBefore.value().metadata()) + QueueTestHelper.assertResponseStatusCode(setMetadataResponse, 204) + QueueTestHelper.assertResponseStatusCode(getPropertiesResponseAfter, 200) + expectMetadataInSet.equals(getPropertiesResponseAfter.value().metadata) + where: + matadataInCreate | metadataInSet | expectMetadataInCreate | expectMetadataInSet + null | testMetadata | Collections.emptyMap() | testMetadata + createMetadata | testMetadata | createMetadata | testMetadata + createMetadata | null | createMetadata | Collections.emptyMap() + testMetadata | testMetadata | testMetadata | testMetadata + null | null | Collections.emptyMap() | Collections.emptyMap() + } + + def "Set metadata queue error"() { + when: + queueClient.setMetadata(testMetadata) + then: + def e = thrown(StorageErrorException) + QueueTestHelper.assertExceptionStatusCodeAndMessage(e, 404, StorageErrorCode.QUEUE_NOT_FOUND) + } + + @Unroll + def "Set invalid meta"() { + given: + def invalidMetadata = Collections.singletonMap(invalidKey, "value") + queueClient.create() + when: + queueClient.setMetadata(invalidMetadata) + then: + def e = thrown(StorageErrorException) + QueueTestHelper.assertExceptionStatusCodeAndMessage(e, statusCode, errMessage) + where: + invalidKey | statusCode | errMessage + "invalidMeta" | 403 | StorageErrorCode.AUTHENTICATION_ERROR + "invalid-meta" | 400 | StorageErrorCode.INVALID_METADATA + "12345" | 400 | StorageErrorCode.INVALID_METADATA + "" | 400 | StorageErrorCode.EMPTY_METADATA_KEY + } + + def "Get access policy"() { + given: + queueClient.create() + when: + def accessPolicies = queueClient.getAccessPolicy() + then: + !accessPolicies.iterator().hasNext() + } + + def "Get access policy error"() { + when: + queueClient.getAccessPolicy().iterator().next() + then: + def e = thrown(StorageErrorException) + QueueTestHelper.assertExceptionStatusCodeAndMessage(e, 404, StorageErrorCode.QUEUE_NOT_FOUND) + } + + def "Set access policy"() { + given: + queueClient.create() + def accessPolicy = new AccessPolicy() + .permission("raup") + .start(OffsetDateTime.of(LocalDateTime.of(2000, 1, 1, 0, 0), ZoneOffset.UTC)) + .expiry(OffsetDateTime.of(LocalDateTime.of(2020, 1, 1, 0, 0), ZoneOffset.UTC)) + def permission = new SignedIdentifier() + .id("testpermission") + .accessPolicy(accessPolicy) + when: + def setAccessPolicyResponse = queueClient.setAccessPolicy(Collections.singletonList(permission)) + def nextAccessPolicy = queueClient.getAccessPolicy().iterator().next() + then: + QueueTestHelper.assertResponseStatusCode(setAccessPolicyResponse, 204) + QueueTestHelper.assertPermissionsAreEqual(permission, nextAccessPolicy) + } + + def "Set invalid access policy"() { + given: + def accessPolicy = new AccessPolicy() + .permission("r") + .start(OffsetDateTime.of(LocalDateTime.of(2000, 1, 1, 0, 0), ZoneOffset.UTC)) + .expiry(OffsetDateTime.of(LocalDateTime.of(2020, 1, 1, 0, 0), ZoneOffset.UTC)) + + def permission = new SignedIdentifier() + .id("theidofthispermissionislongerthanwhatisallowedbytheserviceandshouldfail") + .accessPolicy(accessPolicy) + queueClient.create() + when: + queueClient.setAccessPolicy(Collections.singletonList(permission)) + then: + def e = thrown(StorageErrorException) + QueueTestHelper.assertExceptionStatusCodeAndMessage(e, 400, StorageErrorCode.INVALID_XML_DOCUMENT) + } + + def "Set multiple access policies"() { + given: + def accessPolicy = new AccessPolicy() + .permission("r") + .start(OffsetDateTime.of(LocalDateTime.of(2000, 1, 1, 0, 0), ZoneOffset.UTC)) + .expiry(OffsetDateTime.of(LocalDateTime.of(2020, 1, 1, 0, 0), ZoneOffset.UTC)) + + def permissions = new ArrayList<>() + for (int i = 0; i < 3; i++) { + permissions.add(new SignedIdentifier() + .id("policy" + i) + .accessPolicy(accessPolicy)) + } + queueClient.create() + when: + def setAccessPolicyResponse = queueClient.setAccessPolicy(permissions) + def nextAccessPolicy = queueClient.getAccessPolicy().iterator() + then: + QueueTestHelper.assertResponseStatusCode(setAccessPolicyResponse, 204) + QueueTestHelper.assertPermissionsAreEqual(permissions[0], nextAccessPolicy.next()) + QueueTestHelper.assertPermissionsAreEqual(permissions[1], nextAccessPolicy.next()) + QueueTestHelper.assertPermissionsAreEqual(permissions[2], nextAccessPolicy.next()) + !nextAccessPolicy.hasNext() + } + + def "Set too many access policies"() { + given: + def accessPolicy = new AccessPolicy() + .permission("r") + .start(OffsetDateTime.of(LocalDateTime.of(2000, 1, 1, 0, 0), ZoneOffset.UTC)) + .expiry(OffsetDateTime.of(LocalDateTime.of(2020, 1, 1, 0, 0), ZoneOffset.UTC)) + + def permissions = new ArrayList<>() + for (int i = 0; i < 6; i++) { + permissions.add(new SignedIdentifier() + .id("policy" + i) + .accessPolicy(accessPolicy)) + } + queueClient.create() + when: + queueClient.setAccessPolicy(permissions) + then: + def e = thrown(StorageErrorException) + QueueTestHelper.assertExceptionStatusCodeAndMessage(e, 400, StorageErrorCode.INVALID_XML_DOCUMENT) + } + + def "Enqueue message"() { + given: + queueClient.create() + def expectMsg = "test message" + when: + def enqueueMsgResponse = queueClient.enqueueMessage(expectMsg) + def peekMsgIter = queueClient.peekMessages().iterator() + then: + QueueTestHelper.assertResponseStatusCode(enqueueMsgResponse, 201) + expectMsg.equals(peekMsgIter.next().messageText()) + !peekMsgIter.hasNext() + } + + def "Enqueue empty message"() { + given: + queueClient.create() + def expectMsg = "" + when: + def enqueueMsgResponse = queueClient.enqueueMessage(expectMsg) + def peekMsgIter = queueClient.peekMessages().iterator() + then: + QueueTestHelper.assertResponseStatusCode(enqueueMsgResponse, 201) + peekMsgIter.next().messageText() == null + !peekMsgIter.hasNext() + } + + def "Enqueue time to live"() { + given: + queueClient.create() + when: + def enqueueMsgResponse = queueClient.enqueueMessage("test message", + Duration.ofSeconds(0), Duration.ofSeconds(2)) + then: + QueueTestHelper.assertResponseStatusCode(enqueueMsgResponse, 201) + } + + def "Dequeue message"() { + given: + queueClient.create() + def expectMsg = "test message" + queueClient.enqueueMessage(expectMsg) + when: + def dequeueMsgResponse = queueClient.dequeueMessages().iterator().next() + then: + expectMsg.equals(dequeueMsgResponse.messageText()) + } + + def "Dequeue multiple messages"() { + given: + queueClient.create() + def expectMsg1 = "test message 1" + def expectMsg2 = "test message 2" + queueClient.enqueueMessage(expectMsg1) + queueClient.enqueueMessage(expectMsg2) + when: + def dequeueMsgIter = queueClient.dequeueMessages(2).iterator() + then: + expectMsg1.equals(dequeueMsgIter.next().messageText()) + expectMsg2.equals(dequeueMsgIter.next().messageText()) + } + + def "Dequeue too many message"() { + given: + queueClient.create() + when: + queueClient.dequeueMessages(33).iterator().next() + then: + def e = thrown(StorageErrorException) + QueueTestHelper.assertExceptionStatusCodeAndMessage(e, 400, StorageErrorCode.OUT_OF_RANGE_QUERY_PARAMETER_VALUE) + } + + def "Peek message"() { + given: + queueClient.create() + def expectMsg = "test message" + queueClient.enqueueMessage(expectMsg) + when: + def peekMsgIter = queueClient.peekMessages().iterator().next() + then: + expectMsg.equals(peekMsgIter.messageText()) + } + + def "Peek multiple messages"() { + given: + queueClient.create() + def expectMsg1 = "test message 1" + def expectMsg2 = "test message 2" + queueClient.enqueueMessage(expectMsg1) + queueClient.enqueueMessage(expectMsg2) + when: + def peekMsgIter = queueClient.peekMessages(2).iterator() + then: + expectMsg1.equals(peekMsgIter.next().messageText()) + expectMsg2.equals(peekMsgIter.next().messageText()) + !peekMsgIter.hasNext() + } + + def "Peek too many message"() { + given: + queueClient.create() + when: + queueClient.peekMessages(33).iterator().next() + then: + def e = thrown(StorageErrorException) + QueueTestHelper.assertExceptionStatusCodeAndMessage(e, 400, StorageErrorCode.OUT_OF_RANGE_QUERY_PARAMETER_VALUE) + } + + def "Peek messages error"() { + when: + queueClient.peekMessages().iterator().next() + then: + def e = thrown(StorageErrorException) + QueueTestHelper.assertExceptionStatusCodeAndMessage(e, 404, StorageErrorCode.QUEUE_NOT_FOUND) + } + + def "Clear messages"() { + given: + queueClient.create() + queueClient.enqueueMessage("test message 1") + queueClient.enqueueMessage("test message 2") + queueClient.enqueueMessage("test message 3") + when: + def getPropertiesResponse = queueClient.getProperties() + def clearMsgResponse = queueClient.clearMessages() + def getPropertiesAfterResponse = queueClient.getProperties() + then: + QueueTestHelper.assertResponseStatusCode(getPropertiesResponse, 200) + getPropertiesResponse.value().approximateMessagesCount() == 3 + QueueTestHelper.assertResponseStatusCode(clearMsgResponse, 204) + QueueTestHelper.assertResponseStatusCode(getPropertiesAfterResponse, 200) + getPropertiesAfterResponse.value().approximateMessagesCount() == 0 + } + + def "Clear messages error"() { + when: + StepVerifier.create(queueClient.clearMessages()) + then: + def e = thrown(StorageErrorException) + QueueTestHelper.assertExceptionStatusCodeAndMessage(e, 404, StorageErrorCode.QUEUE_NOT_FOUND) + } + + def "Delete message"() { + given: + queueClient.create() + queueClient.enqueueMessage("test message 1") + queueClient.enqueueMessage("test message 2") + queueClient.enqueueMessage("test message 3") + def dequeueMsg = queueClient.dequeueMessages().iterator().next() + when: + def getPropertiesResponse = queueClient.getProperties() + def deleteMsgResponse = queueClient.deleteMessage(dequeueMsg.messageId(), dequeueMsg.popReceipt()) + def getPropertiesAfterResponse = queueClient.getProperties() + then: + QueueTestHelper.assertResponseStatusCode(getPropertiesResponse, 200) + getPropertiesResponse.value().approximateMessagesCount() == 3 + QueueTestHelper.assertResponseStatusCode(deleteMsgResponse, 204) + QueueTestHelper.assertResponseStatusCode(getPropertiesAfterResponse, 200) + getPropertiesAfterResponse.value().approximateMessagesCount() == 2 + } + + @Unroll + def "Delete message invalid args"() { + given: + queueClient.create() + def expectMsg = "test message" + queueClient.enqueueMessage(expectMsg) + def dequeueMessageIter = queueClient.dequeueMessages().iterator().next() + when: + def deleteMessageId = messageId ? dequeueMessageIter.messageId() : dequeueMessageIter.messageId() + "Random" + def deletePopReceipt = popReceipt ? dequeueMessageIter.popReceipt() : dequeueMessageIter.popReceipt() + "Random" + queueClient.deleteMessage(deleteMessageId, deletePopReceipt) + then: + def e = thrown(StorageErrorException) + QueueTestHelper.assertExceptionStatusCodeAndMessage(e, statusCode, errMsg) + where: + messageId | popReceipt | statusCode | errMsg + true | false | 400 | StorageErrorCode.INVALID_QUERY_PARAMETER_VALUE + false | true | 404 | StorageErrorCode.MESSAGE_NOT_FOUND + false | false | 400 | StorageErrorCode.INVALID_QUERY_PARAMETER_VALUE + } + + def "Update message"() { + given: + def updateMsg = "Updated test message" + queueClient.create() + queueClient.enqueueMessage("test message before update") + + def dequeueMsg = queueClient.dequeueMessages().iterator().next() + when: + def updateMsgResponse = queueClient.updateMessage(updateMsg, + dequeueMsg.messageId(), dequeueMsg.popReceipt(), Duration.ofSeconds(1)) + QueueTestHelper.sleepInRecord(Duration.ofSeconds(2)) + def peekMsgIter = queueClient.peekMessages().iterator().next() + then: + QueueTestHelper.assertResponseStatusCode(updateMsgResponse, 204) + updateMsg.equals(peekMsgIter.messageText()) + } + + @Unroll + def "Update message invalid args"() { + given: + queueClient.create() + def updateMsg = "Updated test message" + queueClient.enqueueMessage("test message before update") + def dequeueMessageIter = queueClient.dequeueMessages().iterator().next() + when: + def updateMessageId = messageId ? dequeueMessageIter.messageId() : dequeueMessageIter.messageId() + "Random" + def updatePopReceipt = popReceipt ? dequeueMessageIter.popReceipt() : dequeueMessageIter.popReceipt() + "Random" + queueClient.updateMessage(updateMsg, updateMessageId, updatePopReceipt, Duration.ofSeconds(1)) + then: + def e = thrown(StorageErrorException) + QueueTestHelper.assertExceptionStatusCodeAndMessage(e, statusCode, errMsg) + where: + messageId | popReceipt | statusCode | errMsg + true | false | 400 | StorageErrorCode.INVALID_QUERY_PARAMETER_VALUE + false | true | 404 | StorageErrorCode.MESSAGE_NOT_FOUND + false | false | 400 | StorageErrorCode.INVALID_QUERY_PARAMETER_VALUE + } + +} diff --git a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/spock/QueueAysncAPITests.groovy b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/spock/QueueAysncAPITests.groovy new file mode 100644 index 000000000000..653016c3b0a7 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/spock/QueueAysncAPITests.groovy @@ -0,0 +1,511 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.storage.queue.spock + +import com.azure.storage.queue.models.AccessPolicy +import com.azure.storage.queue.models.SignedIdentifier +import com.azure.storage.queue.models.StorageErrorCode +import reactor.test.StepVerifier +import spock.lang.Ignore +import spock.lang.Unroll + +import java.time.Duration +import java.time.LocalDateTime +import java.time.OffsetDateTime +import java.time.ZoneOffset + +class QueueAysncAPITests extends APISpec { + def queueAsyncClient + + static def testMetadata = Collections.singletonMap("metadata", "value") + static def createMetadata = Collections.singletonMap("metadata1", "value") + + def setup() { + primaryQueueServiceAsyncClient = queueServiceBuilderHelper(interceptorManager).buildAsyncClient() + queueAsyncClient = primaryQueueServiceAsyncClient.getQueueAsyncClient(testResourceName.randomName(methodName, 60)) + } + + def "Create queue with shared key"() { + expect: + StepVerifier.create(queueAsyncClient.create()).assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 201) } + .verifyComplete() + } + + // TODO: Will implement the test after introduce the sas token generator + @Ignore + def "Create queue with sas token"() { + + } + + def "Delete exist queue"() { + given: + queueAsyncClient.create().block() + when: + def deleteQueueVerifier = StepVerifier.create(queueAsyncClient.delete()) + then: + deleteQueueVerifier.assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 204) } + .verifyComplete() + } + + def "Delete queue error"() { + when: + def deleteQueueVerifier = StepVerifier.create(queueAsyncClient.delete()) + then: + deleteQueueVerifier.verifyErrorSatisfies { + assert QueueTestHelper.assertExceptionStatusCodeAndMessage(it, 404, StorageErrorCode.QUEUE_NOT_FOUND) + } + } + + def "Get properties"() { + given: + queueAsyncClient.create(testMetadata).block() + when: + def getPropertiesVerifier = StepVerifier.create(queueAsyncClient.getProperties()) + then: + getPropertiesVerifier.assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 200) + assert it.value().approximateMessagesCount() == 0 + assert testMetadata.equals(it.value().metadata()) + }.verifyComplete() + } + + def "Get properties error"() { + when: + def getPropertiesVerifier = StepVerifier.create(queueAsyncClient.getProperties()) + then: + getPropertiesVerifier.verifyErrorSatisfies { + assert QueueTestHelper.assertExceptionStatusCodeAndMessage(it, 404, StorageErrorCode.QUEUE_NOT_FOUND) + } + } + + @Unroll + def "Set and clear metadata"() { + given: + queueAsyncClient.create(matadataInCreate).block() + when: + def getPropertiesVerifierBefore = StepVerifier.create(queueAsyncClient.getProperties()) + def setMetadataVerifier = StepVerifier.create(queueAsyncClient.setMetadata(metadataInSet)) + def getPropertiesVerifierAfter = StepVerifier.create(queueAsyncClient.getProperties()) + then: + getPropertiesVerifierBefore.assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 200) + assert expectMetadataInCreate.equals(it.value().metadata()) + }.verifyComplete() + setMetadataVerifier.assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 204) } + .verifyComplete() + getPropertiesVerifierAfter.assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 200) + assert expectMetadataInSet.equals(it.value().metadata) + }.verifyComplete() + where: + matadataInCreate | metadataInSet | expectMetadataInCreate | expectMetadataInSet + null | testMetadata | Collections.emptyMap() | testMetadata + createMetadata | testMetadata | createMetadata | testMetadata + createMetadata | null | createMetadata | Collections.emptyMap() + testMetadata | testMetadata | testMetadata | testMetadata + null | null | Collections.emptyMap() | Collections.emptyMap() + } + + def "Set metadata queue error"() { + when: + def setMetadataVerifier = StepVerifier.create(queueAsyncClient.setMetadata(testMetadata)) + then: + setMetadataVerifier.verifyErrorSatisfies { + assert QueueTestHelper.assertExceptionStatusCodeAndMessage(it, 404, StorageErrorCode.QUEUE_NOT_FOUND) + } + } + + @Unroll + def "Set invalid meta"() { + given: + def invalidMetadata = Collections.singletonMap(invalidKey, "value") + queueAsyncClient.create().block() + when: + def setMetadataVerifier = StepVerifier.create(queueAsyncClient.setMetadata(invalidMetadata)) + then: + setMetadataVerifier.verifyErrorSatisfies { + assert QueueTestHelper.assertExceptionStatusCodeAndMessage(it, statusCode, errMessage) + } + where: + invalidKey | statusCode | errMessage + "invalidMeta" | 403 | StorageErrorCode.AUTHENTICATION_ERROR + "invalid-meta" | 400 | StorageErrorCode.INVALID_METADATA + "12345" | 400 | StorageErrorCode.INVALID_METADATA + "" | 400 | StorageErrorCode.EMPTY_METADATA_KEY + } + + def "Get access policy"() { + given: + queueAsyncClient.create().block() + when: + def getAccessPolicyVerifier = StepVerifier.create(queueAsyncClient.getAccessPolicy()) + then: + getAccessPolicyVerifier.verifyComplete() + } + + def "Get access policy does error"() { + when: + def getAccessPolicyVerifier = StepVerifier.create(queueAsyncClient.getAccessPolicy()) + then: + getAccessPolicyVerifier.verifyErrorSatisfies { + assert QueueTestHelper.assertExceptionStatusCodeAndMessage(it, 404, StorageErrorCode.QUEUE_NOT_FOUND) + } + } + + def "Set access policy"() { + given: + queueAsyncClient.create().block() + def accessPolicy = new AccessPolicy() + .permission("raup") + .start(OffsetDateTime.of(LocalDateTime.of(2000, 1, 1, 0, 0), ZoneOffset.UTC)) + .expiry(OffsetDateTime.of(LocalDateTime.of(2020, 1, 1, 0, 0), ZoneOffset.UTC)) + def permission = new SignedIdentifier() + .id("testpermission") + .accessPolicy(accessPolicy) + when: + def setAccessPolicyVerifier = StepVerifier.create(queueAsyncClient.setAccessPolicy(Collections.singletonList(permission))) + def getAccessPolicyVerifier = StepVerifier.create(queueAsyncClient.getAccessPolicy()) + then: + setAccessPolicyVerifier.assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 204) + }.verifyComplete() + getAccessPolicyVerifier.assertNext { + assert QueueTestHelper.assertPermissionsAreEqual(permission, it) + }.verifyComplete() + } + + def "Set invalid access policy"() { + given: + def accessPolicy = new AccessPolicy() + .permission("r") + .start(OffsetDateTime.of(LocalDateTime.of(2000, 1, 1, 0, 0), ZoneOffset.UTC)) + .expiry(OffsetDateTime.of(LocalDateTime.of(2020, 1, 1, 0, 0), ZoneOffset.UTC)) + + def permission = new SignedIdentifier() + .id("theidofthispermissionislongerthanwhatisallowedbytheserviceandshouldfail") + .accessPolicy(accessPolicy) + queueAsyncClient.create().block() + when: + def setAccessPolicyVerifier = StepVerifier.create(queueAsyncClient.setAccessPolicy(Collections.singletonList(permission))) + then: + setAccessPolicyVerifier.verifyErrorSatisfies { + assert QueueTestHelper.assertExceptionStatusCodeAndMessage(it, 400, StorageErrorCode.INVALID_XML_DOCUMENT) + } + } + + def "Set multiple access policies"() { + given: + def accessPolicy = new AccessPolicy() + .permission("r") + .start(OffsetDateTime.of(LocalDateTime.of(2000, 1, 1, 0, 0), ZoneOffset.UTC)) + .expiry(OffsetDateTime.of(LocalDateTime.of(2020, 1, 1, 0, 0), ZoneOffset.UTC)) + + def permissions = new ArrayList<>() + for (int i = 0; i < 3; i++) { + permissions.add(new SignedIdentifier() + .id("policy" + i) + .accessPolicy(accessPolicy)) + } + queueAsyncClient.create().block() + when: + def setAccessPolicyVerifier = StepVerifier.create(queueAsyncClient.setAccessPolicy(permissions)) + def getAccessPolicyVerifier = StepVerifier.create(queueAsyncClient.getAccessPolicy()) + then: + setAccessPolicyVerifier.assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 204) + }.verifyComplete() + getAccessPolicyVerifier.assertNext { + assert QueueTestHelper.assertPermissionsAreEqual(permissions[0], it) + }.assertNext { + assert QueueTestHelper.assertPermissionsAreEqual(permissions[1], it) + }.assertNext { + assert QueueTestHelper.assertPermissionsAreEqual(permissions[2], it) + }.verifyComplete() + } + + def "Set too many access policies"() { + given: + def accessPolicy = new AccessPolicy() + .permission("r") + .start(OffsetDateTime.of(LocalDateTime.of(2000, 1, 1, 0, 0), ZoneOffset.UTC)) + .expiry(OffsetDateTime.of(LocalDateTime.of(2020, 1, 1, 0, 0), ZoneOffset.UTC)) + + def permissions = new ArrayList<>() + for (int i = 0; i < 6; i++) { + permissions.add(new SignedIdentifier() + .id("policy" + i) + .accessPolicy(accessPolicy)) + } + queueAsyncClient.create().block() + when: + def setAccessPolicyVerifier = StepVerifier.create(queueAsyncClient.setAccessPolicy(permissions)) + then: + setAccessPolicyVerifier.verifyErrorSatisfies { + assert QueueTestHelper.assertExceptionStatusCodeAndMessage(it, 400, StorageErrorCode.INVALID_XML_DOCUMENT) + } + } + + def "Enqueue message"() { + given: + queueAsyncClient.create().block() + def expectMsg = "test message" + when: + def enqueueMsgVerifier = StepVerifier.create(queueAsyncClient.enqueueMessage(expectMsg)) + def peekMsgVerifier = StepVerifier.create(queueAsyncClient.peekMessages()) + then: + enqueueMsgVerifier.assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 201) + }.verifyComplete() + peekMsgVerifier.assertNext { + assert expectMsg.equals(it.messageText()) + assert !it.hasNext() + } + } + + def "Enqueue empty message"() { + given: + queueAsyncClient.create().block() + when: + def enqueueMsgVerifier = StepVerifier.create(queueAsyncClient.enqueueMessage("")) + def peekMsgVerifier = StepVerifier.create(queueAsyncClient.peekMessages()) + then: + enqueueMsgVerifier.assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 201) + }.verifyComplete() + peekMsgVerifier.assertNext { + assert it.messageText() == null + assert !it.hasNext() + } + } + + def "Enqueue time to live"() { + given: + queueAsyncClient.create().block() + when: + def enqueueMsgVerifier = StepVerifier.create(queueAsyncClient.enqueueMessage("test message", + Duration.ofSeconds(0), Duration.ofSeconds(2))) + then: + enqueueMsgVerifier.assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 201) + }.verifyComplete() + } + + def "Dequeue message"() { + given: + queueAsyncClient.create().block() + def expectMsg = "test message" + queueAsyncClient.enqueueMessage(expectMsg).block() + when: + def dequeueMsgVerifier = StepVerifier.create(queueAsyncClient.dequeueMessages()) + then: + dequeueMsgVerifier.assertNext { + assert expectMsg.equals(it.messageText()) + }.verifyComplete() + } + + def "Dequeue multiple messages"() { + given: + queueAsyncClient.create().block() + def expectMsg1 = "test message 1" + def expectMsg2 = "test message 2" + queueAsyncClient.enqueueMessage(expectMsg1).block() + queueAsyncClient.enqueueMessage(expectMsg2).block() + when: + def dequeueMsgVerifier = StepVerifier.create(queueAsyncClient.dequeueMessages(2)) + then: + dequeueMsgVerifier.assertNext { + assert expectMsg1.equals(it.messageText()) + }.assertNext { + assert expectMsg2.equals(it.messageText()) + }.verifyComplete() + } + + def "Dequeue too many message"() { + given: + queueAsyncClient.create().block() + when: + def dequeueMsgVerifier = StepVerifier.create(queueAsyncClient.dequeueMessages(33)) + then: + dequeueMsgVerifier.verifyErrorSatisfies { + assert QueueTestHelper.assertExceptionStatusCodeAndMessage(it, 400, StorageErrorCode.OUT_OF_RANGE_QUERY_PARAMETER_VALUE) + } + } + + def "Peek message"() { + given: + queueAsyncClient.create().block() + def expectMsg = "test message" + queueAsyncClient.enqueueMessage(expectMsg).block() + when: + def peekMsgVerifier = StepVerifier.create(queueAsyncClient.peekMessages()) + then: + peekMsgVerifier.assertNext { + assert expectMsg.equals(it.messageText()) + }.verifyComplete() + } + + def "Peek multiple messages"() { + given: + queueAsyncClient.create().block() + def expectMsg1 = "test message 1" + def expectMsg2 = "test message 2" + queueAsyncClient.enqueueMessage(expectMsg1).block() + queueAsyncClient.enqueueMessage(expectMsg2).block() + when: + def peekMsgVerifier = StepVerifier.create(queueAsyncClient.peekMessages(2)) + then: + peekMsgVerifier.assertNext { + assert expectMsg1.equals(it.messageText()) + }.assertNext { + assert expectMsg2.equals(it.messageText()) + }.verifyComplete() + } + + def "Peek too many message"() { + given: + queueAsyncClient.create().block() + when: + def peekMsgVerifier = StepVerifier.create(queueAsyncClient.peekMessages(33)) + then: + peekMsgVerifier.verifyErrorSatisfies { + assert QueueTestHelper.assertExceptionStatusCodeAndMessage(it, 400, StorageErrorCode.OUT_OF_RANGE_QUERY_PARAMETER_VALUE) + } + } + + def "Peek messages error"() { + when: + def peekMsgVerifier = StepVerifier.create(queueAsyncClient.peekMessages()) + then: + peekMsgVerifier.verifyErrorSatisfies { + assert QueueTestHelper.assertExceptionStatusCodeAndMessage(it, 404, StorageErrorCode.QUEUE_NOT_FOUND) + } + } + + def "Clear messages"() { + given: + queueAsyncClient.create().block() + queueAsyncClient.enqueueMessage("test message 1").block() + queueAsyncClient.enqueueMessage("test message 2").block() + queueAsyncClient.enqueueMessage("test message 3").block() + when: + def getPropertiesVerifier = StepVerifier.create(queueAsyncClient.getProperties()) + def clearMsgVerifier = StepVerifier.create(queueAsyncClient.clearMessages()) + def getPropertiesAfterVerifier = StepVerifier.create(queueAsyncClient.getProperties()) + then: + getPropertiesVerifier.assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 200) + assert it.value().approximateMessagesCount() == 3 + }.verifyComplete() + clearMsgVerifier.assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 204) + }.verifyComplete() + getPropertiesAfterVerifier.assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 200) + assert it.value().approximateMessagesCount() == 0 + }.verifyComplete() + } + + def "Clear messages error"() { + when: + def clearMsgVerifier = StepVerifier.create(queueAsyncClient.clearMessages()) + then: + clearMsgVerifier.verifyErrorSatisfies { + assert QueueTestHelper.assertExceptionStatusCodeAndMessage(it, 404, StorageErrorCode.QUEUE_NOT_FOUND) + } + } + + def "Delete message"() { + given: + queueAsyncClient.create().block() + queueAsyncClient.enqueueMessage("test message 1").block() + queueAsyncClient.enqueueMessage("test message 2").block() + queueAsyncClient.enqueueMessage("test message 3").block() + def dequeueMsg = queueAsyncClient.dequeueMessages().blockFirst() + when: + def getPropertiesVerifier = StepVerifier.create(queueAsyncClient.getProperties()) + def deleteMsgVerifier = StepVerifier.create(queueAsyncClient.deleteMessage(dequeueMsg.messageId(), dequeueMsg.popReceipt())) + def getPropertiesAfterVerifier = StepVerifier.create(queueAsyncClient.getProperties()) + then: + getPropertiesVerifier.assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 200) + assert it.value().approximateMessagesCount() == 3 + + }.verifyComplete() + deleteMsgVerifier.assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 204) + }.verifyComplete() + getPropertiesAfterVerifier.assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 200) + assert it.value().approximateMessagesCount() == 2 + }.verifyComplete() + } + + @Unroll + def "Delete message invalid args"() { + given: + queueAsyncClient.create().block() + def expectMsg = "test message" + queueAsyncClient.enqueueMessage(expectMsg).block() + def dequeueMessage = queueAsyncClient.dequeueMessages().blockFirst() + when: + def deleteMessageId = messageId ? dequeueMessage.messageId() : dequeueMessage.messageId() + "Random" + def deletePopReceipt = popReceipt ? dequeueMessage.popReceipt() : dequeueMessage.popReceipt() + "Random" + def deleteMsgVerifier = StepVerifier.create(queueAsyncClient.deleteMessage(deleteMessageId, deletePopReceipt)) + then: + deleteMsgVerifier.verifyErrorSatisfies { + assert QueueTestHelper.assertExceptionStatusCodeAndMessage(it, statusCode, errMsg) + } + where: + messageId | popReceipt | statusCode | errMsg + true | false | 400 | StorageErrorCode.INVALID_QUERY_PARAMETER_VALUE + false | true | 404 | StorageErrorCode.MESSAGE_NOT_FOUND + false | false | 400 | StorageErrorCode.INVALID_QUERY_PARAMETER_VALUE + } + + def "Update message"() { + given: + def updateMsg = "Updated test message" + queueAsyncClient.create().block() + queueAsyncClient.enqueueMessage("test message before update").block() + + def dequeueMsg = queueAsyncClient.dequeueMessages().blockFirst() + when: + def updateMsgVerifier = StepVerifier.create(queueAsyncClient.updateMessage(updateMsg, + dequeueMsg.messageId(), dequeueMsg.popReceipt(), Duration.ofSeconds(1))) + def peekMsgVerifier = StepVerifier.create(queueAsyncClient.peekMessages().delaySubscription(Duration.ofSeconds(2))) + then: + updateMsgVerifier.assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 204) + }.verifyComplete() + peekMsgVerifier.assertNext { + assert updateMsg.equals(it.messageText()) + }.verifyComplete() + } + + @Unroll + def "Update message invalid args"() { + given: + queueAsyncClient.create().block() + def updateMsg = "Updated test message" + queueAsyncClient.enqueueMessage("test message before update").block() + def dequeueMessage = queueAsyncClient.dequeueMessages().blockFirst() + when: + def updateMessageId = messageId ? dequeueMessage.messageId() : dequeueMessage.messageId() + "Random" + def updatePopReceipt = popReceipt ? dequeueMessage.popReceipt() : dequeueMessage.popReceipt() + "Random" + def updateMsgVerifier = StepVerifier.create(queueAsyncClient.updateMessage(updateMsg, updateMessageId, updatePopReceipt, Duration.ofSeconds(1))) + then: + updateMsgVerifier.verifyErrorSatisfies { + assert QueueTestHelper.assertExceptionStatusCodeAndMessage(it, statusCode, errMsg) + } + where: + messageId | popReceipt | statusCode | errMsg + true | false | 400 | StorageErrorCode.INVALID_QUERY_PARAMETER_VALUE + false | true | 404 | StorageErrorCode.MESSAGE_NOT_FOUND + false | false | 400 | StorageErrorCode.INVALID_QUERY_PARAMETER_VALUE + } + +} diff --git a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/spock/QueueServiceAPITests.groovy b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/spock/QueueServiceAPITests.groovy new file mode 100644 index 000000000000..2cbcdeb7875e --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/spock/QueueServiceAPITests.groovy @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.storage.queue.spock + +import com.azure.storage.queue.QueueClient +import com.azure.storage.queue.models.Logging +import com.azure.storage.queue.models.Metrics +import com.azure.storage.queue.models.QueueItem +import com.azure.storage.queue.models.QueuesSegmentOptions +import com.azure.storage.queue.models.RetentionPolicy +import com.azure.storage.queue.models.StorageErrorCode +import com.azure.storage.queue.models.StorageErrorException +import com.azure.storage.queue.models.StorageServiceProperties +import spock.lang.Unroll + +class QueueServiceAPITests extends APISpec { + + def setup() { + primaryQueueServiceClient = queueServiceBuilderHelper(interceptorManager).buildClient() + } + + def "Get queue client"() { + given: + def queueClient = primaryQueueServiceClient.getQueueClient(testResourceName.randomName(methodName, 60)) + expect: + queueClient instanceof QueueClient + } + + def "Create queue"() { + when: + def queueClientResponse = primaryQueueServiceClient.createQueue(testResourceName.randomName(methodName, 60)) + def enqueueMessageResponse = queueClientResponse.value().enqueueMessage("Testing service client creating a queue") + then: + QueueTestHelper.assertResponseStatusCode(queueClientResponse, 201) + QueueTestHelper.assertResponseStatusCode(enqueueMessageResponse, 201) + } + + @Unroll + def "Create queue with invalid name"() { + when: + primaryQueueServiceClient.createQueue(queueName) + then: + def e = thrown(StorageErrorException) + QueueTestHelper.assertExceptionStatusCodeAndMessage(e, statusCode, errMesage) + where: + queueName | statusCode | errMesage + "a_b" | 400 | StorageErrorCode.INVALID_RESOURCE_NAME + "-ab" | 400 | StorageErrorCode.INVALID_RESOURCE_NAME + "a--b" | 400 | StorageErrorCode.INVALID_RESOURCE_NAME + "Abc" | 400 | StorageErrorCode.INVALID_RESOURCE_NAME + "ab" | 400 | StorageErrorCode.OUT_OF_RANGE_INPUT + "verylong" * 8 | 400 | StorageErrorCode.OUT_OF_RANGE_INPUT + } + + def "Create null"() { + when: + primaryQueueServiceClient.createQueue(null) + then: + thrown(NullPointerException) + } + + @Unroll + def "Create queue maxOverload"() { + when: + def queueClientResponse = primaryQueueServiceClient.createQueue(testResourceName.randomName(methodName, 60), metadata) + def enqueueMessageResponse = queueClientResponse.value().enqueueMessage("Testing service client creating a queue") + then: + QueueTestHelper.assertResponseStatusCode(queueClientResponse, 201) + QueueTestHelper.assertResponseStatusCode(enqueueMessageResponse, 201) + where: + metadata | _ + null | _ + Collections.singletonMap("metadata", "value") | _ + Collections.singletonMap("metadata", "va@lue") | _ + } + + def "Create queue with invalid metadata"() { + given: + def queueName = testResourceName.randomName(methodName, 16) + when: + primaryQueueServiceClient.createQueue(queueName, Collections.singletonMap("meta@data", "value")) + then: + def e = thrown(StorageErrorException) + QueueTestHelper.assertExceptionStatusCodeAndMessage(e, 400, "Bad Request") + } + + def "Delete queue"() { + given: + def queueName = testResourceName.randomName(methodName, 60) + when: + def queueClient = primaryQueueServiceClient.createQueue(queueName).value() + def deleteQueueResponse = primaryQueueServiceClient.deleteQueue(queueName) + queueClient.enqueueMessage("Expecting exception as queue has been deleted.") + then: + QueueTestHelper.assertResponseStatusCode(deleteQueueResponse, 204) + def e = thrown(StorageErrorException) + QueueTestHelper.assertExceptionStatusCodeAndMessage(e, 404, StorageErrorCode.QUEUE_NOT_FOUND) + } + + def "Delete queue error"() { + when: + primaryQueueServiceClient.deleteQueue(testResourceName.randomName(methodName, 60)) + then: + def e = thrown(StorageErrorException) + QueueTestHelper.assertExceptionStatusCodeAndMessage(e, 404, StorageErrorCode.QUEUE_NOT_FOUND) + } + + @Unroll + def "List queues"() { + given: + def queueName = testResourceName.randomName(methodName, 60) + LinkedList testQueues = new LinkedList<>() + for (int i = 0; i < 3; i++) { + String version = Integer.toString(i) + QueueItem queue = new QueueItem().name(queueName + version) + .metadata(Collections.singletonMap("metadata" + version, "value" + version)) + testQueues.add(queue) + primaryQueueServiceClient.createQueue(queue.name(), queue.metadata()) + } + when: + def queueListIter = primaryQueueServiceClient.listQueues(options) + then: + queueListIter.each { + QueueTestHelper.assertQueuesAreEqual(it, testQueues.pop()) + primaryQueueServiceClient.deleteQueue(it.name()) + } + testQueues.size() == 0 + where: + options | _ + new QueuesSegmentOptions().prefix("queueserviceapitestslistqueues") | _ + new QueuesSegmentOptions().prefix("queueserviceapitestslistqueues").maxResults(2) | _ + new QueuesSegmentOptions().prefix("queueserviceapitestslistqueues").includeMetadata(true) | _ + } + + def "List empty queues"() { + when: + primaryQueueServiceClient.getQueueClient(testResourceName.randomName(methodName, 60)) + then: + !primaryQueueServiceClient.listQueues(new QueuesSegmentOptions().prefix(methodName)).iterator().hasNext() + } + + def "Get and set properties"() { + given: + def originalProperties = primaryQueueServiceClient.getProperties().value() + def retentionPolicy = new RetentionPolicy().enabled(true) + .days(3) + def logging = new Logging().version("1.0") + .delete(true) + .write(true) + .retentionPolicy(retentionPolicy) + def metrics = new Metrics().enabled(true) + .includeAPIs(false) + .retentionPolicy(retentionPolicy) + .version("1.0") + def updatedProperties = new StorageServiceProperties().logging(logging) + .hourMetrics(metrics) + .minuteMetrics(metrics) + .cors(new ArrayList<>()) + + when: + def getResponseBefore = primaryQueueServiceClient.getProperties() + def setResponse = primaryQueueServiceClient.setProperties(updatedProperties) + def getResponseAfter = primaryQueueServiceClient.getProperties() + then: + QueueTestHelper.assertQueueServicePropertiesAreEqual(originalProperties, getResponseBefore.value()) + QueueTestHelper.assertResponseStatusCode(setResponse, 202) + QueueTestHelper.assertQueueServicePropertiesAreEqual(updatedProperties, getResponseAfter.value()) + } +} diff --git a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/spock/QueueServiceAsyncAPITests.groovy b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/spock/QueueServiceAsyncAPITests.groovy new file mode 100644 index 000000000000..9464cdd9aa32 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/spock/QueueServiceAsyncAPITests.groovy @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.storage.queue.spock + +import com.azure.storage.queue.QueueAsyncClient +import com.azure.storage.queue.models.Logging +import com.azure.storage.queue.models.Metrics +import com.azure.storage.queue.models.QueueItem +import com.azure.storage.queue.models.QueuesSegmentOptions +import com.azure.storage.queue.models.RetentionPolicy +import com.azure.storage.queue.models.StorageErrorCode +import com.azure.storage.queue.models.StorageServiceProperties +import reactor.test.StepVerifier +import spock.lang.Unroll + +class QueueServiceAsyncAPITests extends APISpec { + + def setup() { + primaryQueueServiceAsyncClient = queueServiceBuilderHelper(interceptorManager).buildAsyncClient() + } + + def "Get queue client"() { + given: + def queueAsyncClient = primaryQueueServiceAsyncClient.getQueueAsyncClient(testResourceName.randomName(methodName, 60)) + expect: + queueAsyncClient instanceof QueueAsyncClient + } + + def "Create queue"() { + given: + def queueName = testResourceName.randomName(methodName, 60) + expect: + StepVerifier.create(primaryQueueServiceAsyncClient.createQueue(queueName)).assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 201) + }.verifyComplete() + StepVerifier.create(primaryQueueServiceAsyncClient.getQueueAsyncClient(queueName).enqueueMessage("Testing service client creating a queue")) + .assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 201) + }.verifyComplete() + } + + @Unroll + def "Create queue with invalid name"() { + when: + def createQueueVerifier = StepVerifier.create(primaryQueueServiceAsyncClient.createQueue(queueName)) + then: + createQueueVerifier.verifyErrorSatisfies { + assert QueueTestHelper.assertExceptionStatusCodeAndMessage(it, statusCode, errMesage) + } + where: + queueName | statusCode | errMesage + "a_b" | 400 | StorageErrorCode.INVALID_RESOURCE_NAME + "-ab" | 400 | StorageErrorCode.INVALID_RESOURCE_NAME + "a--b" | 400 | StorageErrorCode.INVALID_RESOURCE_NAME + "Abc" | 400 | StorageErrorCode.INVALID_RESOURCE_NAME + "ab" | 400 | StorageErrorCode.OUT_OF_RANGE_INPUT + "verylong" * 8 | 400 | StorageErrorCode.OUT_OF_RANGE_INPUT + } + + def "Create null"() { + when: + primaryQueueServiceAsyncClient.createQueue(null) + then: + thrown(NullPointerException) + } + + @Unroll + def "Create queue maxOverload"() { + given: + def queueName = testResourceName.randomName(methodName, 60) + when: + def createQueueVerifier = StepVerifier.create(primaryQueueServiceAsyncClient.createQueue(queueName, metadata)) + def enqueueMessageVerifier = StepVerifier.create(primaryQueueServiceAsyncClient.getQueueAsyncClient(queueName) + .enqueueMessage("Testing service client creating a queue")) + then: + createQueueVerifier.assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 201) + }.verifyComplete() + enqueueMessageVerifier.assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 201) + }.verifyComplete() + + + where: + metadata | _ + null | _ + Collections.singletonMap("metadata", "value") | _ + Collections.singletonMap("metadata", "va@lue") | _ + } + + def "Create queue with invalid metadata"() { + given: + def queueName = testResourceName.randomName(methodName, 60) + when: + def createQueueVerifier = StepVerifier.create(primaryQueueServiceAsyncClient.createQueue(queueName, Collections.singletonMap("meta@data", "value"))) + then: + createQueueVerifier.verifyErrorSatisfies { + assert QueueTestHelper.assertExceptionStatusCodeAndMessage(it, 400, "Bad Request") + } + } + + def "Delete queue"() { + given: + def queueName = testResourceName.randomName(methodName, 60) + primaryQueueServiceAsyncClient.createQueue(queueName).block() + when: + def deleteQueueVerifier = StepVerifier.create(primaryQueueServiceAsyncClient.deleteQueue(queueName)) + def enqueueMessageVerifier = StepVerifier.create(primaryQueueServiceAsyncClient.getQueueAsyncClient(queueName) + .enqueueMessage("Expecting exception as queue has been deleted.")) + then: + deleteQueueVerifier.assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 204) + }.verifyComplete() + enqueueMessageVerifier.verifyErrorSatisfies { + assert QueueTestHelper.assertExceptionStatusCodeAndMessage(it, 404, StorageErrorCode.QUEUE_NOT_FOUND) + } + } + + def "Delete queue error"() { + when: + def deleteQueueVerifier = StepVerifier.create(primaryQueueServiceAsyncClient.deleteQueue(testResourceName.randomName(methodName, 16))) + then: + deleteQueueVerifier.verifyErrorSatisfies { + assert QueueTestHelper.assertExceptionStatusCodeAndMessage(it, 404, StorageErrorCode.QUEUE_NOT_FOUND) + } + } + + @Unroll + def "List queues"() { + given: + def queueName = testResourceName.randomName(methodName, 60) + LinkedList testQueues = new LinkedList<>() + for (int i = 0; i < 3; i++) { + String version = Integer.toString(i) + QueueItem queue = new QueueItem().name(queueName + version) + .metadata(Collections.singletonMap("metadata" + version, "value" + version)) + testQueues.add(queue) + primaryQueueServiceAsyncClient.createQueue(queue.name(), queue.metadata()).block() + } + when: + def queueListVerifier = StepVerifier.create(primaryQueueServiceAsyncClient.listQueues(options)) + then: + queueListVerifier.assertNext { + assert QueueTestHelper.assertQueuesAreEqual(it, testQueues.pop()) + }.assertNext { + assert QueueTestHelper.assertQueuesAreEqual(it, testQueues.pop()) + }.assertNext { + assert QueueTestHelper.assertQueuesAreEqual(it, testQueues.pop()) + }.verifyComplete() + where: + options | _ + new QueuesSegmentOptions().prefix("queueserviceasyncapitestslistqueues") | _ + new QueuesSegmentOptions().prefix("queueserviceasyncapitestslistqueues").maxResults(2) | _ + new QueuesSegmentOptions().prefix("queueserviceasyncapitestslistqueues").includeMetadata(true) | _ + } + + def "List empty queues"() { + when: + def listQueueVerifier = StepVerifier.create((primaryQueueServiceAsyncClient.listQueues(new QueuesSegmentOptions()))) + then: + listQueueVerifier.assertNext { + !it.iterator().hasNext() + } + } + + def "Get and set properties"() { + given: + def originalProperties = primaryQueueServiceAsyncClient.getProperties().block().value() + def retentionPolicy = new RetentionPolicy().enabled(true) + .days(3) + def logging = new Logging().version("1.0") + .delete(true) + .write(true) + .retentionPolicy(retentionPolicy) + def metrics = new Metrics().enabled(true) + .includeAPIs(false) + .retentionPolicy(retentionPolicy) + .version("1.0") + def updatedProperties = new StorageServiceProperties().logging(logging) + .hourMetrics(metrics) + .minuteMetrics(metrics) + .cors(new ArrayList<>()) + when: + def getPropertiesBeforeVerifier = StepVerifier.create(primaryQueueServiceAsyncClient.getProperties()) + def setPropertiesVerifier = StepVerifier.create(primaryQueueServiceAsyncClient.setProperties(updatedProperties)) + def getPropertiesAfterVerifier = StepVerifier.create(primaryQueueServiceAsyncClient.getProperties()) + then: + getPropertiesBeforeVerifier.assertNext { + assert QueueTestHelper.assertQueueServicePropertiesAreEqual(originalProperties, it.value()) + } + setPropertiesVerifier.assertNext { + assert QueueTestHelper.assertResponseStatusCode(it, 202) + }.verifyComplete() + + getPropertiesAfterVerifier.assertNext { + assert QueueTestHelper.assertQueueServicePropertiesAreEqual(updatedProperties, it.value()) + }.verifyComplete() + } +} diff --git a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/spock/QueueTestHelper.groovy b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/spock/QueueTestHelper.groovy new file mode 100644 index 000000000000..63d6afeed4e4 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/spock/QueueTestHelper.groovy @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.storage.queue.spock + +import com.azure.core.http.rest.Response +import com.azure.core.implementation.util.ImplUtils +import com.azure.core.util.configuration.ConfigurationManager +import com.azure.storage.queue.models.CorsRule +import com.azure.storage.queue.models.Logging +import com.azure.storage.queue.models.Metrics +import com.azure.storage.queue.models.QueueItem +import com.azure.storage.queue.models.RetentionPolicy +import com.azure.storage.queue.models.SignedIdentifier +import com.azure.storage.queue.models.StorageErrorCode +import com.azure.storage.queue.models.StorageErrorException +import com.azure.storage.queue.models.StorageServiceProperties + +import java.time.Duration + +class QueueTestHelper { + static boolean assertResponseStatusCode(Response response, int expectedStatusCode) { + return expectedStatusCode == response.statusCode() + } + + static boolean assertExceptionStatusCodeAndMessage(Throwable throwable, int expectedStatusCode, String errMessage) { + return assertExceptionStatusCode(throwable, expectedStatusCode) && assertExceptionErrorMessage(throwable, errMessage) + } + + static boolean assertExceptionStatusCodeAndMessage(Throwable throwable, int expectedStatusCode, StorageErrorCode errMessage) { + return assertExceptionStatusCode(throwable, expectedStatusCode) && assertExceptionErrorMessage(throwable, errMessage) + } + + static boolean assertExceptionStatusCode(Throwable throwable, int expectedStatusCode) { + if (!throwable instanceof StorageErrorException) { + return false + } + StorageErrorException storageErrorException = (StorageErrorException) throwable + return expectedStatusCode == storageErrorException.response().statusCode() + } + + static boolean assertExceptionErrorMessage(Throwable throwable, String errMessage) { + return throwable instanceof StorageErrorException && throwable.getMessage().contains(errMessage) + } + + static boolean assertExceptionErrorMessage(Throwable throwable, StorageErrorCode errMessage) { + return throwable instanceof StorageErrorException && throwable.getMessage().contains(errMessage.toString()) + } + + static boolean assertQueuesAreEqual(QueueItem expected, QueueItem actual) { + if (expected == null) { + return actual == null + } else { + if (!Objects.equals(expected.name(), actual.name())) { + return false + } + if (expected.metadata() != null && !ImplUtils.isNullOrEmpty(actual.metadata())) { + return expected.metadata().equals(actual.metadata()) + } + return true + } + } + + static boolean assertQueueServicePropertiesAreEqual(StorageServiceProperties expected, StorageServiceProperties actual) { + if (expected == null) { + return actual == null + } else { + return assertMetricsAreEqual(expected.hourMetrics(), actual.hourMetrics()) && + assertMetricsAreEqual(expected.minuteMetrics(), actual.minuteMetrics()) && + assertLoggingAreEqual(expected.logging(), actual.logging()) && + assertCorsAreEqual(expected.cors(), actual.cors()) + } + } + + static boolean assertMetricsAreEqual(Metrics expected, Metrics actual) { + if (expected == null) { + return actual == null + } else { + return Objects.equals(expected.enabled(), actual.enabled()) && + Objects.equals(expected.includeAPIs(), actual.includeAPIs()) && + Objects.equals(expected.version(), actual.version()) && + assertRetentionPoliciesAreEqual(expected.retentionPolicy(), actual.retentionPolicy()) + } + } + + static boolean assertLoggingAreEqual(Logging expected, Logging actual) { + if (expected == null) { + return actual == null + } else { + return Objects.equals(expected.read(), actual.read()) && + Objects.equals(expected.write(), actual.write()) && + Objects.equals(expected.delete(), actual.delete()) && + Objects.equals(expected.version(), actual.version()) && + assertRetentionPoliciesAreEqual(expected.retentionPolicy(), actual.retentionPolicy()) + } + } + + static boolean assertRetentionPoliciesAreEqual(RetentionPolicy expected, RetentionPolicy actual) { + if (expected == null) { + return actual == null + } else { + return Objects.equals(expected.days(), actual.days()) && + Objects.equals(expected.enabled(), actual.enabled()) + } + } + + static boolean assertCorsAreEqual(List expected, List actual) { + if (expected == null) { + return actual == null + } else { + if (expected.size() != actual.size()) { + return false + } + for (int i = 0; i < expected.size(); i++) { + if (!assertCorRulesAreEqual(expected.get(i), actual.get(i))) { + return false + } + } + return true + } + } + + static boolean assertCorRulesAreEqual(CorsRule expected, CorsRule actual) { + if (expected == null) { + return actual == null + } else { + return Objects.equals(expected.allowedHeaders(), actual.allowedHeaders()) && + Objects.equals(expected.allowedMethods(), actual.allowedMethods()) && + Objects.equals(expected.allowedOrigins(), actual.allowedOrigins()) && + Objects.equals(expected.maxAgeInSeconds(), actual.maxAgeInSeconds()) + } + } + + static boolean assertPermissionsAreEqual(SignedIdentifier expected, SignedIdentifier actual) { + if (expected == null) { + return actual == null + } + if (expected.accessPolicy() == null) { + return actual.accessPolicy() == null + } + return Objects.equals(expected.id(), actual.id()) && + Objects.equals(expected.accessPolicy().permission(), actual.accessPolicy().permission()) && + Objects.equals(expected.accessPolicy().start(), actual.accessPolicy().start()) && + Objects.equals(expected.accessPolicy().expiry(), actual.accessPolicy().expiry()) + } + + static void sleepInRecord(Duration time) { + String azureTestMode = ConfigurationManager.getConfiguration().get("AZURE_TEST_MODE") + if ("RECORD".equalsIgnoreCase(azureTestMode)) { + sleep(time) + } + } + + private static void sleep(Duration time) { + try { + Thread.sleep(time.toMillis()) + } catch (InterruptedException ex) { + // Ignore the error + } + } +} diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/updateMessage.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsClearMessages.json similarity index 54% rename from sdk/storage/azure-storage-queue/src/test/resources/session-records/updateMessage.json rename to sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsClearMessages.json index a0d2027ab04f..ed54b9123e2f 100644 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/updateMessage.json +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsClearMessages.json @@ -1,10 +1,10 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue20800231", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsclearmessages581140c4bfcb340be45", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -12,15 +12,15 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "201", - "x-ms-request-id" : "8071d53d-4003-00b9-6703-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:03 GMT" + "x-ms-request-id" : "86d0af92-d003-0034-1588-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:22 GMT" } }, { "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue20800231/messages?visibilitytimeout=0&messagettl=604800", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsclearmessages581140c4bfcb340be45/messages?visibilitytimeout=0&messagettl=604800", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", "Content-Type" : "application/xml; charset=utf-8" }, "Response" : { @@ -29,74 +29,73 @@ "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", "retry-after" : "0", "StatusCode" : "201", - "x-ms-request-id" : "8071d56d-4003-00b9-1003-47d378000000", - "Body" : "5e400587-ca00-4a0e-a557-f8c4d2e2c6c7Tue, 30 Jul 2019 18:19:03 GMTTue, 06 Aug 2019 18:19:03 GMTAgAAAAMAAAAAAAAAzOOURANH1QE=Tue, 30 Jul 2019 18:19:03 GMT", - "Date" : "Tue, 30 Jul 2019 18:19:03 GMT", + "x-ms-request-id" : "86d0af9b-d003-0034-1c88-539fde000000", + "Body" : "0d14b209-ac51-4fd3-8191-c134fc31ec65Thu, 15 Aug 2019 16:40:23 GMTThu, 22 Aug 2019 16:40:23 GMTAgAAAAMAAAAAAAAAcmFdIohT1QE=Thu, 15 Aug 2019 16:40:23 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:22 GMT", "Content-Type" : "application/xml" } }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue20800231/messages?numofmessages=1&visibilitytimeout=30", + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsclearmessages581140c4bfcb340be45/messages?visibilitytimeout=0&messagettl=604800", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" }, "Response" : { "Transfer-Encoding" : "chunked", "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "8071d58c-4003-00b9-2f03-47d378000000", - "Body" : "5e400587-ca00-4a0e-a557-f8c4d2e2c6c7Tue, 30 Jul 2019 18:19:03 GMTTue, 06 Aug 2019 18:19:03 GMTAgAAAAMAAAAAAAAAMD99VgNH1QE=Tue, 30 Jul 2019 18:19:33 GMT1test message", - "Date" : "Tue, 30 Jul 2019 18:19:03 GMT", + "StatusCode" : "201", + "x-ms-request-id" : "86d0af9e-d003-0034-1e88-539fde000000", + "Body" : "7c1347ef-6779-43f2-8b7f-6d33bfee66a3Thu, 15 Aug 2019 16:40:23 GMTThu, 22 Aug 2019 16:40:23 GMTAgAAAAMAAAAAAAAA7rliIohT1QE=Thu, 15 Aug 2019 16:40:23 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:23 GMT", "Content-Type" : "application/xml" } }, { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue20800231/messages/5e400587-ca00-4a0e-a557-f8c4d2e2c6c7?popreceipt=AgAAAAMAAAAAAAAAMD99VgNH1QE%3d&visibilitytimeout=1", + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsclearmessages581140c4bfcb340be45/messages?visibilitytimeout=0&messagettl=604800", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", "Content-Type" : "application/xml; charset=utf-8" }, "Response" : { + "Transfer-Encoding" : "chunked", "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-time-next-visible" : "Tue, 30 Jul 2019 18:19:04 GMT", "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071d5ad-4003-00b9-5003-47d378000000", - "x-ms-popreceipt" : "AwAAAAMAAAAAAAAA+cM6RQNH1QEBAAAA", - "Date" : "Tue, 30 Jul 2019 18:19:03 GMT" + "StatusCode" : "201", + "x-ms-request-id" : "86d0afab-d003-0034-2888-539fde000000", + "Body" : "50d1dc30-e0f6-4af7-9361-7af98593d4e4Thu, 15 Aug 2019 16:40:23 GMTThu, 22 Aug 2019 16:40:23 GMTAgAAAAMAAAAAAAAAizloIohT1QE=Thu, 15 Aug 2019 16:40:23 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:23 GMT", + "Content-Type" : "application/xml" } }, { "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue20800231/messages?peekonly=true", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsclearmessages581140c4bfcb340be45?comp=metadata", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { - "Transfer-Encoding" : "chunked", "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", "Cache-Control" : "no-cache", "retry-after" : "0", + "Content-Length" : "0", + "x-ms-approximate-messages-count" : "3", "StatusCode" : "200", - "x-ms-request-id" : "8071dba1-4003-00b9-0a03-47d378000000", - "Body" : "5e400587-ca00-4a0e-a557-f8c4d2e2c6c7Tue, 30 Jul 2019 18:19:03 GMTTue, 06 Aug 2019 18:19:03 GMT1updated test message", - "Date" : "Tue, 30 Jul 2019 18:19:05 GMT", - "Content-Type" : "application/xml" + "x-ms-request-id" : "86d0afae-d003-0034-2b88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:23 GMT" } }, { "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue20800231/messages", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsclearmessages581140c4bfcb340be45/messages", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -104,25 +103,27 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "204", - "x-ms-request-id" : "8071dbb7-4003-00b9-2003-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:05 GMT" + "x-ms-request-id" : "86d0afb9-d003-0034-3388-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:23 GMT" } }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue20800231", + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsclearmessages581140c4bfcb340be45?comp=metadata", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", "retry-after" : "0", "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071dbd1-4003-00b9-3a03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:05 GMT" + "x-ms-approximate-messages-count" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b033-d003-0034-1c88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:24 GMT" } } ], - "variables" : [ "queue20800231" ] + "variables" : [ "queueapitestsclearmessages581140c4bfcb340be45" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsClearMessagesError.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsClearMessagesError.json new file mode 100644 index 000000000000..feb60836c10b --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsClearMessagesError.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "DELETE", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsclearmessageserror122895bd11a3c794a/messages", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "QueueNotFound", + "retry-after" : "0", + "Content-Length" : "217", + "StatusCode" : "404", + "x-ms-request-id" : "86d0b046-d003-0034-2e88-539fde000000", + "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:86d0b046-d003-0034-2e88-539fde000000\nTime:2019-08-15T16:40:24.6890548Z", + "Date" : "Thu, 15 Aug 2019 16:40:24 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestsclearmessageserror122895bd11a3c794a" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsCreateQueueWithSharedKey.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsCreateQueueWithSharedKey.json new file mode 100644 index 000000000000..371a132c6bb3 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsCreateQueueWithSharedKey.json @@ -0,0 +1,20 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestscreatequeuewithsharedkey08458bcc81be1e", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0a973-d003-0034-2088-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:11 GMT" + } + } ], + "variables" : [ "queueapitestscreatequeuewithsharedkey08458bcc81be1e" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDeleteExistQueue.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDeleteExistQueue.json new file mode 100644 index 000000000000..b40ca18da630 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDeleteExistQueue.json @@ -0,0 +1,36 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeleteexistqueue16092c5b3100623794", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0aaa8-d003-0034-3a88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:12 GMT" + } + }, { + "Method" : "DELETE", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeleteexistqueue16092c5b3100623794", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "86d0aaab-d003-0034-3c88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:12 GMT" + } + } ], + "variables" : [ "queueapitestsdeleteexistqueue16092c5b3100623794" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/clearMessages.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDeleteMessage.json similarity index 53% rename from sdk/storage/azure-storage-queue/src/test/resources/session-records/clearMessages.json rename to sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDeleteMessage.json index cebb31166bc9..dca62988411f 100644 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/clearMessages.json +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDeleteMessage.json @@ -1,10 +1,10 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue78895e13", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeletemessage20200a7539ef17c4a41", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -12,15 +12,15 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "201", - "x-ms-request-id" : "8071d18f-4003-00b9-5e03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:02 GMT" + "x-ms-request-id" : "86d0b058-d003-0034-3b88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:24 GMT" } }, { "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue78895e13/messages?visibilitytimeout=0&messagettl=604800", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeletemessage20200a7539ef17c4a41/messages?visibilitytimeout=0&messagettl=604800", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", "Content-Type" : "application/xml; charset=utf-8" }, "Response" : { @@ -29,17 +29,17 @@ "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", "retry-after" : "0", "StatusCode" : "201", - "x-ms-request-id" : "8071d1bb-4003-00b9-0603-47d378000000", - "Body" : "1a1dabd1-b690-42c7-a22a-665c69ceffccTue, 30 Jul 2019 18:19:02 GMTTue, 06 Aug 2019 18:19:02 GMTAgAAAAMAAAAAAAAAi1HbQwNH1QE=Tue, 30 Jul 2019 18:19:02 GMT", - "Date" : "Tue, 30 Jul 2019 18:19:02 GMT", + "x-ms-request-id" : "86d0b05d-d003-0034-3f88-539fde000000", + "Body" : "93569445-b0d1-4230-998c-3c502ddc767bThu, 15 Aug 2019 16:40:24 GMTThu, 22 Aug 2019 16:40:24 GMTAgAAAAMAAAAAAAAAv9gvI4hT1QE=Thu, 15 Aug 2019 16:40:24 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:24 GMT", "Content-Type" : "application/xml" } }, { "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue78895e13/messages?visibilitytimeout=0&messagettl=604800", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeletemessage20200a7539ef17c4a41/messages?visibilitytimeout=0&messagettl=604800", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", "Content-Type" : "application/xml; charset=utf-8" }, "Response" : { @@ -48,17 +48,17 @@ "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", "retry-after" : "0", "StatusCode" : "201", - "x-ms-request-id" : "8071d1dd-4003-00b9-2503-47d378000000", - "Body" : "c10ecce0-b3b6-4098-96ae-8aa611501ffbTue, 30 Jul 2019 18:19:02 GMTTue, 06 Aug 2019 18:19:02 GMTAgAAAAMAAAAAAAAAVabiQwNH1QE=Tue, 30 Jul 2019 18:19:02 GMT", - "Date" : "Tue, 30 Jul 2019 18:19:02 GMT", + "x-ms-request-id" : "86d0b064-d003-0034-4588-539fde000000", + "Body" : "0ee737df-f37c-41cc-8f4a-d53c7426e5cdThu, 15 Aug 2019 16:40:24 GMTThu, 22 Aug 2019 16:40:24 GMTAgAAAAMAAAAAAAAA7EI2I4hT1QE=Thu, 15 Aug 2019 16:40:24 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:24 GMT", "Content-Type" : "application/xml" } }, { "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue78895e13/messages?visibilitytimeout=0&messagettl=604800", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeletemessage20200a7539ef17c4a41/messages?visibilitytimeout=0&messagettl=604800", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", "Content-Type" : "application/xml; charset=utf-8" }, "Response" : { @@ -67,51 +67,36 @@ "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", "retry-after" : "0", "StatusCode" : "201", - "x-ms-request-id" : "8071d201-4003-00b9-4603-47d378000000", - "Body" : "962a6b38-e375-4fae-a052-8d25207ff09bTue, 30 Jul 2019 18:19:02 GMTTue, 06 Aug 2019 18:19:02 GMTAgAAAAMAAAAAAAAAv9fnQwNH1QE=Tue, 30 Jul 2019 18:19:02 GMT", - "Date" : "Tue, 30 Jul 2019 18:19:02 GMT", + "x-ms-request-id" : "86d0b06d-d003-0034-4d88-539fde000000", + "Body" : "f2d85c0a-9cbe-43fa-9323-766e875322ccThu, 15 Aug 2019 16:40:24 GMTThu, 22 Aug 2019 16:40:24 GMTAgAAAAMAAAAAAAAAjNA+I4hT1QE=Thu, 15 Aug 2019 16:40:24 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:24 GMT", "Content-Type" : "application/xml" } }, { "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue78895e13?comp=metadata", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeletemessage20200a7539ef17c4a41/messages?numofmessages=1&visibilitytimeout=30", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { + "Transfer-Encoding" : "chunked", "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", "Cache-Control" : "no-cache", "retry-after" : "0", - "Content-Length" : "0", - "x-ms-approximate-messages-count" : "3", "StatusCode" : "200", - "x-ms-request-id" : "8071d225-4003-00b9-6903-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:02 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue78895e13/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071d23d-4003-00b9-8003-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:02 GMT" + "x-ms-request-id" : "86d0b072-d003-0034-5188-539fde000000", + "Body" : "93569445-b0d1-4230-998c-3c502ddc767bThu, 15 Aug 2019 16:40:24 GMTThu, 22 Aug 2019 16:40:24 GMTAgAAAAMAAAAAAAAAZWgmNYhT1QE=Thu, 15 Aug 2019 16:40:54 GMT1test message 1", + "Date" : "Thu, 15 Aug 2019 16:40:24 GMT", + "Content-Type" : "application/xml" } }, { "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue78895e13?comp=metadata", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeletemessage20200a7539ef17c4a41?comp=metadata", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -119,17 +104,17 @@ "Cache-Control" : "no-cache", "retry-after" : "0", "Content-Length" : "0", - "x-ms-approximate-messages-count" : "0", + "x-ms-approximate-messages-count" : "3", "StatusCode" : "200", - "x-ms-request-id" : "8071d257-4003-00b9-1703-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:02 GMT" + "x-ms-request-id" : "86d0b075-d003-0034-5488-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:24 GMT" } }, { "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue78895e13/messages", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeletemessage20200a7539ef17c4a41/messages/93569445-b0d1-4230-998c-3c502ddc767b?popreceipt=AgAAAAMAAAAAAAAAZWgmNYhT1QE%3d", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -137,25 +122,27 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "204", - "x-ms-request-id" : "8071d26d-4003-00b9-2d03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:02 GMT" + "x-ms-request-id" : "86d0b07b-d003-0034-5a88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:24 GMT" } }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue78895e13", + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeletemessage20200a7539ef17c4a41?comp=metadata", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", "retry-after" : "0", "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071d283-4003-00b9-4303-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:02 GMT" + "x-ms-approximate-messages-count" : "2", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b083-d003-0034-6288-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:24 GMT" } } ], - "variables" : [ "queue78895e13" ] + "variables" : [ "queueapitestsdeletemessage20200a7539ef17c4a41" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDeleteMessageInvalidArgs0.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDeleteMessageInvalidArgs0.json new file mode 100644 index 000000000000..dc272ed0c65c --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDeleteMessageInvalidArgs0.json @@ -0,0 +1,77 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeletemessageinvalidargs09162111d13721", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b093-d003-0034-7088-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:24 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeletemessageinvalidargs09162111d13721/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b09d-d003-0034-7788-539fde000000", + "Body" : "04214a11-cec5-4791-ba97-8228b2da7a45Thu, 15 Aug 2019 16:40:25 GMTThu, 22 Aug 2019 16:40:25 GMTAgAAAAMAAAAAAAAA+yR7I4hT1QE=Thu, 15 Aug 2019 16:40:25 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:24 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeletemessageinvalidargs09162111d13721/messages?numofmessages=1&visibilitytimeout=30", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b0a2-d003-0034-7b88-539fde000000", + "Body" : "04214a11-cec5-4791-ba97-8228b2da7a45Thu, 15 Aug 2019 16:40:25 GMTThu, 22 Aug 2019 16:40:25 GMTAgAAAAMAAAAAAAAADAtjNYhT1QE=Thu, 15 Aug 2019 16:40:55 GMT1test message", + "Date" : "Thu, 15 Aug 2019 16:40:24 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "DELETE", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeletemessageinvalidargs09162111d13721/messages/04214a11-cec5-4791-ba97-8228b2da7a45?popreceipt=AgAAAAMAAAAAAAAADAtjNYhT1QE%3dRandom", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidQueryParameterValue", + "retry-after" : "0", + "Content-Length" : "444", + "StatusCode" : "400", + "x-ms-request-id" : "86d0b0a5-d003-0034-7e88-539fde000000", + "Body" : "InvalidQueryParameterValueValue for one of the query parameters specified in the request URI is invalid.\nRequestId:86d0b0a5-d003-0034-7e88-539fde000000\nTime:2019-08-15T16:40:25.4037442ZpopreceiptAgAAAAMAAAAAAAAADAtjNYhT1QE=RandomInvalid pop receipt format", + "Date" : "Thu, 15 Aug 2019 16:40:24 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestsdeletemessageinvalidargs09162111d13721" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/dequeueMessage.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDeleteMessageInvalidArgs1.json similarity index 51% rename from sdk/storage/azure-storage-queue/src/test/resources/session-records/dequeueMessage.json rename to sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDeleteMessageInvalidArgs1.json index 235330aad38c..a4539a5b6961 100644 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/dequeueMessage.json +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDeleteMessageInvalidArgs1.json @@ -1,10 +1,10 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue854564d6", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeletemessageinvalidargs158450b740d8f3", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -12,15 +12,15 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "201", - "x-ms-request-id" : "8071bb3b-4003-00b9-2f03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:18:55 GMT" + "x-ms-request-id" : "86d0b0b6-d003-0034-0e88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:25 GMT" } }, { "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue854564d6/messages?visibilitytimeout=0&messagettl=604800", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeletemessageinvalidargs158450b740d8f3/messages?visibilitytimeout=0&messagettl=604800", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", "Content-Type" : "application/xml; charset=utf-8" }, "Response" : { @@ -29,17 +29,17 @@ "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", "retry-after" : "0", "StatusCode" : "201", - "x-ms-request-id" : "8071bb62-4003-00b9-5403-47d378000000", - "Body" : "e019e0ee-2a4a-4a02-ba68-ecd484c51b2cTue, 30 Jul 2019 18:18:55 GMTTue, 06 Aug 2019 18:18:55 GMTAgAAAAMAAAAAAAAAszfJPwNH1QE=Tue, 30 Jul 2019 18:18:55 GMT", - "Date" : "Tue, 30 Jul 2019 18:18:55 GMT", + "x-ms-request-id" : "86d0b0bd-d003-0034-1488-539fde000000", + "Body" : "34e78151-51d8-45fa-b3f4-f3e5a1e6c31fThu, 15 Aug 2019 16:40:25 GMTThu, 22 Aug 2019 16:40:25 GMTAgAAAAMAAAAAAAAARv6kI4hT1QE=Thu, 15 Aug 2019 16:40:25 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:25 GMT", "Content-Type" : "application/xml" } }, { "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue854564d6/messages?numofmessages=1&visibilitytimeout=30", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeletemessageinvalidargs158450b740d8f3/messages?numofmessages=1&visibilitytimeout=30", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "Transfer-Encoding" : "chunked", @@ -48,43 +48,30 @@ "Cache-Control" : "no-cache", "retry-after" : "0", "StatusCode" : "200", - "x-ms-request-id" : "8071bb7d-4003-00b9-6e03-47d378000000", - "Body" : "e019e0ee-2a4a-4a02-ba68-ecd484c51b2cTue, 30 Jul 2019 18:18:55 GMTTue, 06 Aug 2019 18:18:55 GMTAgAAAAMAAAAAAAAAGAywUQNH1QE=Tue, 30 Jul 2019 18:19:25 GMT1test message", - "Date" : "Tue, 30 Jul 2019 18:18:55 GMT", + "x-ms-request-id" : "86d0b0c0-d003-0034-1688-539fde000000", + "Body" : "34e78151-51d8-45fa-b3f4-f3e5a1e6c31fThu, 15 Aug 2019 16:40:25 GMTThu, 22 Aug 2019 16:40:25 GMTAgAAAAMAAAAAAAAASb2MNYhT1QE=Thu, 15 Aug 2019 16:40:55 GMT1test message", + "Date" : "Thu, 15 Aug 2019 16:40:25 GMT", "Content-Type" : "application/xml" } }, { "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue854564d6/messages", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeletemessageinvalidargs158450b740d8f3/messages/34e78151-51d8-45fa-b3f4-f3e5a1e6c31fRandom?popreceipt=AgAAAAMAAAAAAAAASb2MNYhT1QE%3d", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "MessageNotFound", "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071bb94-4003-00b9-0403-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:18:55 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue854564d6", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071bbb2-4003-00b9-2103-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:18:55 GMT" + "Content-Length" : "221", + "StatusCode" : "404", + "x-ms-request-id" : "86d0b0c4-d003-0034-1a88-539fde000000", + "Body" : "MessageNotFoundThe specified message does not exist.\nRequestId:86d0b0c4-d003-0034-1a88-539fde000000\nTime:2019-08-15T16:40:26.7240160Z", + "Date" : "Thu, 15 Aug 2019 16:40:26 GMT", + "Content-Type" : "application/xml" } } ], - "variables" : [ "queue854564d6" ] + "variables" : [ "queueapitestsdeletemessageinvalidargs158450b740d8f3" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDeleteMessageInvalidArgs2.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDeleteMessageInvalidArgs2.json new file mode 100644 index 000000000000..b42487e3c437 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDeleteMessageInvalidArgs2.json @@ -0,0 +1,77 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeletemessageinvalidargs2763886d20e03f", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b156-d003-0034-1888-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:26 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeletemessageinvalidargs2763886d20e03f/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b15a-d003-0034-1b88-539fde000000", + "Body" : "d44b25ff-a01e-46c3-a447-96fe43f58dccThu, 15 Aug 2019 16:40:26 GMTThu, 22 Aug 2019 16:40:26 GMTAgAAAAMAAAAAAAAA2md0JIhT1QE=Thu, 15 Aug 2019 16:40:26 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:26 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeletemessageinvalidargs2763886d20e03f/messages?numofmessages=1&visibilitytimeout=30", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b162-d003-0034-2288-539fde000000", + "Body" : "d44b25ff-a01e-46c3-a447-96fe43f58dccThu, 15 Aug 2019 16:40:26 GMTThu, 22 Aug 2019 16:40:26 GMTAgAAAAMAAAAAAAAA7tRdNohT1QE=Thu, 15 Aug 2019 16:40:57 GMT1test message", + "Date" : "Thu, 15 Aug 2019 16:40:26 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "DELETE", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeletemessageinvalidargs2763886d20e03f/messages/d44b25ff-a01e-46c3-a447-96fe43f58dccRandom?popreceipt=AgAAAAMAAAAAAAAA7tRdNohT1QE%3dRandom", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidQueryParameterValue", + "retry-after" : "0", + "Content-Length" : "444", + "StatusCode" : "400", + "x-ms-request-id" : "86d0b166-d003-0034-2688-539fde000000", + "Body" : "InvalidQueryParameterValueValue for one of the query parameters specified in the request URI is invalid.\nRequestId:86d0b166-d003-0034-2688-539fde000000\nTime:2019-08-15T16:40:27.0473254ZpopreceiptAgAAAAMAAAAAAAAA7tRdNohT1QE=RandomInvalid pop receipt format", + "Date" : "Thu, 15 Aug 2019 16:40:26 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestsdeletemessageinvalidargs2763886d20e03f" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/createWithSharedKey.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDeleteQueueError.json similarity index 64% rename from sdk/storage/azure-storage-queue/src/test/resources/session-records/createWithSharedKey.json rename to sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDeleteQueueError.json index f7db9ce0ce35..ca2f032e1942 100644 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/createWithSharedKey.json +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDeleteQueueError.json @@ -1,10 +1,10 @@ { "networkCallRecords" : [ { "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue07130666/messages", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdeletequeueerror47957ce5611a14cab4", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -13,11 +13,11 @@ "retry-after" : "0", "Content-Length" : "217", "StatusCode" : "404", - "x-ms-request-id" : "807249d1-4003-00b9-4903-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:807249d1-4003-00b9-4903-47d378000000\nTime:2019-07-30T18:19:38.6260705Z", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT", + "x-ms-request-id" : "86d0aabe-d003-0034-4c88-539fde000000", + "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:86d0aabe-d003-0034-4c88-539fde000000\nTime:2019-08-15T16:40:13.4041901Z", + "Date" : "Thu, 15 Aug 2019 16:40:12 GMT", "Content-Type" : "application/xml" } } ], - "variables" : [ "queue07130666" ] + "variables" : [ "queueapitestsdeletequeueerror47957ce5611a14cab4" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDequeueMessage.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDequeueMessage.json new file mode 100644 index 000000000000..34052e1ef61a --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDequeueMessage.json @@ -0,0 +1,58 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdequeuemessage40686e81eb135e6394b", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0aea3-d003-0034-4888-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:21 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdequeuemessage40686e81eb135e6394b/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0aea8-d003-0034-4c88-539fde000000", + "Body" : "37450095-9ca3-4ca2-99a1-bae358e91a42Thu, 15 Aug 2019 16:40:21 GMTThu, 22 Aug 2019 16:40:21 GMTAgAAAAMAAAAAAAAA9N08IYhT1QE=Thu, 15 Aug 2019 16:40:21 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:21 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdequeuemessage40686e81eb135e6394b/messages?numofmessages=1&visibilitytimeout=30", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0aeae-d003-0034-5088-539fde000000", + "Body" : "37450095-9ca3-4ca2-99a1-bae358e91a42Thu, 15 Aug 2019 16:40:21 GMTThu, 22 Aug 2019 16:40:21 GMTAgAAAAMAAAAAAAAAHwcrM4hT1QE=Thu, 15 Aug 2019 16:40:51 GMT1test message", + "Date" : "Thu, 15 Aug 2019 16:40:21 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestsdequeuemessage40686e81eb135e6394b" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDequeueMultipleMessages.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDequeueMultipleMessages.json new file mode 100644 index 000000000000..cc703c743ce7 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDequeueMultipleMessages.json @@ -0,0 +1,77 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdequeuemultiplemessages96761fe8475eda", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0aeba-d003-0034-5c88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:21 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdequeuemultiplemessages96761fe8475eda/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0aec1-d003-0034-6288-539fde000000", + "Body" : "1cd3a95f-913c-4ef2-a26c-ed2b2a46fa00Thu, 15 Aug 2019 16:40:21 GMTThu, 22 Aug 2019 16:40:21 GMTAgAAAAMAAAAAAAAAxQFpIYhT1QE=Thu, 15 Aug 2019 16:40:21 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:21 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdequeuemultiplemessages96761fe8475eda/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0aed1-d003-0034-6f88-539fde000000", + "Body" : "ac53ec4a-dc07-4a31-a089-3dbc2a66a05dThu, 15 Aug 2019 16:40:21 GMTThu, 22 Aug 2019 16:40:21 GMTAgAAAAMAAAAAAAAADaFyIYhT1QE=Thu, 15 Aug 2019 16:40:21 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:21 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdequeuemultiplemessages96761fe8475eda/messages?numofmessages=2&visibilitytimeout=30", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0aed7-d003-0034-7388-539fde000000", + "Body" : "1cd3a95f-913c-4ef2-a26c-ed2b2a46fa00Thu, 15 Aug 2019 16:40:21 GMTThu, 22 Aug 2019 16:40:21 GMTAgAAAAMAAAAAAAAAcVxcM4hT1QE=Thu, 15 Aug 2019 16:40:51 GMT1test message 1ac53ec4a-dc07-4a31-a089-3dbc2a66a05dThu, 15 Aug 2019 16:40:21 GMTThu, 22 Aug 2019 16:40:21 GMTAgAAAAMAAAAAAAAAcVxcM4hT1QE=Thu, 15 Aug 2019 16:40:51 GMT1test message 2", + "Date" : "Thu, 15 Aug 2019 16:40:21 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestsdequeuemultiplemessages96761fe8475eda" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDequeueTooManyMessage.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDequeueTooManyMessage.json new file mode 100644 index 000000000000..6ff627a06894 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsDequeueTooManyMessage.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdequeuetoomanymessage820232eb14b1658", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0aee4-d003-0034-7f88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:21 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsdequeuetoomanymessage820232eb14b1658/messages?numofmessages=33&visibilitytimeout=30", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "OutOfRangeQueryParameterValue", + "retry-after" : "0", + "Content-Length" : "456", + "StatusCode" : "400", + "x-ms-request-id" : "86d0aee9-d003-0034-0388-539fde000000", + "Body" : "OutOfRangeQueryParameterValueOne of the query parameters specified in the request URI is outside the permissible range.\nRequestId:86d0aee9-d003-0034-0388-539fde000000\nTime:2019-08-15T16:40:22.1496102Znumofmessages33132", + "Date" : "Thu, 15 Aug 2019 16:40:21 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestsdequeuetoomanymessage820232eb14b1658" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsEnqueueEmptyMessage.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsEnqueueEmptyMessage.json new file mode 100644 index 000000000000..3ecbe42fe7f1 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsEnqueueEmptyMessage.json @@ -0,0 +1,58 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsenqueueemptymessage69434f760bff89a1", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0ae5f-d003-0034-0c88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:20 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsenqueueemptymessage69434f760bff89a1/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0ae64-d003-0034-1088-539fde000000", + "Body" : "0541e4ad-a35d-436e-adaa-1b7e39276645Thu, 15 Aug 2019 16:40:20 GMTThu, 22 Aug 2019 16:40:20 GMTAgAAAAMAAAAAAAAAWdTNIIhT1QE=Thu, 15 Aug 2019 16:40:20 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:20 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsenqueueemptymessage69434f760bff89a1/messages?peekonly=true", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0ae77-d003-0034-2088-539fde000000", + "Body" : "0541e4ad-a35d-436e-adaa-1b7e39276645Thu, 15 Aug 2019 16:40:20 GMTThu, 22 Aug 2019 16:40:20 GMT0", + "Date" : "Thu, 15 Aug 2019 16:40:20 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestsenqueueemptymessage69434f760bff89a1" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsEnqueueMessage.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsEnqueueMessage.json new file mode 100644 index 000000000000..b0caf47f0fb4 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsEnqueueMessage.json @@ -0,0 +1,58 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsenqueuemessage05407f375599df86241", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0ae3a-d003-0034-6988-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:19 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsenqueuemessage05407f375599df86241/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0ae45-d003-0034-7388-539fde000000", + "Body" : "2593cc1c-1b8c-44ad-88a1-57fd2eba3fd6Thu, 15 Aug 2019 16:40:20 GMTThu, 22 Aug 2019 16:40:20 GMTAgAAAAMAAAAAAAAAmIaYIIhT1QE=Thu, 15 Aug 2019 16:40:20 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:20 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsenqueuemessage05407f375599df86241/messages?peekonly=true", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0ae51-d003-0034-7e88-539fde000000", + "Body" : "2593cc1c-1b8c-44ad-88a1-57fd2eba3fd6Thu, 15 Aug 2019 16:40:20 GMTThu, 22 Aug 2019 16:40:20 GMT0test message", + "Date" : "Thu, 15 Aug 2019 16:40:20 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestsenqueuemessage05407f375599df86241" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsEnqueueTimeToLive.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsEnqueueTimeToLive.json new file mode 100644 index 000000000000..31e4c78f7180 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsEnqueueTimeToLive.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsenqueuetimetolive94210574071164c6f", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0ae88-d003-0034-3088-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:20 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsenqueuetimetolive94210574071164c6f/messages?visibilitytimeout=0&messagettl=2", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0ae97-d003-0034-3d88-539fde000000", + "Body" : "06a2ea01-3dc2-4a7d-b352-2a0471fface0Thu, 15 Aug 2019 16:40:21 GMTThu, 15 Aug 2019 16:40:23 GMTAgAAAAMAAAAAAAAAdiMiIYhT1QE=Thu, 15 Aug 2019 16:40:21 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:20 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestsenqueuetimetolive94210574071164c6f" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsGetAccessPolicy.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsGetAccessPolicy.json new file mode 100644 index 000000000000..7c104d49cf6b --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsGetAccessPolicy.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsgetaccesspolicy3986549d9a11fe03c4", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0ac98-d003-0034-0188-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:16 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsgetaccesspolicy3986549d9a11fe03c4?comp=acl", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0aca0-d003-0034-0888-539fde000000", + "Body" : "", + "Date" : "Thu, 15 Aug 2019 16:40:17 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestsgetaccesspolicy3986549d9a11fe03c4" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsGetAccessPolicyError.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsGetAccessPolicyError.json new file mode 100644 index 000000000000..fb065f326b17 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsGetAccessPolicyError.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsgetaccesspolicyerror58413efeb5fdae94?comp=acl", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "QueueNotFound", + "retry-after" : "0", + "Content-Length" : "217", + "StatusCode" : "404", + "x-ms-request-id" : "86d0ad6f-d003-0034-3f88-539fde000000", + "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:86d0ad6f-d003-0034-3f88-539fde000000\nTime:2019-08-15T16:40:18.6602495Z", + "Date" : "Thu, 15 Aug 2019 16:40:18 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestsgetaccesspolicyerror58413efeb5fdae94" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsGetProperties.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsGetProperties.json new file mode 100644 index 000000000000..81502bd84d67 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsGetProperties.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsgetproperties49283bebfe496c1124d", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0aad7-d003-0034-6388-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:13 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsgetproperties49283bebfe496c1124d?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "x-ms-meta-metadata" : "value", + "retry-after" : "0", + "Content-Length" : "0", + "x-ms-approximate-messages-count" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0aae0-d003-0034-6b88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:13 GMT" + } + } ], + "variables" : [ "queueapitestsgetproperties49283bebfe496c1124d" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsGetPropertiesError.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsGetPropertiesError.json new file mode 100644 index 000000000000..f2a64cf9961d --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsGetPropertiesError.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsgetpropertieserror86495a85dbf5a65c1?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "QueueNotFound", + "retry-after" : "0", + "Content-Length" : "217", + "StatusCode" : "404", + "x-ms-request-id" : "86d0ab03-d003-0034-0988-539fde000000", + "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:86d0ab03-d003-0034-0988-539fde000000\nTime:2019-08-15T16:40:13.7735459Z", + "Date" : "Thu, 15 Aug 2019 16:40:13 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestsgetpropertieserror86495a85dbf5a65c1" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsPeekMessage.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsPeekMessage.json new file mode 100644 index 000000000000..d2012bf8ba5f --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsPeekMessage.json @@ -0,0 +1,58 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestspeekmessagequeueapitestspeekmessage944948491b", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0aef6-d003-0034-1088-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:21 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestspeekmessagequeueapitestspeekmessage944948491b/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0aefe-d003-0034-1788-539fde000000", + "Body" : "33245f64-21f2-4a10-84c2-f010f339e2aeThu, 15 Aug 2019 16:40:22 GMTThu, 22 Aug 2019 16:40:22 GMTAgAAAAMAAAAAAAAAR8O0IYhT1QE=Thu, 15 Aug 2019 16:40:22 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:21 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestspeekmessagequeueapitestspeekmessage944948491b/messages?peekonly=true", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0af00-d003-0034-1988-539fde000000", + "Body" : "33245f64-21f2-4a10-84c2-f010f339e2aeThu, 15 Aug 2019 16:40:22 GMTThu, 22 Aug 2019 16:40:22 GMT0test message", + "Date" : "Thu, 15 Aug 2019 16:40:21 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestspeekmessagequeueapitestspeekmessage944948491b" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsPeekMessagesError.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsPeekMessagesError.json new file mode 100644 index 000000000000..716f59b91442 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsPeekMessagesError.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestspeekmessageserror659934ae7b76e1ec7/messages?peekonly=true", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "QueueNotFound", + "retry-after" : "0", + "Content-Length" : "217", + "StatusCode" : "404", + "x-ms-request-id" : "86d0af82-d003-0034-0988-539fde000000", + "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:86d0af82-d003-0034-0988-539fde000000\nTime:2019-08-15T16:40:23.3367515Z", + "Date" : "Thu, 15 Aug 2019 16:40:22 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestspeekmessageserror659934ae7b76e1ec7" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsPeekMultipleMessages.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsPeekMultipleMessages.json new file mode 100644 index 000000000000..4031845fa5cf --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsPeekMultipleMessages.json @@ -0,0 +1,77 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestspeekmultiplemessages99123b27adb7405a", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0af13-d003-0034-2c88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:22 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestspeekmultiplemessages99123b27adb7405a/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0af1d-d003-0034-3488-539fde000000", + "Body" : "3a919a7a-35c7-4553-b19d-68b7d97f9ed8Thu, 15 Aug 2019 16:40:22 GMTThu, 22 Aug 2019 16:40:22 GMTAgAAAAMAAAAAAAAAPNbUIYhT1QE=Thu, 15 Aug 2019 16:40:22 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:22 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestspeekmultiplemessages99123b27adb7405a/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0af32-d003-0034-4688-539fde000000", + "Body" : "2e8db9be-aa49-41a9-afb0-d9af0211f6b1Thu, 15 Aug 2019 16:40:22 GMTThu, 22 Aug 2019 16:40:22 GMTAgAAAAMAAAAAAAAAfGz4IYhT1QE=Thu, 15 Aug 2019 16:40:22 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:22 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestspeekmultiplemessages99123b27adb7405a/messages?numofmessages=2&peekonly=true", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0af4b-d003-0034-5b88-539fde000000", + "Body" : "3a919a7a-35c7-4553-b19d-68b7d97f9ed8Thu, 15 Aug 2019 16:40:22 GMTThu, 22 Aug 2019 16:40:22 GMT0test message 12e8db9be-aa49-41a9-afb0-d9af0211f6b1Thu, 15 Aug 2019 16:40:22 GMTThu, 22 Aug 2019 16:40:22 GMT0test message 2", + "Date" : "Thu, 15 Aug 2019 16:40:22 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestspeekmultiplemessages99123b27adb7405a" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsPeekTooManyMessage.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsPeekTooManyMessage.json new file mode 100644 index 000000000000..2e0cc4207f4c --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsPeekTooManyMessage.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestspeektoomanymessage8011625e0f9c2fd32", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0af60-d003-0034-6c88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:22 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestspeektoomanymessage8011625e0f9c2fd32/messages?numofmessages=33&peekonly=true", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "OutOfRangeQueryParameterValue", + "retry-after" : "0", + "Content-Length" : "456", + "StatusCode" : "400", + "x-ms-request-id" : "86d0af66-d003-0034-7088-539fde000000", + "Body" : "OutOfRangeQueryParameterValueOne of the query parameters specified in the request URI is outside the permissible range.\nRequestId:86d0af66-d003-0034-7088-539fde000000\nTime:2019-08-15T16:40:23.2106294Znumofmessages33132", + "Date" : "Thu, 15 Aug 2019 16:40:22 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestspeektoomanymessage8011625e0f9c2fd32" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/setAccessPolicy.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetAccessPolicy.json similarity index 50% rename from sdk/storage/azure-storage-queue/src/test/resources/session-records/setAccessPolicy.json rename to sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetAccessPolicy.json index cc3a358651b1..96f21b61b602 100644 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/setAccessPolicy.json +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetAccessPolicy.json @@ -1,10 +1,10 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue392406b1", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetaccesspolicy7404808264b0d36334", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -12,15 +12,15 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "201", - "x-ms-request-id" : "807244f3-4003-00b9-1603-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT" + "x-ms-request-id" : "86d0ad7a-d003-0034-4688-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:18 GMT" } }, { "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue392406b1?comp=acl", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetaccesspolicy7404808264b0d36334?comp=acl", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", "Content-Type" : "application/xml; charset=utf-8" }, "Response" : { @@ -29,15 +29,15 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "204", - "x-ms-request-id" : "80724521-4003-00b9-4103-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT" + "x-ms-request-id" : "86d0ad9a-d003-0034-5f88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:18 GMT" } }, { "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue392406b1?comp=acl", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetaccesspolicy7404808264b0d36334?comp=acl", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "Transfer-Encoding" : "chunked", @@ -46,43 +46,11 @@ "Cache-Control" : "no-cache", "retry-after" : "0", "StatusCode" : "200", - "x-ms-request-id" : "80724540-4003-00b9-5f03-47d378000000", + "x-ms-request-id" : "86d0ad9e-d003-0034-6388-539fde000000", "Body" : "testpermission2000-01-01T00:00:00.0000000Z2020-01-01T00:00:00.0000000Zraup", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:18 GMT", "Content-Type" : "application/xml" } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue392406b1/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "80724551-4003-00b9-7003-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue392406b1", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "80724569-4003-00b9-0803-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT" - } } ], - "variables" : [ "queue392406b1" ] + "variables" : [ "queueapitestssetaccesspolicy7404808264b0d36334" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/getAccessPolicy.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetAndClearMetadata0.json similarity index 59% rename from sdk/storage/azure-storage-queue/src/test/resources/session-records/getAccessPolicy.json rename to sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetAndClearMetadata0.json index f4583b3a1ca6..7b3c4ae923c0 100644 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/getAccessPolicy.json +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetAndClearMetadata0.json @@ -1,10 +1,10 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue9583269e", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetandclearmetadata069712b1b824a4f5a", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -12,34 +12,33 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "201", - "x-ms-request-id" : "8071d4c3-4003-00b9-7003-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:03 GMT" + "x-ms-request-id" : "86d0ab14-d003-0034-1888-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:13 GMT" } }, { "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue9583269e?comp=acl", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetandclearmetadata069712b1b824a4f5a?comp=metadata", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { - "Transfer-Encoding" : "chunked", "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", "Cache-Control" : "no-cache", "retry-after" : "0", + "Content-Length" : "0", + "x-ms-approximate-messages-count" : "0", "StatusCode" : "200", - "x-ms-request-id" : "8071d4e3-4003-00b9-0e03-47d378000000", - "Body" : "", - "Date" : "Tue, 30 Jul 2019 18:19:03 GMT", - "Content-Type" : "application/xml" + "x-ms-request-id" : "86d0ab1c-d003-0034-1f88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:13 GMT" } }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue9583269e/messages", + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetandclearmetadata069712b1b824a4f5a?comp=metadata", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -47,25 +46,28 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "204", - "x-ms-request-id" : "8071d4fb-4003-00b9-2603-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:03 GMT" + "x-ms-request-id" : "86d0ab22-d003-0034-2588-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:13 GMT" } }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue9583269e", + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetandclearmetadata069712b1b824a4f5a?comp=metadata", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "x-ms-meta-metadata" : "value", "retry-after" : "0", "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071d50b-4003-00b9-3503-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:03 GMT" + "x-ms-approximate-messages-count" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0ab36-d003-0034-3988-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:13 GMT" } } ], - "variables" : [ "queue9583269e" ] + "variables" : [ "queueapitestssetandclearmetadata069712b1b824a4f5a" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetAndClearMetadata1.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetAndClearMetadata1.json new file mode 100644 index 000000000000..0a9eb98b06e5 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetAndClearMetadata1.json @@ -0,0 +1,74 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetandclearmetadata1133922d063e915d5", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0ab5e-d003-0034-5f88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:14 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetandclearmetadata1133922d063e915d5?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "Content-Length" : "0", + "x-ms-approximate-messages-count" : "0", + "x-ms-meta-metadata1" : "value", + "StatusCode" : "200", + "x-ms-request-id" : "86d0ab66-d003-0034-6688-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:14 GMT" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetandclearmetadata1133922d063e915d5?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "86d0ab6d-d003-0034-6d88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:14 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetandclearmetadata1133922d063e915d5?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "x-ms-meta-metadata" : "value", + "retry-after" : "0", + "Content-Length" : "0", + "x-ms-approximate-messages-count" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0ab74-d003-0034-7488-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:14 GMT" + } + } ], + "variables" : [ "queueapitestssetandclearmetadata1133922d063e915d5" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/createTwiceSameMetadata.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetAndClearMetadata2.json similarity index 58% rename from sdk/storage/azure-storage-queue/src/test/resources/session-records/createTwiceSameMetadata.json rename to sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetAndClearMetadata2.json index 49af0912970a..7eb7f876733b 100644 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/createTwiceSameMetadata.json +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetAndClearMetadata2.json @@ -1,10 +1,10 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue8880966a", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetandclearmetadata2975245e5d3767672", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -12,31 +12,34 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "201", - "x-ms-request-id" : "8072446f-4003-00b9-1303-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:36 GMT" + "x-ms-request-id" : "86d0ab8b-d003-0034-0a88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:14 GMT" } }, { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue8880966a", + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetandclearmetadata2975245e5d3767672?comp=metadata", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", "retry-after" : "0", "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "80724495-4003-00b9-3803-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:36 GMT" + "x-ms-approximate-messages-count" : "0", + "x-ms-meta-metadata1" : "value", + "StatusCode" : "200", + "x-ms-request-id" : "86d0ab97-d003-0034-1588-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:14 GMT" } }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue8880966a/messages", + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetandclearmetadata2975245e5d3767672?comp=metadata", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -44,25 +47,27 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "204", - "x-ms-request-id" : "807244ad-4003-00b9-5003-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:36 GMT" + "x-ms-request-id" : "86d0ab9f-d003-0034-1d88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:14 GMT" } }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue8880966a", + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetandclearmetadata2975245e5d3767672?comp=metadata", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", "retry-after" : "0", "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "807244ca-4003-00b9-6d03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT" + "x-ms-approximate-messages-count" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0aba3-d003-0034-2188-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:14 GMT" } } ], - "variables" : [ "queue8880966a" ] + "variables" : [ "queueapitestssetandclearmetadata2975245e5d3767672" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetAndClearMetadata3.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetAndClearMetadata3.json new file mode 100644 index 000000000000..1ccfd178abb2 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetAndClearMetadata3.json @@ -0,0 +1,74 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetandclearmetadata3109857c8883f83ac", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0abc0-d003-0034-3d88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:14 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetandclearmetadata3109857c8883f83ac?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "x-ms-meta-metadata" : "value", + "retry-after" : "0", + "Content-Length" : "0", + "x-ms-approximate-messages-count" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0abc8-d003-0034-4488-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:14 GMT" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetandclearmetadata3109857c8883f83ac?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "86d0abcb-d003-0034-4788-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:14 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetandclearmetadata3109857c8883f83ac?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "x-ms-meta-metadata" : "value", + "retry-after" : "0", + "Content-Length" : "0", + "x-ms-approximate-messages-count" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0abdb-d003-0034-5588-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:14 GMT" + } + } ], + "variables" : [ "queueapitestssetandclearmetadata3109857c8883f83ac" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/createWithMetadata.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetAndClearMetadata4.json similarity index 62% rename from sdk/storage/azure-storage-queue/src/test/resources/session-records/createWithMetadata.json rename to sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetAndClearMetadata4.json index de90dd17f28c..41a4e1aaeb97 100644 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/createWithMetadata.json +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetAndClearMetadata4.json @@ -1,10 +1,10 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue23765c5d", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetandclearmetadata4441364d33a3358d9", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -12,15 +12,15 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "201", - "x-ms-request-id" : "8071dcea-4003-00b9-4003-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:06 GMT" + "x-ms-request-id" : "86d0abf5-d003-0034-6d88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:15 GMT" } }, { "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue23765c5d?comp=metadata", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetandclearmetadata4441364d33a3358d9?comp=metadata", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -29,18 +29,16 @@ "retry-after" : "0", "Content-Length" : "0", "x-ms-approximate-messages-count" : "0", - "x-ms-meta-metadata1" : "value1", "StatusCode" : "200", - "x-ms-request-id" : "8071dd11-4003-00b9-6603-47d378000000", - "x-ms-meta-metadata2" : "value2", - "Date" : "Tue, 30 Jul 2019 18:19:06 GMT" + "x-ms-request-id" : "86d0abf9-d003-0034-7088-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:15 GMT" } }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue23765c5d/messages", + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetandclearmetadata4441364d33a3358d9?comp=metadata", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -48,25 +46,27 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "204", - "x-ms-request-id" : "8071dd3b-4003-00b9-0f03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:06 GMT" + "x-ms-request-id" : "86d0ac00-d003-0034-7788-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:15 GMT" } }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue23765c5d", + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetandclearmetadata4441364d33a3358d9?comp=metadata", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", "retry-after" : "0", "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071dd54-4003-00b9-2703-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:06 GMT" + "x-ms-approximate-messages-count" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0ac04-d003-0034-7b88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:15 GMT" } } ], - "variables" : [ "queue23765c5d" ] + "variables" : [ "queueapitestssetandclearmetadata4441364d33a3358d9" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetInvalidAccessPolicy.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetInvalidAccessPolicy.json new file mode 100644 index 000000000000..69072b76cfb7 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetInvalidAccessPolicy.json @@ -0,0 +1,40 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetinvalidaccesspolicy272461d7c8ddd05", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0adb1-d003-0034-7588-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:18 GMT" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetinvalidaccesspolicy272461d7c8ddd05?comp=acl", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidXmlDocument", + "retry-after" : "0", + "Content-Length" : "371", + "StatusCode" : "400", + "x-ms-request-id" : "86d0adb5-d003-0034-7888-539fde000000", + "Body" : "InvalidXmlDocumentXML specified is not syntactically valid.\nRequestId:86d0adb5-d003-0034-7888-539fde000000\nTime:2019-08-15T16:40:19.3749389Z1304Signed identifier ID cannot be empty or over 64 characters in length", + "Date" : "Thu, 15 Aug 2019 16:40:18 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestssetinvalidaccesspolicy272461d7c8ddd05" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetInvalidMeta0.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetInvalidMeta0.json new file mode 100644 index 000000000000..d67771bd47f4 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetInvalidMeta0.json @@ -0,0 +1,38 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetinvalidmeta086912efa51a8ecf394", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0ac2d-d003-0034-2288-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:15 GMT" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetinvalidmeta086912efa51a8ecf394?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Server" : "Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "AuthenticationFailed", + "retry-after" : "0", + "Content-Length" : "787", + "StatusCode" : "403", + "x-ms-request-id" : "86d0ac31-d003-0034-2588-539fde000000", + "Body" : "AuthenticationFailedServer failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.\nRequestId:86d0ac31-d003-0034-2588-539fde000000\nTime:2019-08-15T16:40:15.9366308ZThe MAC signature found in the HTTP request 'eFSCtqZMmfvr497wo8VI4QmqpGPc177ZljiKa2e1R9U=' is not the same as any computed signature. Server used following string to sign: 'PUT\n\n\n\n\n\nThu, 15 Aug 2019 16:40:15 GMT\n\n\n\n\n\nx-ms-client-request-id:0fc39ac3-c8b7-4559-9dc7-d7626792fc6c\nx-ms-meta-invalidmeta:value\nx-ms-version:2018-03-28\n/azstoragesdkaccount/queueapitestssetinvalidmeta086912efa51a8ecf394\ncomp:metadata'.", + "Date" : "Thu, 15 Aug 2019 16:40:15 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestssetinvalidmeta086912efa51a8ecf394" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetInvalidMeta1.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetInvalidMeta1.json new file mode 100644 index 000000000000..9bc7be9b6093 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetInvalidMeta1.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetinvalidmeta113448acbafb9121ae4", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0ac44-d003-0034-3888-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:15 GMT" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetinvalidmeta113448acbafb9121ae4?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidMetadata", + "retry-after" : "0", + "Content-Length" : "260", + "StatusCode" : "400", + "x-ms-request-id" : "86d0ac47-d003-0034-3a88-539fde000000", + "Body" : "InvalidMetadataThe metadata specified is invalid. It has characters that are not permitted.\nRequestId:86d0ac47-d003-0034-3a88-539fde000000\nTime:2019-08-15T16:40:16.1618482Z", + "Date" : "Thu, 15 Aug 2019 16:40:15 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestssetinvalidmeta113448acbafb9121ae4" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetInvalidMeta2.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetInvalidMeta2.json new file mode 100644 index 000000000000..f382dd8feb4a --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetInvalidMeta2.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetinvalidmeta2080827789296bb3fb4", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0ac5d-d003-0034-4d88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:15 GMT" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetinvalidmeta2080827789296bb3fb4?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidMetadata", + "retry-after" : "0", + "Content-Length" : "260", + "StatusCode" : "400", + "x-ms-request-id" : "86d0ac62-d003-0034-5188-539fde000000", + "Body" : "InvalidMetadataThe metadata specified is invalid. It has characters that are not permitted.\nRequestId:86d0ac62-d003-0034-5188-539fde000000\nTime:2019-08-15T16:40:16.3650438Z", + "Date" : "Thu, 15 Aug 2019 16:40:15 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestssetinvalidmeta2080827789296bb3fb4" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetInvalidMeta3.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetInvalidMeta3.json new file mode 100644 index 000000000000..e9408913c72f --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetInvalidMeta3.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetinvalidmeta34802248c56de5d4824", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0ac7c-d003-0034-6688-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:16 GMT" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetinvalidmeta34802248c56de5d4824?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "EmptyMetadataKey", + "retry-after" : "0", + "Content-Length" : "278", + "StatusCode" : "400", + "x-ms-request-id" : "86d0ac84-d003-0034-6d88-539fde000000", + "Body" : "EmptyMetadataKeyThe key for one of the metadata key-value pairs is empty.\nRequestId:86d0ac84-d003-0034-6d88-539fde000000\nTime:2019-08-15T16:40:16.5552281Zvalue", + "Date" : "Thu, 15 Aug 2019 16:40:16 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestssetinvalidmeta34802248c56de5d4824" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetMetadataQueueError.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetMetadataQueueError.json new file mode 100644 index 000000000000..2db96a476326 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetMetadataQueueError.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetmetadataqueueerror215410bb255310f?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "QueueNotFound", + "retry-after" : "0", + "Content-Length" : "217", + "StatusCode" : "404", + "x-ms-request-id" : "86d0ac1d-d003-0034-1488-539fde000000", + "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:86d0ac1d-d003-0034-1488-539fde000000\nTime:2019-08-15T16:40:15.7774776Z", + "Date" : "Thu, 15 Aug 2019 16:40:15 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestssetmetadataqueueerror215410bb255310f" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetMultipleAccessPolicies.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetMultipleAccessPolicies.json new file mode 100644 index 000000000000..a9505d0667f9 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetMultipleAccessPolicies.json @@ -0,0 +1,56 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetmultipleaccesspolicies16522a4462e10", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0adcb-d003-0034-0c88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:19 GMT" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetmultipleaccesspolicies16522a4462e10?comp=acl", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "86d0ade0-d003-0034-1f88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:19 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssetmultipleaccesspolicies16522a4462e10?comp=acl", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0adfb-d003-0034-3788-539fde000000", + "Body" : "policy02000-01-01T00:00:00.0000000Z2020-01-01T00:00:00.0000000Zrpolicy12000-01-01T00:00:00.0000000Z2020-01-01T00:00:00.0000000Zrpolicy22000-01-01T00:00:00.0000000Z2020-01-01T00:00:00.0000000Zr", + "Date" : "Thu, 15 Aug 2019 16:40:19 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestssetmultipleaccesspolicies16522a4462e10" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/setAccessPolicyQueueDoesNotExist.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetTooManyAccessPolicies.json similarity index 55% rename from sdk/storage/azure-storage-queue/src/test/resources/session-records/setAccessPolicyQueueDoesNotExist.json rename to sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetTooManyAccessPolicies.json index 831f07e70edb..751949a2a5e5 100644 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/setAccessPolicyQueueDoesNotExist.json +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsSetTooManyAccessPolicies.json @@ -1,43 +1,40 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue15204045?comp=acl", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssettoomanyaccesspolicies3701347c5c1a20", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "InvalidXmlDocument", "retry-after" : "0", - "Content-Length" : "294", - "StatusCode" : "400", - "x-ms-request-id" : "80724e15-4003-00b9-6d03-47d378000000", - "Body" : "InvalidXmlDocumentXML specified is not syntactically valid.\nRequestId:80724e15-4003-00b9-6d03-47d378000000\nTime:2019-07-30T18:19:39.7961551Z00", - "Date" : "Tue, 30 Jul 2019 18:19:39 GMT", - "Content-Type" : "application/xml" + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0ae24-d003-0034-5688-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:19 GMT" } }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue15204045/messages", + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestssettoomanyaccesspolicies3701347c5c1a20?comp=acl", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" }, "Response" : { "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", + "x-ms-error-code" : "InvalidXmlDocument", "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "80724e34-4003-00b9-0b03-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:80724e34-4003-00b9-0b03-47d378000000\nTime:2019-07-30T18:19:39.8241820Z", - "Date" : "Tue, 30 Jul 2019 18:19:39 GMT", + "Content-Length" : "294", + "StatusCode" : "400", + "x-ms-request-id" : "86d0ae2b-d003-0034-5c88-539fde000000", + "Body" : "InvalidXmlDocumentXML specified is not syntactically valid.\nRequestId:86d0ae2b-d003-0034-5c88-539fde000000\nTime:2019-08-15T16:40:20.2267603Z00", + "Date" : "Thu, 15 Aug 2019 16:40:19 GMT", "Content-Type" : "application/xml" } } ], - "variables" : [ "queue15204045" ] + "variables" : [ "queueapitestssettoomanyaccesspolicies3701347c5c1a20" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsUpdateMessage.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsUpdateMessage.json new file mode 100644 index 000000000000..dd811d7af558 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsUpdateMessage.json @@ -0,0 +1,96 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsupdatemessage06951bc591bb0333646", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b172-d003-0034-3288-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:26 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsupdatemessage06951bc591bb0333646/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b179-d003-0034-3688-539fde000000", + "Body" : "866fcfcf-4cf2-4300-8845-9ac23c9412fdThu, 15 Aug 2019 16:40:27 GMTThu, 22 Aug 2019 16:40:27 GMTAgAAAAMAAAAAAAAAeLaeJIhT1QE=Thu, 15 Aug 2019 16:40:27 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:26 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsupdatemessage06951bc591bb0333646/messages?numofmessages=1&visibilitytimeout=30", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b17f-d003-0034-3c88-539fde000000", + "Body" : "866fcfcf-4cf2-4300-8845-9ac23c9412fdThu, 15 Aug 2019 16:40:27 GMTThu, 22 Aug 2019 16:40:27 GMTAgAAAAMAAAAAAAAA3RGHNohT1QE=Thu, 15 Aug 2019 16:40:57 GMT1test message before update", + "Date" : "Thu, 15 Aug 2019 16:40:26 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsupdatemessage06951bc591bb0333646/messages/866fcfcf-4cf2-4300-8845-9ac23c9412fd?popreceipt=AgAAAAMAAAAAAAAA3RGHNohT1QE%3d&visibilitytimeout=1", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-time-next-visible" : "Thu, 15 Aug 2019 16:40:28 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "86d0b187-d003-0034-4388-539fde000000", + "x-ms-popreceipt" : "AwAAAAMAAAAAAAAAXrZIJYhT1QEBAAAA", + "Date" : "Thu, 15 Aug 2019 16:40:26 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsupdatemessage06951bc591bb0333646/messages?peekonly=true", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b24c-d003-0034-7988-539fde000000", + "Body" : "866fcfcf-4cf2-4300-8845-9ac23c9412fdThu, 15 Aug 2019 16:40:27 GMTThu, 22 Aug 2019 16:40:27 GMT1Updated test message", + "Date" : "Thu, 15 Aug 2019 16:40:28 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestsupdatemessage06951bc591bb0333646" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsUpdateMessageInvalidArgs0.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsUpdateMessageInvalidArgs0.json new file mode 100644 index 000000000000..c2bb5757978c --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsUpdateMessageInvalidArgs0.json @@ -0,0 +1,78 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsupdatemessageinvalidargs045293d7291d09", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b262-d003-0034-0b88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:29 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsupdatemessageinvalidargs045293d7291d09/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b268-d003-0034-1088-539fde000000", + "Body" : "3d7de84c-5922-4d48-82f5-9553b755e13bThu, 15 Aug 2019 16:40:29 GMTThu, 22 Aug 2019 16:40:29 GMTAgAAAAMAAAAAAAAATQkOJohT1QE=Thu, 15 Aug 2019 16:40:29 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:29 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsupdatemessageinvalidargs045293d7291d09/messages?numofmessages=1&visibilitytimeout=30", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b26f-d003-0034-1688-539fde000000", + "Body" : "3d7de84c-5922-4d48-82f5-9553b755e13bThu, 15 Aug 2019 16:40:29 GMTThu, 22 Aug 2019 16:40:29 GMTAgAAAAMAAAAAAAAAp3L5N4hT1QE=Thu, 15 Aug 2019 16:40:59 GMT1test message before update", + "Date" : "Thu, 15 Aug 2019 16:40:29 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsupdatemessageinvalidargs045293d7291d09/messages/3d7de84c-5922-4d48-82f5-9553b755e13b?popreceipt=AgAAAAMAAAAAAAAAp3L5N4hT1QE%3dRandom&visibilitytimeout=1", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidQueryParameterValue", + "retry-after" : "0", + "Content-Length" : "444", + "StatusCode" : "400", + "x-ms-request-id" : "86d0b279-d003-0034-2088-539fde000000", + "Body" : "InvalidQueryParameterValueValue for one of the query parameters specified in the request URI is invalid.\nRequestId:86d0b279-d003-0034-2088-539fde000000\nTime:2019-08-15T16:40:29.7699461ZpopreceiptAgAAAAMAAAAAAAAAp3L5N4hT1QE=RandomInvalid pop receipt format", + "Date" : "Thu, 15 Aug 2019 16:40:29 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestsupdatemessageinvalidargs045293d7291d09" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsUpdateMessageInvalidArgs1.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsUpdateMessageInvalidArgs1.json new file mode 100644 index 000000000000..0913d3eafa66 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsUpdateMessageInvalidArgs1.json @@ -0,0 +1,78 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsupdatemessageinvalidargs176891560f8faf", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b28d-d003-0034-3488-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:29 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsupdatemessageinvalidargs176891560f8faf/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b292-d003-0034-3888-539fde000000", + "Body" : "6580708f-66e8-44e6-ba98-b8247beac271Thu, 15 Aug 2019 16:40:29 GMTThu, 22 Aug 2019 16:40:29 GMTAgAAAAMAAAAAAAAAh2xCJohT1QE=Thu, 15 Aug 2019 16:40:29 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:29 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsupdatemessageinvalidargs176891560f8faf/messages?numofmessages=1&visibilitytimeout=30", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b297-d003-0034-3d88-539fde000000", + "Body" : "6580708f-66e8-44e6-ba98-b8247beac271Thu, 15 Aug 2019 16:40:29 GMTThu, 22 Aug 2019 16:40:29 GMTAgAAAAMAAAAAAAAAfCsqOIhT1QE=Thu, 15 Aug 2019 16:41:00 GMT1test message before update", + "Date" : "Thu, 15 Aug 2019 16:40:29 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsupdatemessageinvalidargs176891560f8faf/messages/6580708f-66e8-44e6-ba98-b8247beac271Random?popreceipt=AgAAAAMAAAAAAAAAfCsqOIhT1QE%3d&visibilitytimeout=1", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "MessageNotFound", + "retry-after" : "0", + "Content-Length" : "221", + "StatusCode" : "404", + "x-ms-request-id" : "86d0b299-d003-0034-3f88-539fde000000", + "Body" : "MessageNotFoundThe specified message does not exist.\nRequestId:86d0b299-d003-0034-3f88-539fde000000\nTime:2019-08-15T16:40:30.0582240Z", + "Date" : "Thu, 15 Aug 2019 16:40:29 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestsupdatemessageinvalidargs176891560f8faf" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsUpdateMessageInvalidArgs2.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsUpdateMessageInvalidArgs2.json new file mode 100644 index 000000000000..3cff8e232573 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAPITestsUpdateMessageInvalidArgs2.json @@ -0,0 +1,78 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsupdatemessageinvalidargs273318b807b04f", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b2a7-d003-0034-4d88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:29 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsupdatemessageinvalidargs273318b807b04f/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b2ad-d003-0034-5288-539fde000000", + "Body" : "3be89eec-a4f2-45ab-a197-b821b7d11f10Thu, 15 Aug 2019 16:40:30 GMTThu, 22 Aug 2019 16:40:30 GMTAgAAAAMAAAAAAAAAcZtoJohT1QE=Thu, 15 Aug 2019 16:40:30 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:29 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsupdatemessageinvalidargs273318b807b04f/messages?numofmessages=1&visibilitytimeout=30", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b2af-d003-0034-5488-539fde000000", + "Body" : "3be89eec-a4f2-45ab-a197-b821b7d11f10Thu, 15 Aug 2019 16:40:30 GMTThu, 22 Aug 2019 16:40:30 GMTAgAAAAMAAAAAAAAARQxQOIhT1QE=Thu, 15 Aug 2019 16:41:00 GMT1test message before update", + "Date" : "Thu, 15 Aug 2019 16:40:29 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueapitestsupdatemessageinvalidargs273318b807b04f/messages/3be89eec-a4f2-45ab-a197-b821b7d11f10Random?popreceipt=AgAAAAMAAAAAAAAARQxQOIhT1QE%3dRandom&visibilitytimeout=1", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidQueryParameterValue", + "retry-after" : "0", + "Content-Length" : "444", + "StatusCode" : "400", + "x-ms-request-id" : "86d0b2b6-d003-0034-5b88-539fde000000", + "Body" : "InvalidQueryParameterValueValue for one of the query parameters specified in the request URI is invalid.\nRequestId:86d0b2b6-d003-0034-5b88-539fde000000\nTime:2019-08-15T16:40:30.3204768ZpopreceiptAgAAAAMAAAAAAAAARQxQOIhT1QE=RandomInvalid pop receipt format", + "Date" : "Thu, 15 Aug 2019 16:40:29 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueapitestsupdatemessageinvalidargs273318b807b04f" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsClearMessages.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsClearMessages.json new file mode 100644 index 000000000000..a711e3c38c58 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsClearMessages.json @@ -0,0 +1,129 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsclearmessages2567745c37cf84523", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b714-d003-0034-3f88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:37 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsclearmessages2567745c37cf84523/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b71a-d003-0034-4488-539fde000000", + "Body" : "a61f6509-9183-4eb9-ac29-1059bef85949Thu, 15 Aug 2019 16:40:37 GMTThu, 22 Aug 2019 16:40:37 GMTAgAAAAMAAAAAAAAAEb3/KohT1QE=Thu, 15 Aug 2019 16:40:37 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:37 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsclearmessages2567745c37cf84523/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b72e-d003-0034-5688-539fde000000", + "Body" : "4a640ede-fbc9-4097-b825-3a0ec2ae05b0Thu, 15 Aug 2019 16:40:38 GMTThu, 22 Aug 2019 16:40:38 GMTAgAAAAMAAAAAAAAAHLEQK4hT1QE=Thu, 15 Aug 2019 16:40:38 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:37 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsclearmessages2567745c37cf84523/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b733-d003-0034-5a88-539fde000000", + "Body" : "5edab073-8f3c-4a0e-8f78-6cfe7c4b5909Thu, 15 Aug 2019 16:40:38 GMTThu, 22 Aug 2019 16:40:38 GMTAgAAAAMAAAAAAAAA+6UWK4hT1QE=Thu, 15 Aug 2019 16:40:38 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:37 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsclearmessages2567745c37cf84523?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "Content-Length" : "0", + "x-ms-approximate-messages-count" : "3", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b73a-d003-0034-6188-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:37 GMT" + } + }, { + "Method" : "DELETE", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsclearmessages2567745c37cf84523/messages", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "86d0b73f-d003-0034-6688-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:37 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsclearmessages2567745c37cf84523?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "Content-Length" : "0", + "x-ms-approximate-messages-count" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b74b-d003-0034-7188-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:37 GMT" + } + } ], + "variables" : [ "queueaysncapitestsclearmessages2567745c37cf84523" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsClearMessagesError.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsClearMessagesError.json new file mode 100644 index 000000000000..5d910550c22a --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsClearMessagesError.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "DELETE", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsclearmessageserror568252add7763d/messages", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "QueueNotFound", + "retry-after" : "0", + "Content-Length" : "217", + "StatusCode" : "404", + "x-ms-request-id" : "86d0b769-d003-0034-0c88-539fde000000", + "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:86d0b769-d003-0034-0c88-539fde000000\nTime:2019-08-15T16:40:38.4563063Z", + "Date" : "Thu, 15 Aug 2019 16:40:37 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestsclearmessageserror568252add7763d" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsCreateQueueWithSharedKey.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsCreateQueueWithSharedKey.json new file mode 100644 index 000000000000..c0b23667f8c5 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsCreateQueueWithSharedKey.json @@ -0,0 +1,20 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestscreatequeuewithsharedkey2100736fe3e", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b2d8-d003-0034-7c88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:30 GMT" + } + } ], + "variables" : [ "queueaysncapitestscreatequeuewithsharedkey2100736fe3e" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDeleteExistQueue.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDeleteExistQueue.json new file mode 100644 index 000000000000..a20509a553ac --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDeleteExistQueue.json @@ -0,0 +1,36 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeleteexistqueue35019918c3a4f50", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b2e9-d003-0034-0c88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:30 GMT" + } + }, { + "Method" : "DELETE", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeleteexistqueue35019918c3a4f50", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "86d0b2f1-d003-0034-1388-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:30 GMT" + } + } ], + "variables" : [ "queueaysncapitestsdeleteexistqueue35019918c3a4f50" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDeleteMessage.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDeleteMessage.json new file mode 100644 index 000000000000..78fe32bbd659 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDeleteMessage.json @@ -0,0 +1,148 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeletemessage4169294d235e7b53e", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b780-d003-0034-1e88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:38 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeletemessage4169294d235e7b53e/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b789-d003-0034-2588-539fde000000", + "Body" : "2bae208e-e182-4f46-99d3-802e85696bb7Thu, 15 Aug 2019 16:40:38 GMTThu, 22 Aug 2019 16:40:38 GMTAgAAAAMAAAAAAAAAxopkK4hT1QE=Thu, 15 Aug 2019 16:40:38 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:38 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeletemessage4169294d235e7b53e/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b7bd-d003-0034-5288-539fde000000", + "Body" : "5ef9d501-16ee-46fa-948e-92efe33db2bbThu, 15 Aug 2019 16:40:38 GMTThu, 22 Aug 2019 16:40:38 GMTAgAAAAMAAAAAAAAA+jyOK4hT1QE=Thu, 15 Aug 2019 16:40:38 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:38 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeletemessage4169294d235e7b53e/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b7c3-d003-0034-5888-539fde000000", + "Body" : "66929325-4169-46f6-9896-13ec28a9ab4fThu, 15 Aug 2019 16:40:38 GMTThu, 22 Aug 2019 16:40:38 GMTAgAAAAMAAAAAAAAAKyCTK4hT1QE=Thu, 15 Aug 2019 16:40:38 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:38 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeletemessage4169294d235e7b53e/messages?numofmessages=1&visibilitytimeout=30", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b7cd-d003-0034-6088-539fde000000", + "Body" : "2bae208e-e182-4f46-99d3-802e85696bb7Thu, 15 Aug 2019 16:40:38 GMTThu, 22 Aug 2019 16:40:38 GMTAgAAAAMAAAAAAAAA3nd9PYhT1QE=Thu, 15 Aug 2019 16:41:08 GMT1test message 1", + "Date" : "Thu, 15 Aug 2019 16:40:38 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeletemessage4169294d235e7b53e?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "Content-Length" : "0", + "x-ms-approximate-messages-count" : "3", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b7d7-d003-0034-6a88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:38 GMT" + } + }, { + "Method" : "DELETE", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeletemessage4169294d235e7b53e/messages/2bae208e-e182-4f46-99d3-802e85696bb7?popreceipt=AgAAAAMAAAAAAAAA3nd9PYhT1QE%3d", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "86d0b7dd-d003-0034-7088-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:38 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeletemessage4169294d235e7b53e?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "Content-Length" : "0", + "x-ms-approximate-messages-count" : "2", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b7e6-d003-0034-7888-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:38 GMT" + } + } ], + "variables" : [ "queueaysncapitestsdeletemessage4169294d235e7b53e" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDeleteMessageInvalidArgs0.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDeleteMessageInvalidArgs0.json new file mode 100644 index 000000000000..c5bee287ae31 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDeleteMessageInvalidArgs0.json @@ -0,0 +1,77 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeletemessageinvalidargs08956721757c", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b811-d003-0034-2188-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:38 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeletemessageinvalidargs08956721757c/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b81a-d003-0034-2888-539fde000000", + "Body" : "cc32b131-2313-4b2f-ad90-3c488f10aa7eThu, 15 Aug 2019 16:40:39 GMTThu, 22 Aug 2019 16:40:39 GMTAgAAAAMAAAAAAAAAM23TK4hT1QE=Thu, 15 Aug 2019 16:40:39 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:38 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeletemessageinvalidargs08956721757c/messages?numofmessages=1&visibilitytimeout=30", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b822-d003-0034-2f88-539fde000000", + "Body" : "cc32b131-2313-4b2f-ad90-3c488f10aa7eThu, 15 Aug 2019 16:40:39 GMTThu, 22 Aug 2019 16:40:39 GMTAgAAAAMAAAAAAAAAGQW7PYhT1QE=Thu, 15 Aug 2019 16:41:09 GMT1test message", + "Date" : "Thu, 15 Aug 2019 16:40:38 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "DELETE", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeletemessageinvalidargs08956721757c/messages/cc32b131-2313-4b2f-ad90-3c488f10aa7e?popreceipt=AgAAAAMAAAAAAAAAGQW7PYhT1QE%3dRandom", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidQueryParameterValue", + "retry-after" : "0", + "Content-Length" : "444", + "StatusCode" : "400", + "x-ms-request-id" : "86d0b832-d003-0034-3d88-539fde000000", + "Body" : "InvalidQueryParameterValueValue for one of the query parameters specified in the request URI is invalid.\nRequestId:86d0b832-d003-0034-3d88-539fde000000\nTime:2019-08-15T16:40:39.4532674ZpopreceiptAgAAAAMAAAAAAAAAGQW7PYhT1QE=RandomInvalid pop receipt format", + "Date" : "Thu, 15 Aug 2019 16:40:38 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestsdeletemessageinvalidargs08956721757c" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDeleteMessageInvalidArgs1.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDeleteMessageInvalidArgs1.json new file mode 100644 index 000000000000..a08c635e6dd8 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDeleteMessageInvalidArgs1.json @@ -0,0 +1,77 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeletemessageinvalidargs139342f37ce7", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b851-d003-0034-5888-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:39 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeletemessageinvalidargs139342f37ce7/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b855-d003-0034-5b88-539fde000000", + "Body" : "cce066f1-dccd-40ef-9cdf-49ee0abf187fThu, 15 Aug 2019 16:40:39 GMTThu, 22 Aug 2019 16:40:39 GMTAgAAAAMAAAAAAAAAKjH+K4hT1QE=Thu, 15 Aug 2019 16:40:39 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:39 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeletemessageinvalidargs139342f37ce7/messages?numofmessages=1&visibilitytimeout=30", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b880-d003-0034-0588-539fde000000", + "Body" : "cce066f1-dccd-40ef-9cdf-49ee0abf187fThu, 15 Aug 2019 16:40:39 GMTThu, 22 Aug 2019 16:40:39 GMTAgAAAAMAAAAAAAAAtYILPohT1QE=Thu, 15 Aug 2019 16:41:09 GMT1test message", + "Date" : "Thu, 15 Aug 2019 16:40:39 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "DELETE", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeletemessageinvalidargs139342f37ce7/messages/cce066f1-dccd-40ef-9cdf-49ee0abf187fRandom?popreceipt=AgAAAAMAAAAAAAAAtYILPohT1QE%3d", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "MessageNotFound", + "retry-after" : "0", + "Content-Length" : "221", + "StatusCode" : "404", + "x-ms-request-id" : "86d0b896-d003-0034-1988-539fde000000", + "Body" : "MessageNotFoundThe specified message does not exist.\nRequestId:86d0b896-d003-0034-1988-539fde000000\nTime:2019-08-15T16:40:39.9947896Z", + "Date" : "Thu, 15 Aug 2019 16:40:39 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestsdeletemessageinvalidargs139342f37ce7" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDeleteMessageInvalidArgs2.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDeleteMessageInvalidArgs2.json new file mode 100644 index 000000000000..e9745e23d903 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDeleteMessageInvalidArgs2.json @@ -0,0 +1,77 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeletemessageinvalidargs2341209dfb46", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b8ac-d003-0034-2e88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:39 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeletemessageinvalidargs2341209dfb46/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b8b6-d003-0034-3488-539fde000000", + "Body" : "7e87aa91-446d-4d94-b215-499b6b6eb968Thu, 15 Aug 2019 16:40:40 GMTThu, 22 Aug 2019 16:40:40 GMTAgAAAAMAAAAAAAAAKuBTLIhT1QE=Thu, 15 Aug 2019 16:40:40 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:39 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeletemessageinvalidargs2341209dfb46/messages?numofmessages=1&visibilitytimeout=30", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b8ca-d003-0034-4288-539fde000000", + "Body" : "7e87aa91-446d-4d94-b215-499b6b6eb968Thu, 15 Aug 2019 16:40:40 GMTThu, 22 Aug 2019 16:40:40 GMTAgAAAAMAAAAAAAAAu6VCPohT1QE=Thu, 15 Aug 2019 16:41:10 GMT1test message", + "Date" : "Thu, 15 Aug 2019 16:40:39 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "DELETE", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeletemessageinvalidargs2341209dfb46/messages/7e87aa91-446d-4d94-b215-499b6b6eb968Random?popreceipt=AgAAAAMAAAAAAAAAu6VCPohT1QE%3dRandom", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidQueryParameterValue", + "retry-after" : "0", + "Content-Length" : "444", + "StatusCode" : "400", + "x-ms-request-id" : "86d0b8e8-d003-0034-5e88-539fde000000", + "Body" : "InvalidQueryParameterValueValue for one of the query parameters specified in the request URI is invalid.\nRequestId:86d0b8e8-d003-0034-5e88-539fde000000\nTime:2019-08-15T16:40:40.4482269ZpopreceiptAgAAAAMAAAAAAAAAu6VCPohT1QE=RandomInvalid pop receipt format", + "Date" : "Thu, 15 Aug 2019 16:40:39 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestsdeletemessageinvalidargs2341209dfb46" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDeleteQueueError.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDeleteQueueError.json new file mode 100644 index 000000000000..28150a0ec5eb --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDeleteQueueError.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "DELETE", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdeletequeueerror841810489e711bf", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "QueueNotFound", + "retry-after" : "0", + "Content-Length" : "217", + "StatusCode" : "404", + "x-ms-request-id" : "86d0b2f9-d003-0034-1b88-539fde000000", + "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:86d0b2f9-d003-0034-1b88-539fde000000\nTime:2019-08-15T16:40:30.9681013Z", + "Date" : "Thu, 15 Aug 2019 16:40:30 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestsdeletequeueerror841810489e711bf" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDequeueMessage.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDequeueMessage.json new file mode 100644 index 000000000000..3c3216aab4fe --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDequeueMessage.json @@ -0,0 +1,58 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdequeuemessage34127c045be0e4fc", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b571-d003-0034-4c88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:35 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdequeuemessage34127c045be0e4fc/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b576-d003-0034-5088-539fde000000", + "Body" : "13b53b78-978f-45ea-b9f3-ff7dde5fbfc6Thu, 15 Aug 2019 16:40:35 GMTThu, 22 Aug 2019 16:40:35 GMTAgAAAAMAAAAAAAAAjVPRKYhT1QE=Thu, 15 Aug 2019 16:40:35 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:35 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdequeuemessage34127c045be0e4fc/messages?numofmessages=1&visibilitytimeout=30", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b588-d003-0034-5e88-539fde000000", + "Body" : "13b53b78-978f-45ea-b9f3-ff7dde5fbfc6Thu, 15 Aug 2019 16:40:35 GMTThu, 22 Aug 2019 16:40:35 GMTAgAAAAMAAAAAAAAAeUrFO4hT1QE=Thu, 15 Aug 2019 16:41:06 GMT1test message", + "Date" : "Thu, 15 Aug 2019 16:40:35 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestsdequeuemessage34127c045be0e4fc" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDequeueMultipleMessages.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDequeueMultipleMessages.json new file mode 100644 index 000000000000..ece1c39197f3 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDequeueMultipleMessages.json @@ -0,0 +1,77 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdequeuemultiplemessages92682dd8f696", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b59a-d003-0034-6e88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:35 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdequeuemultiplemessages92682dd8f696/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b5a1-d003-0034-7488-539fde000000", + "Body" : "f4f91806-40cc-44ce-b6d9-190aa231e712Thu, 15 Aug 2019 16:40:36 GMTThu, 22 Aug 2019 16:40:36 GMTAgAAAAMAAAAAAAAA5MH/KYhT1QE=Thu, 15 Aug 2019 16:40:36 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:35 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdequeuemultiplemessages92682dd8f696/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b5a6-d003-0034-7988-539fde000000", + "Body" : "d247edfb-148b-4ced-bba3-086e248b11cfThu, 15 Aug 2019 16:40:36 GMTThu, 22 Aug 2019 16:40:36 GMTAgAAAAMAAAAAAAAAO3oGKohT1QE=Thu, 15 Aug 2019 16:40:36 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:35 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdequeuemultiplemessages92682dd8f696/messages?numofmessages=2&visibilitytimeout=30", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b5b1-d003-0034-0388-539fde000000", + "Body" : "f4f91806-40cc-44ce-b6d9-190aa231e712Thu, 15 Aug 2019 16:40:36 GMTThu, 22 Aug 2019 16:40:36 GMTAgAAAAMAAAAAAAAAk9j3O4hT1QE=Thu, 15 Aug 2019 16:41:06 GMT1test message 1d247edfb-148b-4ced-bba3-086e248b11cfThu, 15 Aug 2019 16:40:36 GMTThu, 22 Aug 2019 16:40:36 GMTAgAAAAMAAAAAAAAAk9j3O4hT1QE=Thu, 15 Aug 2019 16:41:06 GMT1test message 2", + "Date" : "Thu, 15 Aug 2019 16:40:36 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestsdequeuemultiplemessages92682dd8f696" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDequeueTooManyMessage.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDequeueTooManyMessage.json new file mode 100644 index 000000000000..88673523a9ef --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsDequeueTooManyMessage.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdequeuetoomanymessage93456993efa0c", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b5f1-d003-0034-3e88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:36 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsdequeuetoomanymessage93456993efa0c/messages?numofmessages=33&visibilitytimeout=30", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "OutOfRangeQueryParameterValue", + "retry-after" : "0", + "Content-Length" : "456", + "StatusCode" : "400", + "x-ms-request-id" : "86d0b5ff-d003-0034-4b88-539fde000000", + "Body" : "OutOfRangeQueryParameterValueOne of the query parameters specified in the request URI is outside the permissible range.\nRequestId:86d0b5ff-d003-0034-4b88-539fde000000\nTime:2019-08-15T16:40:36.7857017Znumofmessages33132", + "Date" : "Thu, 15 Aug 2019 16:40:36 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestsdequeuetoomanymessage93456993efa0c" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsEnqueueEmptyMessage.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsEnqueueEmptyMessage.json new file mode 100644 index 000000000000..fc93aefae27a --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsEnqueueEmptyMessage.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsenqueueemptymessage777007b0c97652", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b544-d003-0034-2188-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:34 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsenqueueemptymessage777007b0c97652/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b54d-d003-0034-2988-539fde000000", + "Body" : "cf835a57-768b-4887-ad77-b58cfe5a49bdThu, 15 Aug 2019 16:40:35 GMTThu, 22 Aug 2019 16:40:35 GMTAgAAAAMAAAAAAAAAMZ+TKYhT1QE=Thu, 15 Aug 2019 16:40:35 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:35 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestsenqueueemptymessage777007b0c97652" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsEnqueueMessage.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsEnqueueMessage.json new file mode 100644 index 000000000000..e800017754bc --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsEnqueueMessage.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsenqueuemessage918982b8274b3853", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b51c-d003-0034-7c88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:34 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsenqueuemessage918982b8274b3853/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b526-d003-0034-0588-539fde000000", + "Body" : "331a480a-83cd-4c6d-bd42-64a1878d57f3Thu, 15 Aug 2019 16:40:35 GMTThu, 22 Aug 2019 16:40:35 GMTAgAAAAMAAAAAAAAAbbBqKYhT1QE=Thu, 15 Aug 2019 16:40:35 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:34 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestsenqueuemessage918982b8274b3853" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsEnqueueTimeToLive.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsEnqueueTimeToLive.json new file mode 100644 index 000000000000..e05acbb8dae2 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsEnqueueTimeToLive.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsenqueuetimetolive942001ea0bb1007", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b55d-d003-0034-3988-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:35 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsenqueuetimetolive942001ea0bb1007/messages?visibilitytimeout=0&messagettl=2", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b564-d003-0034-3f88-539fde000000", + "Body" : "4dfa6c0e-0faa-4f92-9327-4fc14c151027Thu, 15 Aug 2019 16:40:35 GMTThu, 15 Aug 2019 16:40:37 GMTAgAAAAMAAAAAAAAAKzm1KYhT1QE=Thu, 15 Aug 2019 16:40:35 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:35 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestsenqueuetimetolive942001ea0bb1007" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsGetAccessPolicy.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsGetAccessPolicy.json new file mode 100644 index 000000000000..3288923c2dd0 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsGetAccessPolicy.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsgetaccesspolicy13402477ddf897a6", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b45e-d003-0034-5388-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:33 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsgetaccesspolicy13402477ddf897a6?comp=acl", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b469-d003-0034-5b88-539fde000000", + "Body" : "", + "Date" : "Thu, 15 Aug 2019 16:40:33 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestsgetaccesspolicy13402477ddf897a6" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsGetAccessPolicyDoesError.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsGetAccessPolicyDoesError.json new file mode 100644 index 000000000000..af256fc76af8 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsGetAccessPolicyDoesError.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsgetaccesspolicydoeserror56212d23d22?comp=acl", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "QueueNotFound", + "retry-after" : "0", + "Content-Length" : "217", + "StatusCode" : "404", + "x-ms-request-id" : "86d0b489-d003-0034-7888-539fde000000", + "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:86d0b489-d003-0034-7888-539fde000000\nTime:2019-08-15T16:40:34.0060234Z", + "Date" : "Thu, 15 Aug 2019 16:40:33 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestsgetaccesspolicydoeserror56212d23d22" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsGetProperties.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsGetProperties.json new file mode 100644 index 000000000000..d9603b7d9e31 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsGetProperties.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsgetproperties7430531cdaa42d19a", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b303-d003-0034-2388-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:30 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsgetproperties7430531cdaa42d19a?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "x-ms-meta-metadata" : "value", + "retry-after" : "0", + "Content-Length" : "0", + "x-ms-approximate-messages-count" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b30e-d003-0034-2a88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:30 GMT" + } + } ], + "variables" : [ "queueaysncapitestsgetproperties7430531cdaa42d19a" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsGetPropertiesError.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsGetPropertiesError.json new file mode 100644 index 000000000000..457195c34d0f --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsGetPropertiesError.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsgetpropertieserror93872b7a1476bc?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "QueueNotFound", + "retry-after" : "0", + "Content-Length" : "217", + "StatusCode" : "404", + "x-ms-request-id" : "86d0b326-d003-0034-3c88-539fde000000", + "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:86d0b326-d003-0034-3c88-539fde000000\nTime:2019-08-15T16:40:31.3074281Z", + "Date" : "Thu, 15 Aug 2019 16:40:30 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestsgetpropertieserror93872b7a1476bc" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsPeekMessage.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsPeekMessage.json new file mode 100644 index 000000000000..25a3ea95b585 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsPeekMessage.json @@ -0,0 +1,58 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestspeekmessage47817372b7f2dd8224", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b643-d003-0034-0888-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:36 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestspeekmessage47817372b7f2dd8224/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b654-d003-0034-1488-539fde000000", + "Body" : "6dc6a926-5c00-44f4-8de2-e89c54c611daThu, 15 Aug 2019 16:40:37 GMTThu, 22 Aug 2019 16:40:37 GMTAgAAAAMAAAAAAAAA/u17KohT1QE=Thu, 15 Aug 2019 16:40:37 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:36 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestspeekmessage47817372b7f2dd8224/messages?peekonly=true", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b661-d003-0034-2088-539fde000000", + "Body" : "6dc6a926-5c00-44f4-8de2-e89c54c611daThu, 15 Aug 2019 16:40:37 GMTThu, 22 Aug 2019 16:40:37 GMT0test message", + "Date" : "Thu, 15 Aug 2019 16:40:36 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestspeekmessage47817372b7f2dd8224" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsPeekMessagesError.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsPeekMessagesError.json new file mode 100644 index 000000000000..7126fe327311 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsPeekMessagesError.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestspeekmessageserror93819ee1f00a5b7/messages?peekonly=true", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "QueueNotFound", + "retry-after" : "0", + "Content-Length" : "217", + "StatusCode" : "404", + "x-ms-request-id" : "86d0b707-d003-0034-3488-539fde000000", + "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:86d0b707-d003-0034-3488-539fde000000\nTime:2019-08-15T16:40:37.8036777Z", + "Date" : "Thu, 15 Aug 2019 16:40:37 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestspeekmessageserror93819ee1f00a5b7" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsPeekMultipleMessages.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsPeekMultipleMessages.json new file mode 100644 index 000000000000..a047b153bf5a --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsPeekMultipleMessages.json @@ -0,0 +1,77 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestspeekmultiplemessages0423782806747", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b67a-d003-0034-3988-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:36 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestspeekmultiplemessages0423782806747/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b687-d003-0034-4588-539fde000000", + "Body" : "62f01e0b-b0a0-462f-a8b7-503c6dce7bf2Thu, 15 Aug 2019 16:40:37 GMTThu, 22 Aug 2019 16:40:37 GMTAgAAAAMAAAAAAAAACb2gKohT1QE=Thu, 15 Aug 2019 16:40:37 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:36 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestspeekmultiplemessages0423782806747/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b691-d003-0034-4d88-539fde000000", + "Body" : "971fc67e-a10f-42a0-85ba-d16ef58d30d9Thu, 15 Aug 2019 16:40:37 GMTThu, 22 Aug 2019 16:40:37 GMTAgAAAAMAAAAAAAAAihWmKohT1QE=Thu, 15 Aug 2019 16:40:37 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:36 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestspeekmultiplemessages0423782806747/messages?numofmessages=2&peekonly=true", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b6ac-d003-0034-6688-539fde000000", + "Body" : "62f01e0b-b0a0-462f-a8b7-503c6dce7bf2Thu, 15 Aug 2019 16:40:37 GMTThu, 22 Aug 2019 16:40:37 GMT0test message 1971fc67e-a10f-42a0-85ba-d16ef58d30d9Thu, 15 Aug 2019 16:40:37 GMTThu, 22 Aug 2019 16:40:37 GMT0test message 2", + "Date" : "Thu, 15 Aug 2019 16:40:36 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestspeekmultiplemessages0423782806747" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsPeekTooManyMessage.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsPeekTooManyMessage.json new file mode 100644 index 000000000000..13518cbf820a --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsPeekTooManyMessage.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestspeektoomanymessage67437d1be16832", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b6e1-d003-0034-1088-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:37 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestspeektoomanymessage67437d1be16832/messages?numofmessages=33&peekonly=true", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "OutOfRangeQueryParameterValue", + "retry-after" : "0", + "Content-Length" : "456", + "StatusCode" : "400", + "x-ms-request-id" : "86d0b6f1-d003-0034-1f88-539fde000000", + "Body" : "OutOfRangeQueryParameterValueOne of the query parameters specified in the request URI is outside the permissible range.\nRequestId:86d0b6f1-d003-0034-1f88-539fde000000\nTime:2019-08-15T16:40:37.6515310Znumofmessages33132", + "Date" : "Thu, 15 Aug 2019 16:40:37 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestspeektoomanymessage67437d1be16832" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetAccessPolicy.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetAccessPolicy.json new file mode 100644 index 000000000000..a9be7cf8b45d --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetAccessPolicy.json @@ -0,0 +1,56 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetaccesspolicy18055e6054856759", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b493-d003-0034-0188-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:33 GMT" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetaccesspolicy18055e6054856759?comp=acl", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "86d0b49b-d003-0034-0888-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:33 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetaccesspolicy18055e6054856759?comp=acl", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b49f-d003-0034-0c88-539fde000000", + "Body" : "testpermission2000-01-01T00:00:00.0000000Z2020-01-01T00:00:00.0000000Zraup", + "Date" : "Thu, 15 Aug 2019 16:40:33 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestssetaccesspolicy18055e6054856759" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetAndClearMetadata0.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetAndClearMetadata0.json new file mode 100644 index 000000000000..39a66b3fea58 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetAndClearMetadata0.json @@ -0,0 +1,73 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetandclearmetadata0775692feb2e02", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b330-d003-0034-4588-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:30 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetandclearmetadata0775692feb2e02?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "Content-Length" : "0", + "x-ms-approximate-messages-count" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b33b-d003-0034-4f88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:31 GMT" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetandclearmetadata0775692feb2e02?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "86d0b346-d003-0034-5a88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:31 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetandclearmetadata0775692feb2e02?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "x-ms-meta-metadata" : "value", + "retry-after" : "0", + "Content-Length" : "0", + "x-ms-approximate-messages-count" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b34c-d003-0034-6088-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:31 GMT" + } + } ], + "variables" : [ "queueaysncapitestssetandclearmetadata0775692feb2e02" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/createTwiceDifferentMetadata.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetAndClearMetadata1.json similarity index 58% rename from sdk/storage/azure-storage-queue/src/test/resources/session-records/createTwiceDifferentMetadata.json rename to sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetAndClearMetadata1.json index 70bd9c8373e7..7ed34369afe8 100644 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/createTwiceDifferentMetadata.json +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetAndClearMetadata1.json @@ -1,10 +1,10 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue60199648", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetandclearmetadata16389313ee0457", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -12,34 +12,34 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "201", - "x-ms-request-id" : "807246c6-4003-00b9-5d03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT" + "x-ms-request-id" : "86d0b35e-d003-0034-7288-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:31 GMT" } }, { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue60199648", + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetandclearmetadata16389313ee0457?comp=metadata", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueAlreadyExists", + "Cache-Control" : "no-cache", "retry-after" : "0", - "Content-Length" : "222", - "StatusCode" : "409", - "x-ms-request-id" : "807246f2-4003-00b9-0403-47d378000000", - "Body" : "QueueAlreadyExistsThe specified queue already exists.\nRequestId:807246f2-4003-00b9-0403-47d378000000\nTime:2019-07-30T18:19:37.7522623Z", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT", - "Content-Type" : "application/xml" + "Content-Length" : "0", + "x-ms-approximate-messages-count" : "0", + "x-ms-meta-metadata1" : "value", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b364-d003-0034-7788-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:31 GMT" } }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue60199648/messages", + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetandclearmetadata16389313ee0457?comp=metadata", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -47,25 +47,28 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "204", - "x-ms-request-id" : "80724708-4003-00b9-1a03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT" + "x-ms-request-id" : "86d0b369-d003-0034-7c88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:31 GMT" } }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue60199648", + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetandclearmetadata16389313ee0457?comp=metadata", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "x-ms-meta-metadata" : "value", "retry-after" : "0", "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "80724714-4003-00b9-2503-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT" + "x-ms-approximate-messages-count" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b36d-d003-0034-8088-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:31 GMT" } } ], - "variables" : [ "queue60199648" ] + "variables" : [ "queueaysncapitestssetandclearmetadata16389313ee0457" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetAndClearMetadata2.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetAndClearMetadata2.json new file mode 100644 index 000000000000..f65ae6875bfb --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetAndClearMetadata2.json @@ -0,0 +1,73 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetandclearmetadata2207469fbef13f", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b382-d003-0034-1188-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:31 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetandclearmetadata2207469fbef13f?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "Content-Length" : "0", + "x-ms-approximate-messages-count" : "0", + "x-ms-meta-metadata1" : "value", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b388-d003-0034-1688-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:31 GMT" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetandclearmetadata2207469fbef13f?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "86d0b38c-d003-0034-1a88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:31 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetandclearmetadata2207469fbef13f?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "Content-Length" : "0", + "x-ms-approximate-messages-count" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b390-d003-0034-1e88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:31 GMT" + } + } ], + "variables" : [ "queueaysncapitestssetandclearmetadata2207469fbef13f" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetAndClearMetadata3.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetAndClearMetadata3.json new file mode 100644 index 000000000000..76ba1d97280a --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetAndClearMetadata3.json @@ -0,0 +1,74 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetandclearmetadata3352166135e768", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b3a5-d003-0034-3088-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:31 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetandclearmetadata3352166135e768?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "x-ms-meta-metadata" : "value", + "retry-after" : "0", + "Content-Length" : "0", + "x-ms-approximate-messages-count" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b3ab-d003-0034-3588-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:31 GMT" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetandclearmetadata3352166135e768?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "86d0b3b1-d003-0034-3a88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:31 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetandclearmetadata3352166135e768?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "x-ms-meta-metadata" : "value", + "retry-after" : "0", + "Content-Length" : "0", + "x-ms-approximate-messages-count" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b3b6-d003-0034-3e88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:32 GMT" + } + } ], + "variables" : [ "queueaysncapitestssetandclearmetadata3352166135e768" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/getProperties.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetAndClearMetadata4.json similarity index 62% rename from sdk/storage/azure-storage-queue/src/test/resources/session-records/getProperties.json rename to sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetAndClearMetadata4.json index c603492afe88..5910a551d6c3 100644 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/getProperties.json +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetAndClearMetadata4.json @@ -1,10 +1,10 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue98021a59", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetandclearmetadata4960994418e531", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -12,15 +12,15 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "201", - "x-ms-request-id" : "8071d0a9-4003-00b9-7f03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:02 GMT" + "x-ms-request-id" : "86d0b3c7-d003-0034-4f88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:32 GMT" } }, { "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue98021a59?comp=metadata", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetandclearmetadata4960994418e531?comp=metadata", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -29,18 +29,16 @@ "retry-after" : "0", "Content-Length" : "0", "x-ms-approximate-messages-count" : "0", - "x-ms-meta-metadata1" : "value1", "StatusCode" : "200", - "x-ms-request-id" : "8071d0df-4003-00b9-3403-47d378000000", - "x-ms-meta-metadata2" : "value2", - "Date" : "Tue, 30 Jul 2019 18:19:02 GMT" + "x-ms-request-id" : "86d0b3cf-d003-0034-5688-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:32 GMT" } }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue98021a59/messages", + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetandclearmetadata4960994418e531?comp=metadata", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -48,25 +46,27 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "204", - "x-ms-request-id" : "8071d0ff-4003-00b9-5303-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:02 GMT" + "x-ms-request-id" : "86d0b3d3-d003-0034-5a88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:32 GMT" } }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue98021a59", + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetandclearmetadata4960994418e531?comp=metadata", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", "retry-after" : "0", "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071d123-4003-00b9-7703-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:02 GMT" + "x-ms-approximate-messages-count" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b3d7-d003-0034-5e88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:32 GMT" } } ], - "variables" : [ "queue98021a59" ] + "variables" : [ "queueaysncapitestssetandclearmetadata4960994418e531" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetInvalidAccessPolicy.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetInvalidAccessPolicy.json new file mode 100644 index 000000000000..9c6ac803b9f8 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetInvalidAccessPolicy.json @@ -0,0 +1,40 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetinvalidaccesspolicy33486e6d29ea", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b4b6-d003-0034-2088-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:33 GMT" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetinvalidaccesspolicy33486e6d29ea?comp=acl", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidXmlDocument", + "retry-after" : "0", + "Content-Length" : "371", + "StatusCode" : "400", + "x-ms-request-id" : "86d0b4c0-d003-0034-2788-539fde000000", + "Body" : "InvalidXmlDocumentXML specified is not syntactically valid.\nRequestId:86d0b4c0-d003-0034-2788-539fde000000\nTime:2019-08-15T16:40:34.4924928Z1304Signed identifier ID cannot be empty or over 64 characters in length", + "Date" : "Thu, 15 Aug 2019 16:40:34 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestssetinvalidaccesspolicy33486e6d29ea" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetInvalidMeta0.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetInvalidMeta0.json new file mode 100644 index 000000000000..b88111954c67 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetInvalidMeta0.json @@ -0,0 +1,38 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetinvalidmeta01683215ccccf91c2", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b3f6-d003-0034-7988-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:32 GMT" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetinvalidmeta01683215ccccf91c2?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Server" : "Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "AuthenticationFailed", + "retry-after" : "0", + "Content-Length" : "790", + "StatusCode" : "403", + "x-ms-request-id" : "86d0b401-d003-0034-0288-539fde000000", + "Body" : "AuthenticationFailedServer failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.\nRequestId:86d0b401-d003-0034-0288-539fde000000\nTime:2019-08-15T16:40:33.1201697ZThe MAC signature found in the HTTP request 'e+GF4D6YPu1FAAvKG8lumPMuaoEpcPbaCCWI3NCVxQ8=' is not the same as any computed signature. Server used following string to sign: 'PUT\n\n\n\n\n\nThu, 15 Aug 2019 16:40:33 GMT\n\n\n\n\n\nx-ms-client-request-id:5d04df0d-c387-4de8-8021-1db1a744ee09\nx-ms-meta-invalidmeta:value\nx-ms-version:2018-03-28\n/azstoragesdkaccount/queueaysncapitestssetinvalidmeta01683215ccccf91c2\ncomp:metadata'.", + "Date" : "Thu, 15 Aug 2019 16:40:32 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestssetinvalidmeta01683215ccccf91c2" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetInvalidMeta1.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetInvalidMeta1.json new file mode 100644 index 000000000000..6ee282eda8d3 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetInvalidMeta1.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetinvalidmeta1355070856bfd3545", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b414-d003-0034-1288-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:32 GMT" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetinvalidmeta1355070856bfd3545?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidMetadata", + "retry-after" : "0", + "Content-Length" : "260", + "StatusCode" : "400", + "x-ms-request-id" : "86d0b416-d003-0034-1388-539fde000000", + "Body" : "InvalidMetadataThe metadata specified is invalid. It has characters that are not permitted.\nRequestId:86d0b416-d003-0034-1388-539fde000000\nTime:2019-08-15T16:40:33.2923348Z", + "Date" : "Thu, 15 Aug 2019 16:40:32 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestssetinvalidmeta1355070856bfd3545" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetInvalidMeta2.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetInvalidMeta2.json new file mode 100644 index 000000000000..da2ee9274904 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetInvalidMeta2.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetinvalidmeta275909d41ee97d45b", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b428-d003-0034-2288-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:32 GMT" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetinvalidmeta275909d41ee97d45b?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidMetadata", + "retry-after" : "0", + "Content-Length" : "260", + "StatusCode" : "400", + "x-ms-request-id" : "86d0b42e-d003-0034-2788-539fde000000", + "Body" : "InvalidMetadataThe metadata specified is invalid. It has characters that are not permitted.\nRequestId:86d0b42e-d003-0034-2788-539fde000000\nTime:2019-08-15T16:40:33.4715096Z", + "Date" : "Thu, 15 Aug 2019 16:40:32 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestssetinvalidmeta275909d41ee97d45b" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetInvalidMeta3.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetInvalidMeta3.json new file mode 100644 index 000000000000..e55852f38e1f --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetInvalidMeta3.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetinvalidmeta350468db0a5487ffa", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b43c-d003-0034-3588-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:33 GMT" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetinvalidmeta350468db0a5487ffa?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "EmptyMetadataKey", + "retry-after" : "0", + "Content-Length" : "278", + "StatusCode" : "400", + "x-ms-request-id" : "86d0b446-d003-0034-3e88-539fde000000", + "Body" : "EmptyMetadataKeyThe key for one of the metadata key-value pairs is empty.\nRequestId:86d0b446-d003-0034-3e88-539fde000000\nTime:2019-08-15T16:40:33.6326628Zvalue", + "Date" : "Thu, 15 Aug 2019 16:40:33 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestssetinvalidmeta350468db0a5487ffa" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetMetadataQueueError.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetMetadataQueueError.json new file mode 100644 index 000000000000..3ae851d04a98 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetMetadataQueueError.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetmetadataqueueerror74958551a725e?comp=metadata", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "QueueNotFound", + "retry-after" : "0", + "Content-Length" : "217", + "StatusCode" : "404", + "x-ms-request-id" : "86d0b3e6-d003-0034-6c88-539fde000000", + "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:86d0b3e6-d003-0034-6c88-539fde000000\nTime:2019-08-15T16:40:32.9049634Z", + "Date" : "Thu, 15 Aug 2019 16:40:32 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestssetmetadataqueueerror74958551a725e" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetMultipleAccessPolicies.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetMultipleAccessPolicies.json new file mode 100644 index 000000000000..4e1877b8f62d --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetMultipleAccessPolicies.json @@ -0,0 +1,56 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetmultipleaccesspolicies342073fd3a7", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b4d8-d003-0034-3d88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:34 GMT" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetmultipleaccesspolicies342073fd3a7?comp=acl", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "86d0b4e0-d003-0034-4488-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:34 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssetmultipleaccesspolicies342073fd3a7?comp=acl", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b4ee-d003-0034-5288-539fde000000", + "Body" : "policy02000-01-01T00:00:00.0000000Z2020-01-01T00:00:00.0000000Zrpolicy12000-01-01T00:00:00.0000000Z2020-01-01T00:00:00.0000000Zrpolicy22000-01-01T00:00:00.0000000Z2020-01-01T00:00:00.0000000Zr", + "Date" : "Thu, 15 Aug 2019 16:40:34 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestssetmultipleaccesspolicies342073fd3a7" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetTooManyAccessPolicies.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetTooManyAccessPolicies.json new file mode 100644 index 000000000000..666a75494585 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsSetTooManyAccessPolicies.json @@ -0,0 +1,40 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssettoomanyaccesspolicies064709aed35", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b503-d003-0034-6688-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:34 GMT" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestssettoomanyaccesspolicies064709aed35?comp=acl", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidXmlDocument", + "retry-after" : "0", + "Content-Length" : "294", + "StatusCode" : "400", + "x-ms-request-id" : "86d0b50d-d003-0034-6d88-539fde000000", + "Body" : "InvalidXmlDocumentXML specified is not syntactically valid.\nRequestId:86d0b50d-d003-0034-6d88-539fde000000\nTime:2019-08-15T16:40:35.0590380Z00", + "Date" : "Thu, 15 Aug 2019 16:40:34 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestssettoomanyaccesspolicies064709aed35" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsUpdateMessage.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsUpdateMessage.json new file mode 100644 index 000000000000..4e7971e698f7 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsUpdateMessage.json @@ -0,0 +1,96 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsupdatemessage4445813bb0fe8e591", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b911-d003-0034-0788-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:40 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsupdatemessage4445813bb0fe8e591/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0b918-d003-0034-0d88-539fde000000", + "Body" : "4e5ffd01-82ac-44ee-a37d-526ab678478dThu, 15 Aug 2019 16:40:40 GMTThu, 22 Aug 2019 16:40:40 GMTAgAAAAMAAAAAAAAAZx6cLIhT1QE=Thu, 15 Aug 2019 16:40:40 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:40 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsupdatemessage4445813bb0fe8e591/messages?numofmessages=1&visibilitytimeout=30", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0b925-d003-0034-1988-539fde000000", + "Body" : "4e5ffd01-82ac-44ee-a37d-526ab678478dThu, 15 Aug 2019 16:40:40 GMTThu, 22 Aug 2019 16:40:40 GMTAgAAAAMAAAAAAAAAW92DPohT1QE=Thu, 15 Aug 2019 16:41:10 GMT1test message before update", + "Date" : "Thu, 15 Aug 2019 16:40:40 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsupdatemessage4445813bb0fe8e591/messages/4e5ffd01-82ac-44ee-a37d-526ab678478d?popreceipt=AgAAAAMAAAAAAAAAW92DPohT1QE%3d&visibilitytimeout=1", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-time-next-visible" : "Thu, 15 Aug 2019 16:40:41 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "86d0b933-d003-0034-2788-539fde000000", + "x-ms-popreceipt" : "AwAAAAMAAAAAAAAAhYVDLYhT1QEBAAAA", + "Date" : "Thu, 15 Aug 2019 16:40:40 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsupdatemessage4445813bb0fe8e591/messages?peekonly=true", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0ba71-d003-0034-5888-539fde000000", + "Body" : "4e5ffd01-82ac-44ee-a37d-526ab678478dThu, 15 Aug 2019 16:40:40 GMTThu, 22 Aug 2019 16:40:40 GMT1Updated test message", + "Date" : "Thu, 15 Aug 2019 16:40:42 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestsupdatemessage4445813bb0fe8e591" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsUpdateMessageInvalidArgs0.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsUpdateMessageInvalidArgs0.json new file mode 100644 index 000000000000..71fa55e9834c --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsUpdateMessageInvalidArgs0.json @@ -0,0 +1,78 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsupdatemessageinvalidargs081201908aa6", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0ba95-d003-0034-7888-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:42 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsupdatemessageinvalidargs081201908aa6/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0ba9d-d003-0034-7d88-539fde000000", + "Body" : "ed0c89e4-9fc0-4d1c-b6d7-e558cda27df2Thu, 15 Aug 2019 16:40:43 GMTThu, 22 Aug 2019 16:40:43 GMTAgAAAAMAAAAAAAAAxNcTLohT1QE=Thu, 15 Aug 2019 16:40:43 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:42 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsupdatemessageinvalidargs081201908aa6/messages?numofmessages=1&visibilitytimeout=30", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0baa4-d003-0034-0288-539fde000000", + "Body" : "ed0c89e4-9fc0-4d1c-b6d7-e558cda27df2Thu, 15 Aug 2019 16:40:43 GMTThu, 22 Aug 2019 16:40:43 GMTAgAAAAMAAAAAAAAAJjP8P4hT1QE=Thu, 15 Aug 2019 16:41:13 GMT1test message before update", + "Date" : "Thu, 15 Aug 2019 16:40:42 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsupdatemessageinvalidargs081201908aa6/messages/ed0c89e4-9fc0-4d1c-b6d7-e558cda27df2?popreceipt=AgAAAAMAAAAAAAAAJjP8P4hT1QE%3dRandom&visibilitytimeout=1", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidQueryParameterValue", + "retry-after" : "0", + "Content-Length" : "444", + "StatusCode" : "400", + "x-ms-request-id" : "86d0baae-d003-0034-0b88-539fde000000", + "Body" : "InvalidQueryParameterValueValue for one of the query parameters specified in the request URI is invalid.\nRequestId:86d0baae-d003-0034-0b88-539fde000000\nTime:2019-08-15T16:40:43.2038761ZpopreceiptAgAAAAMAAAAAAAAAJjP8P4hT1QE=RandomInvalid pop receipt format", + "Date" : "Thu, 15 Aug 2019 16:40:42 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestsupdatemessageinvalidargs081201908aa6" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsUpdateMessageInvalidArgs1.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsUpdateMessageInvalidArgs1.json new file mode 100644 index 000000000000..8a058a925169 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsUpdateMessageInvalidArgs1.json @@ -0,0 +1,78 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsupdatemessageinvalidargs163307d0c678", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0bac1-d003-0034-1b88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:42 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsupdatemessageinvalidargs163307d0c678/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0baca-d003-0034-2188-539fde000000", + "Body" : "bbfff9d1-bc64-428c-b460-f1419acc90a1Thu, 15 Aug 2019 16:40:43 GMTThu, 22 Aug 2019 16:40:43 GMTAgAAAAMAAAAAAAAA/RA/LohT1QE=Thu, 15 Aug 2019 16:40:43 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:42 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsupdatemessageinvalidargs163307d0c678/messages?numofmessages=1&visibilitytimeout=30", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0bace-d003-0034-2588-539fde000000", + "Body" : "bbfff9d1-bc64-428c-b460-f1419acc90a1Thu, 15 Aug 2019 16:40:43 GMTThu, 22 Aug 2019 16:40:43 GMTAgAAAAMAAAAAAAAAdgwmQIhT1QE=Thu, 15 Aug 2019 16:41:13 GMT1test message before update", + "Date" : "Thu, 15 Aug 2019 16:40:42 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsupdatemessageinvalidargs163307d0c678/messages/bbfff9d1-bc64-428c-b460-f1419acc90a1Random?popreceipt=AgAAAAMAAAAAAAAAdgwmQIhT1QE%3d&visibilitytimeout=1", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "MessageNotFound", + "retry-after" : "0", + "Content-Length" : "221", + "StatusCode" : "404", + "x-ms-request-id" : "86d0bad4-d003-0034-2b88-539fde000000", + "Body" : "MessageNotFoundThe specified message does not exist.\nRequestId:86d0bad4-d003-0034-2b88-539fde000000\nTime:2019-08-15T16:40:43.4651281Z", + "Date" : "Thu, 15 Aug 2019 16:40:42 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestsupdatemessageinvalidargs163307d0c678" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsUpdateMessageInvalidArgs2.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsUpdateMessageInvalidArgs2.json new file mode 100644 index 000000000000..40ebda4b09ea --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueAysncAPITestsUpdateMessageInvalidArgs2.json @@ -0,0 +1,78 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsupdatemessageinvalidargs230456b8e3fd", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0baed-d003-0034-4388-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:43 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsupdatemessageinvalidargs230456b8e3fd/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0baf4-d003-0034-4988-539fde000000", + "Body" : "25b1663b-0917-4820-82ab-4841c1326b31Thu, 15 Aug 2019 16:40:43 GMTThu, 22 Aug 2019 16:40:43 GMTAgAAAAMAAAAAAAAAc4pnLohT1QE=Thu, 15 Aug 2019 16:40:43 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:43 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsupdatemessageinvalidargs230456b8e3fd/messages?numofmessages=1&visibilitytimeout=30", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86d0bafb-d003-0034-4e88-539fde000000", + "Body" : "25b1663b-0917-4820-82ab-4841c1326b31Thu, 15 Aug 2019 16:40:43 GMTThu, 22 Aug 2019 16:40:43 GMTAgAAAAMAAAAAAAAABdROQIhT1QE=Thu, 15 Aug 2019 16:41:13 GMT1test message before update", + "Date" : "Thu, 15 Aug 2019 16:40:43 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueaysncapitestsupdatemessageinvalidargs230456b8e3fd/messages/25b1663b-0917-4820-82ab-4841c1326b31Random?popreceipt=AgAAAAMAAAAAAAAABdROQIhT1QE%3dRandom&visibilitytimeout=1", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidQueryParameterValue", + "retry-after" : "0", + "Content-Length" : "444", + "StatusCode" : "400", + "x-ms-request-id" : "86d0bb0a-d003-0034-5b88-539fde000000", + "Body" : "InvalidQueryParameterValueValue for one of the query parameters specified in the request URI is invalid.\nRequestId:86d0bb0a-d003-0034-5b88-539fde000000\nTime:2019-08-15T16:40:43.7233771ZpopreceiptAgAAAAMAAAAAAAAABdROQIhT1QE=RandomInvalid pop receipt format", + "Date" : "Thu, 15 Aug 2019 16:40:43 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueaysncapitestsupdatemessageinvalidargs230456b8e3fd" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateNull.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateNull.json new file mode 100644 index 000000000000..ba5f37f8f855 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateNull.json @@ -0,0 +1,4 @@ +{ + "networkCallRecords" : [ ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueue.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueue.json new file mode 100644 index 000000000000..dc2a5a0a32e5 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueue.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestscreatequeue074371e62a4ccfd46", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0bb2f-d003-0034-7d88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:43 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestscreatequeue074371e62a4ccfd46/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0bb38-d003-0034-0588-539fde000000", + "Body" : "2e77531c-f441-41ef-9ff6-b6322409ae69Thu, 15 Aug 2019 16:40:43 GMTThu, 22 Aug 2019 16:40:43 GMTAgAAAAMAAAAAAAAAExyYLohT1QE=Thu, 15 Aug 2019 16:40:43 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:43 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueserviceapitestscreatequeue074371e62a4ccfd46" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueMaxOverload0.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueMaxOverload0.json new file mode 100644 index 000000000000..484cc8e29533 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueMaxOverload0.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestscreatequeuemaxoverload074849a8610c", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0bbb3-d003-0034-7588-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:44 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestscreatequeuemaxoverload074849a8610c/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0bbc2-d003-0034-0288-539fde000000", + "Body" : "9c9a313c-99a1-4d0b-927f-94cf777190efThu, 15 Aug 2019 16:40:44 GMTThu, 22 Aug 2019 16:40:44 GMTAgAAAAMAAAAAAAAALE0xL4hT1QE=Thu, 15 Aug 2019 16:40:44 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:44 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueserviceapitestscreatequeuemaxoverload074849a8610c" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueMaxOverload1.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueMaxOverload1.json new file mode 100644 index 000000000000..060f4484235a --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueMaxOverload1.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestscreatequeuemaxoverload182562dfc26f", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0bbdd-d003-0034-1b88-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:44 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestscreatequeuemaxoverload182562dfc26f/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0bbe7-d003-0034-2388-539fde000000", + "Body" : "7662fa88-d012-476e-8db1-0438feb9d9b6Thu, 15 Aug 2019 16:40:45 GMTThu, 22 Aug 2019 16:40:45 GMTAgAAAAMAAAAAAAAAd0BNL4hT1QE=Thu, 15 Aug 2019 16:40:45 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:44 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueserviceapitestscreatequeuemaxoverload182562dfc26f" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueMaxOverload2.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueMaxOverload2.json new file mode 100644 index 000000000000..89ca2b0ebfbc --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueMaxOverload2.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestscreatequeuemaxoverload2383601fe697", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0bbfd-d003-0034-3688-539fde000000", + "Date" : "Thu, 15 Aug 2019 16:40:44 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestscreatequeuemaxoverload2383601fe697/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d0bc06-d003-0034-3e88-539fde000000", + "Body" : "a8cc78e1-6d22-47a4-9b1d-5af87883ad21Thu, 15 Aug 2019 16:40:45 GMTThu, 22 Aug 2019 16:40:45 GMTAgAAAAMAAAAAAAAAogxpL4hT1QE=Thu, 15 Aug 2019 16:40:45 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:44 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueserviceapitestscreatequeuemaxoverload2383601fe697" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueWithInvalidMetadata.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueWithInvalidMetadata.json new file mode 100644 index 000000000000..54410b10741f --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueWithInvalidMetadata.json @@ -0,0 +1,21 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/3fb1a9c3baec4586", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Server" : "Microsoft-HTTPAPI/2.0", + "Connection" : "close", + "retry-after" : "0", + "Content-Length" : "339", + "StatusCode" : "400", + "Body" : "\r\nBad Request\r\n\r\n

Bad Request - Invalid Header

\r\n

HTTP Error 400. The request has an invalid header name.

\r\n\r\n", + "Date" : "Thu, 15 Aug 2019 16:40:44 GMT", + "Content-Type" : "text/html; charset=us-ascii" + } + } ], + "variables" : [ "3fb1a9c3baec4586" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueWithInvalidName0.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueWithInvalidName0.json new file mode 100644 index 000000000000..525fd6e4ea87 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueWithInvalidName0.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/a_b", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidResourceName", + "retry-after" : "0", + "Content-Length" : "243", + "StatusCode" : "400", + "x-ms-request-id" : "86d0bb53-d003-0034-2088-539fde000000", + "Body" : "InvalidResourceNameThe specifed resource name contains invalid characters.\nRequestId:86d0bb53-d003-0034-2088-539fde000000\nTime:2019-08-15T16:40:44.2939271Z", + "Date" : "Thu, 15 Aug 2019 16:40:43 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueWithInvalidName1.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueWithInvalidName1.json new file mode 100644 index 000000000000..18fd8e02e7f3 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueWithInvalidName1.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/-ab", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidResourceName", + "retry-after" : "0", + "Content-Length" : "243", + "StatusCode" : "400", + "x-ms-request-id" : "86d0bb5d-d003-0034-2988-539fde000000", + "Body" : "InvalidResourceNameThe specifed resource name contains invalid characters.\nRequestId:86d0bb5d-d003-0034-2988-539fde000000\nTime:2019-08-15T16:40:44.3950248Z", + "Date" : "Thu, 15 Aug 2019 16:40:43 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueWithInvalidName2.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueWithInvalidName2.json new file mode 100644 index 000000000000..6dc9821c78d2 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueWithInvalidName2.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/a--b", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidResourceName", + "retry-after" : "0", + "Content-Length" : "243", + "StatusCode" : "400", + "x-ms-request-id" : "86d0bb69-d003-0034-3488-539fde000000", + "Body" : "InvalidResourceNameThe specifed resource name contains invalid characters.\nRequestId:86d0bb69-d003-0034-3488-539fde000000\nTime:2019-08-15T16:40:44.4961229Z", + "Date" : "Thu, 15 Aug 2019 16:40:44 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueWithInvalidName3.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueWithInvalidName3.json new file mode 100644 index 000000000000..e63f4a5b7881 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueWithInvalidName3.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/Abc", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidResourceName", + "retry-after" : "0", + "Content-Length" : "243", + "StatusCode" : "400", + "x-ms-request-id" : "86d0bb7c-d003-0034-4788-539fde000000", + "Body" : "InvalidResourceNameThe specifed resource name contains invalid characters.\nRequestId:86d0bb7c-d003-0034-4788-539fde000000\nTime:2019-08-15T16:40:44.5872096Z", + "Date" : "Thu, 15 Aug 2019 16:40:44 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueWithInvalidName4.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueWithInvalidName4.json new file mode 100644 index 000000000000..cd17d136fdfe --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueWithInvalidName4.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/ab", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "OutOfRangeInput", + "retry-after" : "0", + "Content-Length" : "256", + "StatusCode" : "400", + "x-ms-request-id" : "86d0bb88-d003-0034-5288-539fde000000", + "Body" : "OutOfRangeInputThe specified resource name length is not within the permissible limits.\nRequestId:86d0bb88-d003-0034-5288-539fde000000\nTime:2019-08-15T16:40:44.6823024Z", + "Date" : "Thu, 15 Aug 2019 16:40:44 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueWithInvalidName5.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueWithInvalidName5.json new file mode 100644 index 000000000000..ed1dfa6d0392 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsCreateQueueWithInvalidName5.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/verylongverylongverylongverylongverylongverylongverylongverylong", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "OutOfRangeInput", + "retry-after" : "0", + "Content-Length" : "256", + "StatusCode" : "400", + "x-ms-request-id" : "86d0bb9f-d003-0034-6488-539fde000000", + "Body" : "OutOfRangeInputThe specified resource name length is not within the permissible limits.\nRequestId:86d0bb9f-d003-0034-6488-539fde000000\nTime:2019-08-15T16:40:44.7723883Z", + "Date" : "Thu, 15 Aug 2019 16:40:44 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsDeleteQueue.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsDeleteQueue.json new file mode 100644 index 000000000000..6b0c052b62a7 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsDeleteQueue.json @@ -0,0 +1,56 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestsdeletequeue42052e8daafc75e56", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "b9c9c804-2003-0008-6c88-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:45 GMT" + } + }, { + "Method" : "DELETE", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestsdeletequeue42052e8daafc75e56", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "b9c9c80f-2003-0008-7588-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:45 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestsdeletequeue42052e8daafc75e56/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "QueueNotFound", + "retry-after" : "0", + "Content-Length" : "217", + "StatusCode" : "404", + "x-ms-request-id" : "b9c9c819-2003-0008-7d88-532b05000000", + "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:b9c9c819-2003-0008-7d88-532b05000000\nTime:2019-08-15T16:40:45.8743783Z", + "Date" : "Thu, 15 Aug 2019 16:40:45 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueserviceapitestsdeletequeue42052e8daafc75e56" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsDeleteQueueError.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsDeleteQueueError.json new file mode 100644 index 000000000000..4dcc7458529f --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsDeleteQueueError.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "DELETE", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestsdeletequeueerror1100262e3172b5", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "QueueNotFound", + "retry-after" : "0", + "Content-Length" : "217", + "StatusCode" : "404", + "x-ms-request-id" : "b9c9c827-2003-0008-0988-532b05000000", + "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:b9c9c827-2003-0008-0988-532b05000000\nTime:2019-08-15T16:40:45.9754728Z", + "Date" : "Thu, 15 Aug 2019 16:40:45 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueserviceapitestsdeletequeueerror1100262e3172b5" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsGetAndSetProperties.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsGetAndSetProperties.json new file mode 100644 index 000000000000..d0be4644da50 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsGetAndSetProperties.json @@ -0,0 +1,78 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?restype=service&comp=properties", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "14882d4f-6003-00ea-4088-53cf77000000", + "Body" : "1.0falsetruetruetrue31.0truefalsetrue31.0truefalsetrue3", + "Date" : "Thu, 15 Aug 2019 16:40:47 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?restype=service&comp=properties", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "14882d82-6003-00ea-6f88-53cf77000000", + "Body" : "1.0falsetruetruetrue31.0truefalsetrue31.0truefalsetrue3", + "Date" : "Thu, 15 Aug 2019 16:40:47 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?restype=service&comp=properties", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "14882da7-6003-00ea-1288-53cf77000000", + "Date" : "Thu, 15 Aug 2019 16:40:48 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?restype=service&comp=properties", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "14882ebe-6003-00ea-1488-53cf77000000", + "Body" : "1.0falsetruetruetrue31.0truefalsetrue31.0truefalsetrue3", + "Date" : "Thu, 15 Aug 2019 16:40:48 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsGetQueueClient.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsGetQueueClient.json new file mode 100644 index 000000000000..dbb9e99a8d2a --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsGetQueueClient.json @@ -0,0 +1,4 @@ +{ + "networkCallRecords" : [ ], + "variables" : [ "queueserviceapitestsgetqueueclient02320715bfd10cd" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsListEmptyQueues.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsListEmptyQueues.json new file mode 100644 index 000000000000..de513b4009ee --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsListEmptyQueues.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=QueueServiceAPITestsListEmptyQueues&include=&comp=list", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "14882d28-6003-00ea-1b88-53cf77000000", + "Body" : "QueueServiceAPITestsListEmptyQueues", + "Date" : "Thu, 15 Aug 2019 16:40:47 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueserviceapitestslistemptyqueues28264ca30cb29e2" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/createQueueTwiceSameMetadata.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsListQueues0.json similarity index 54% rename from sdk/storage/azure-storage-queue/src/test/resources/session-records/createQueueTwiceSameMetadata.json rename to sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsListQueues0.json index cc245715abd6..84f3a0f6abae 100644 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/createQueueTwiceSameMetadata.json +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsListQueues0.json @@ -1,10 +1,10 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue74324182", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestslistqueues0197608aaded4b7b220", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -12,50 +12,47 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "201", - "x-ms-request-id" : "1cdd82b9-e003-0073-5c09-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:05 GMT" + "x-ms-request-id" : "b9c9c84f-2003-0008-2b88-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:46 GMT" } }, { - "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue74324182/messages?visibilitytimeout=0&messagettl=604800", + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestslistqueues0197608aaded4b7b221", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { - "Transfer-Encoding" : "chunked", "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", "retry-after" : "0", + "Content-Length" : "0", "StatusCode" : "201", - "x-ms-request-id" : "1cdd82bd-e003-0073-5f09-4740b5000000", - "Body" : "a1a192f0-d5b6-4a03-8365-eafbc589b4b0Tue, 30 Jul 2019 19:01:06 GMTTue, 06 Aug 2019 19:01:06 GMTAgAAAAMAAAAAAAAAW6ZEJAlH1QE=Tue, 30 Jul 2019 19:01:06 GMT", - "Date" : "Tue, 30 Jul 2019 19:01:05 GMT", - "Content-Type" : "application/xml" + "x-ms-request-id" : "b9c9c86a-2003-0008-4488-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:46 GMT" } }, { "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue74324182", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestslistqueues0197608aaded4b7b222", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", "retry-after" : "0", "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd82c6-e003-0073-6609-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:05 GMT" + "StatusCode" : "201", + "x-ms-request-id" : "b9c9c86f-2003-0008-4888-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:46 GMT" } }, { "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue74324182/messages?peekonly=true", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queueserviceapitestslistqueues&include=&comp=list", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "Transfer-Encoding" : "chunked", @@ -64,36 +61,33 @@ "Cache-Control" : "no-cache", "retry-after" : "0", "StatusCode" : "200", - "x-ms-request-id" : "1cdd82cc-e003-0073-6c09-4740b5000000", - "Body" : "a1a192f0-d5b6-4a03-8365-eafbc589b4b0Tue, 30 Jul 2019 19:01:06 GMTTue, 06 Aug 2019 19:01:06 GMT0Testing service client creating the same queue twice does not modify the queue", - "Date" : "Tue, 30 Jul 2019 19:01:05 GMT", + "x-ms-request-id" : "b9c9c87b-2003-0008-5188-532b05000000", + "Body" : "queueserviceapitestslistqueuesqueueserviceapitestslistqueues0197608aaded4b7b220queueserviceapitestslistqueues0197608aaded4b7b221queueserviceapitestslistqueues0197608aaded4b7b222", + "Date" : "Thu, 15 Aug 2019 16:40:46 GMT", "Content-Type" : "application/xml" } }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queue74324182&include=&comp=list", + "Method" : "DELETE", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestslistqueues0197608aaded4b7b220", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { - "Transfer-Encoding" : "chunked", "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "1cdd82d9-e003-0073-7909-4740b5000000", - "Body" : "queue74324182queue74324182", - "Date" : "Tue, 30 Jul 2019 19:01:05 GMT", - "Content-Type" : "application/xml" + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "b9c9c880-2003-0008-5688-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:46 GMT" } }, { "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue74324182/messages", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestslistqueues0197608aaded4b7b221", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -101,15 +95,15 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "204", - "x-ms-request-id" : "1cdd82e0-e003-0073-7f09-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:06 GMT" + "x-ms-request-id" : "b9c9c888-2003-0008-5c88-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:46 GMT" } }, { "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue74324182", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestslistqueues0197608aaded4b7b222", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -117,9 +111,9 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "204", - "x-ms-request-id" : "1cdd82e9-e003-0073-0709-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:06 GMT" + "x-ms-request-id" : "b9c9c895-2003-0008-6788-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:46 GMT" } } ], - "variables" : [ "queue74324182" ] + "variables" : [ "queueserviceapitestslistqueues0197608aaded4b7b22" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/listQueues.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsListQueues1.json similarity index 51% rename from sdk/storage/azure-storage-queue/src/test/resources/session-records/listQueues.json rename to sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsListQueues1.json index 60f43a830052..d529b881dd91 100644 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/listQueues.json +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsListQueues1.json @@ -1,10 +1,10 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue53815dd50", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestslistqueues1262287461f7bb9c2c0", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -12,15 +12,15 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "201", - "x-ms-request-id" : "1cdd8272-e003-0073-1c09-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:05 GMT" + "x-ms-request-id" : "b9c9c89f-2003-0008-6f88-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:46 GMT" } }, { "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue53815dd51", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestslistqueues1262287461f7bb9c2c1", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -28,15 +28,15 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "201", - "x-ms-request-id" : "1cdd8278-e003-0073-2109-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:05 GMT" + "x-ms-request-id" : "b9c9c8ab-2003-0008-7788-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:46 GMT" } }, { "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue53815dd52", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestslistqueues1262287461f7bb9c2c2", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -44,15 +44,15 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "201", - "x-ms-request-id" : "1cdd827e-e003-0073-2609-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:05 GMT" + "x-ms-request-id" : "b9c9c8b0-2003-0008-7b88-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:46 GMT" } }, { "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queue53815dd5&include=&comp=list", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queueserviceapitestslistqueues&maxresults=2&include=&comp=list", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "Transfer-Encoding" : "chunked", @@ -61,17 +61,17 @@ "Cache-Control" : "no-cache", "retry-after" : "0", "StatusCode" : "200", - "x-ms-request-id" : "1cdd8286-e003-0073-2d09-4740b5000000", - "Body" : "queue53815dd5queue53815dd50queue53815dd51queue53815dd52", - "Date" : "Tue, 30 Jul 2019 19:01:05 GMT", + "x-ms-request-id" : "b9c9c8bd-2003-0008-0588-532b05000000", + "Body" : "queueserviceapitestslistqueues2queueserviceapitestslistqueues1262287461f7bb9c2c0queueserviceapitestslistqueues1262287461f7bb9c2c1/azstoragesdkaccount/queueserviceapitestslistqueues1262287461f7bb9c2c2", + "Date" : "Thu, 15 Aug 2019 16:40:46 GMT", "Content-Type" : "application/xml" } }, { "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queue53815dd5&include=&comp=list", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queueserviceapitestslistqueues&marker=/azstoragesdkaccount/queueserviceapitestslistqueues1262287461f7bb9c2c2&maxresults=2&include=&comp=list", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "Transfer-Encoding" : "chunked", @@ -80,17 +80,17 @@ "Cache-Control" : "no-cache", "retry-after" : "0", "StatusCode" : "200", - "x-ms-request-id" : "1cdd828a-e003-0073-3109-4740b5000000", - "Body" : "queue53815dd5queue53815dd50queue53815dd51queue53815dd52", - "Date" : "Tue, 30 Jul 2019 19:01:05 GMT", + "x-ms-request-id" : "b9c9c8c6-2003-0008-0b88-532b05000000", + "Body" : "queueserviceapitestslistqueues/azstoragesdkaccount/queueserviceapitestslistqueues1262287461f7bb9c2c22queueserviceapitestslistqueues1262287461f7bb9c2c2", + "Date" : "Thu, 15 Aug 2019 16:40:46 GMT", "Content-Type" : "application/xml" } }, { "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue53815dd50/messages", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestslistqueues1262287461f7bb9c2c0", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -98,15 +98,15 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "204", - "x-ms-request-id" : "1cdd828e-e003-0073-3409-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:05 GMT" + "x-ms-request-id" : "14882a79-6003-00ea-1088-53cf77000000", + "Date" : "Thu, 15 Aug 2019 16:40:46 GMT" } }, { "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue53815dd50", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestslistqueues1262287461f7bb9c2c1", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -114,15 +114,15 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "204", - "x-ms-request-id" : "1cdd8292-e003-0073-3809-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:05 GMT" + "x-ms-request-id" : "14882b6a-6003-00ea-7588-53cf77000000", + "Date" : "Thu, 15 Aug 2019 16:40:46 GMT" } }, { "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue53815dd51/messages", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestslistqueues1262287461f7bb9c2c2", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -130,57 +130,9 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "204", - "x-ms-request-id" : "1cdd829b-e003-0073-3f09-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:05 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue53815dd51", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd82a2-e003-0073-4509-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:05 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue53815dd52/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd82a8-e003-0073-4b09-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:05 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue53815dd52", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd82b1-e003-0073-5409-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:05 GMT" + "x-ms-request-id" : "14882b7e-6003-00ea-0988-53cf77000000", + "Date" : "Thu, 15 Aug 2019 16:40:46 GMT" } } ], - "variables" : [ "queue53815dd5" ] + "variables" : [ "queueserviceapitestslistqueues1262287461f7bb9c2c" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteMessage.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsListQueues2.json similarity index 53% rename from sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteMessage.json rename to sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsListQueues2.json index f3bcf1a4fbf6..0284f7c87a30 100644 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteMessage.json +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAPITestsListQueues2.json @@ -1,10 +1,10 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue60865355", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestslistqueues2335005ecce17d3f5b0", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -12,87 +12,82 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "201", - "x-ms-request-id" : "807248e4-4003-00b9-6403-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT" + "x-ms-request-id" : "14882bad-6003-00ea-3688-53cf77000000", + "Date" : "Thu, 15 Aug 2019 16:40:47 GMT" } }, { - "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue60865355/messages?visibilitytimeout=0&messagettl=604800", + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestslistqueues2335005ecce17d3f5b1", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { - "Transfer-Encoding" : "chunked", "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", "retry-after" : "0", + "Content-Length" : "0", "StatusCode" : "201", - "x-ms-request-id" : "80724919-4003-00b9-1703-47d378000000", - "Body" : "70decbfa-af3b-453f-b291-f78c97eb512dTue, 30 Jul 2019 18:19:38 GMTTue, 06 Aug 2019 18:19:38 GMTAgAAAAMAAAAAAAAA9GMvWQNH1QE=Tue, 30 Jul 2019 18:19:38 GMT", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT", - "Content-Type" : "application/xml" + "x-ms-request-id" : "14882ca0-6003-00ea-1b88-53cf77000000", + "Date" : "Thu, 15 Aug 2019 16:40:47 GMT" } }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue60865355/messages?numofmessages=1&visibilitytimeout=30", + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestslistqueues2335005ecce17d3f5b2", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { - "Transfer-Encoding" : "chunked", "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "80724936-4003-00b9-3103-47d378000000", - "Body" : "70decbfa-af3b-453f-b291-f78c97eb512dTue, 30 Jul 2019 18:19:38 GMTTue, 06 Aug 2019 18:19:38 GMTAgAAAAMAAAAAAAAA8psVawNH1QE=Tue, 30 Jul 2019 18:20:08 GMT1test message", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT", - "Content-Type" : "application/xml" + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "14882cb8-6003-00ea-2e88-53cf77000000", + "Date" : "Thu, 15 Aug 2019 16:40:47 GMT" } }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue60865355/messages/70decbfa-af3b-453f-b291-f78c97eb512d?popreceipt=AgAAAAMAAAAAAAAA8psVawNH1QE%3d", + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queueserviceapitestslistqueues&include=metadata&comp=list", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { + "Transfer-Encoding" : "chunked", "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "80724958-4003-00b9-5103-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT" + "StatusCode" : "200", + "x-ms-request-id" : "14882ccc-6003-00ea-4188-53cf77000000", + "Body" : "queueserviceapitestslistqueuesqueueserviceapitestslistqueues2335005ecce17d3f5b0value0queueserviceapitestslistqueues2335005ecce17d3f5b1value1queueserviceapitestslistqueues2335005ecce17d3f5b2value2", + "Date" : "Thu, 15 Aug 2019 16:40:47 GMT", + "Content-Type" : "application/xml" } }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue60865355?comp=metadata", + "Method" : "DELETE", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestslistqueues2335005ecce17d3f5b0", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", "retry-after" : "0", "Content-Length" : "0", - "x-ms-approximate-messages-count" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "80724972-4003-00b9-6a03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT" + "StatusCode" : "204", + "x-ms-request-id" : "14882cde-6003-00ea-5388-53cf77000000", + "Date" : "Thu, 15 Aug 2019 16:40:47 GMT" } }, { "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue60865355/messages", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestslistqueues2335005ecce17d3f5b1", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -100,15 +95,15 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "204", - "x-ms-request-id" : "80724985-4003-00b9-7d03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT" + "x-ms-request-id" : "14882cee-6003-00ea-6288-53cf77000000", + "Date" : "Thu, 15 Aug 2019 16:40:47 GMT" } }, { "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue60865355", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceapitestslistqueues2335005ecce17d3f5b2", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -116,9 +111,9 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "204", - "x-ms-request-id" : "8072499e-4003-00b9-1603-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT" + "x-ms-request-id" : "14882cfe-6003-00ea-7288-53cf77000000", + "Date" : "Thu, 15 Aug 2019 16:40:47 GMT" } } ], - "variables" : [ "queue60865355" ] + "variables" : [ "queueserviceapitestslistqueues2335005ecce17d3f5b" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateNull.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateNull.json new file mode 100644 index 000000000000..ba5f37f8f855 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateNull.json @@ -0,0 +1,4 @@ +{ + "networkCallRecords" : [ ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueue.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueue.json new file mode 100644 index 000000000000..2517bb6c4f49 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueue.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceasyncapitestscreatequeue80797d675f4fdd", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "14882f05-6003-00ea-5588-53cf77000000", + "Date" : "Thu, 15 Aug 2019 16:40:48 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceasyncapitestscreatequeue80797d675f4fdd/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "14882f2e-6003-00ea-7c88-53cf77000000", + "Body" : "91d64df6-7e14-4818-b5ec-d683d139d7d4Thu, 15 Aug 2019 16:40:49 GMTThu, 22 Aug 2019 16:40:49 GMTAgAAAAMAAAAAAAAAqpkVMohT1QE=Thu, 15 Aug 2019 16:40:49 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:49 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueserviceasyncapitestscreatequeue80797d675f4fdd" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueMaxOverload0.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueMaxOverload0.json new file mode 100644 index 000000000000..d5184d25f637 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueMaxOverload0.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceasyncapitestscreatequeuemaxoverload0158269f3", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "14883095-6003-00ea-5288-53cf77000000", + "Date" : "Thu, 15 Aug 2019 16:40:49 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceasyncapitestscreatequeuemaxoverload0158269f3/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "148830a8-6003-00ea-6488-53cf77000000", + "Body" : "2b6edef0-dc13-4d4a-86af-0aa1795df7f5Thu, 15 Aug 2019 16:40:50 GMTThu, 22 Aug 2019 16:40:50 GMTAgAAAAMAAAAAAAAASo6vMohT1QE=Thu, 15 Aug 2019 16:40:50 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:50 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueserviceasyncapitestscreatequeuemaxoverload0158269f3" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueMaxOverload1.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueMaxOverload1.json new file mode 100644 index 000000000000..8f5a34864625 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueMaxOverload1.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceasyncapitestscreatequeuemaxoverload175671399", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "148830ec-6003-00ea-2788-53cf77000000", + "Date" : "Thu, 15 Aug 2019 16:40:50 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceasyncapitestscreatequeuemaxoverload175671399/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "148830ff-6003-00ea-3788-53cf77000000", + "Body" : "c0593110-94aa-4206-a6e1-07656271f3f1Thu, 15 Aug 2019 16:40:51 GMTThu, 22 Aug 2019 16:40:51 GMTAgAAAAMAAAAAAAAAkfrJMohT1QE=Thu, 15 Aug 2019 16:40:51 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:50 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueserviceasyncapitestscreatequeuemaxoverload175671399" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueMaxOverload2.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueMaxOverload2.json new file mode 100644 index 000000000000..067dc1c69797 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueMaxOverload2.json @@ -0,0 +1,39 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceasyncapitestscreatequeuemaxoverload256562926", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "1488313b-6003-00ea-7088-53cf77000000", + "Date" : "Thu, 15 Aug 2019 16:40:50 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceasyncapitestscreatequeuemaxoverload256562926/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "14883153-6003-00ea-0688-53cf77000000", + "Body" : "baa9aa21-4efe-4c65-aac3-a891899c6c3bThu, 15 Aug 2019 16:40:51 GMTThu, 22 Aug 2019 16:40:51 GMTAgAAAAMAAAAAAAAAbcrjMohT1QE=Thu, 15 Aug 2019 16:40:51 GMT", + "Date" : "Thu, 15 Aug 2019 16:40:50 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueserviceasyncapitestscreatequeuemaxoverload256562926" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueWithInvalidMetadata.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueWithInvalidMetadata.json new file mode 100644 index 000000000000..eec802198892 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueWithInvalidMetadata.json @@ -0,0 +1,21 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceasyncapitestscreatequeuewithinvalidmetadata80018", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Server" : "Microsoft-HTTPAPI/2.0", + "Connection" : "close", + "retry-after" : "0", + "Content-Length" : "339", + "StatusCode" : "400", + "Body" : "\r\nBad Request\r\n\r\n

Bad Request - Invalid Header

\r\n

HTTP Error 400. The request has an invalid header name.

\r\n\r\n", + "Date" : "Thu, 15 Aug 2019 16:40:50 GMT", + "Content-Type" : "text/html; charset=us-ascii" + } + } ], + "variables" : [ "queueserviceasyncapitestscreatequeuewithinvalidmetadata80018" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueWithInvalidName0.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueWithInvalidName0.json new file mode 100644 index 000000000000..e37d99fa4008 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueWithInvalidName0.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/a_b", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidResourceName", + "retry-after" : "0", + "Content-Length" : "243", + "StatusCode" : "400", + "x-ms-request-id" : "14882fb9-6003-00ea-7f88-53cf77000000", + "Body" : "InvalidResourceNameThe specifed resource name contains invalid characters.\nRequestId:14882fb9-6003-00ea-7f88-53cf77000000\nTime:2019-08-15T16:40:50.2152332Z", + "Date" : "Thu, 15 Aug 2019 16:40:49 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueWithInvalidName1.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueWithInvalidName1.json new file mode 100644 index 000000000000..ae1b42f193e9 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueWithInvalidName1.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/-ab", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidResourceName", + "retry-after" : "0", + "Content-Length" : "243", + "StatusCode" : "400", + "x-ms-request-id" : "14882fd5-6003-00ea-1888-53cf77000000", + "Body" : "InvalidResourceNameThe specifed resource name contains invalid characters.\nRequestId:14882fd5-6003-00ea-1888-53cf77000000\nTime:2019-08-15T16:40:50.2873012Z", + "Date" : "Thu, 15 Aug 2019 16:40:49 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueWithInvalidName2.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueWithInvalidName2.json new file mode 100644 index 000000000000..9e2488e28e65 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueWithInvalidName2.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/a--b", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidResourceName", + "retry-after" : "0", + "Content-Length" : "243", + "StatusCode" : "400", + "x-ms-request-id" : "14882fed-6003-00ea-2f88-53cf77000000", + "Body" : "InvalidResourceNameThe specifed resource name contains invalid characters.\nRequestId:14882fed-6003-00ea-2f88-53cf77000000\nTime:2019-08-15T16:40:50.3633721Z", + "Date" : "Thu, 15 Aug 2019 16:40:49 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueWithInvalidName3.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueWithInvalidName3.json new file mode 100644 index 000000000000..8e94c068e5c7 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueWithInvalidName3.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/Abc", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidResourceName", + "retry-after" : "0", + "Content-Length" : "243", + "StatusCode" : "400", + "x-ms-request-id" : "14883007-6003-00ea-4888-53cf77000000", + "Body" : "InvalidResourceNameThe specifed resource name contains invalid characters.\nRequestId:14883007-6003-00ea-4888-53cf77000000\nTime:2019-08-15T16:40:50.4464512Z", + "Date" : "Thu, 15 Aug 2019 16:40:49 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueWithInvalidName4.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueWithInvalidName4.json new file mode 100644 index 000000000000..6fc511f8d939 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueWithInvalidName4.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/ab", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "OutOfRangeInput", + "retry-after" : "0", + "Content-Length" : "256", + "StatusCode" : "400", + "x-ms-request-id" : "1488302b-6003-00ea-6a88-53cf77000000", + "Body" : "OutOfRangeInputThe specified resource name length is not within the permissible limits.\nRequestId:1488302b-6003-00ea-6a88-53cf77000000\nTime:2019-08-15T16:40:50.5385381Z", + "Date" : "Thu, 15 Aug 2019 16:40:49 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueWithInvalidName5.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueWithInvalidName5.json new file mode 100644 index 000000000000..5ecbd0458ed2 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsCreateQueueWithInvalidName5.json @@ -0,0 +1,23 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/verylongverylongverylongverylongverylongverylongverylongverylong", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "OutOfRangeInput", + "retry-after" : "0", + "Content-Length" : "256", + "StatusCode" : "400", + "x-ms-request-id" : "14883049-6003-00ea-0788-53cf77000000", + "Body" : "OutOfRangeInputThe specified resource name length is not within the permissible limits.\nRequestId:14883049-6003-00ea-0788-53cf77000000\nTime:2019-08-15T16:40:50.6326265Z", + "Date" : "Thu, 15 Aug 2019 16:40:49 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsDeleteQueue.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsDeleteQueue.json new file mode 100644 index 000000000000..7a9abf6186ac --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsDeleteQueue.json @@ -0,0 +1,56 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceasyncapitestsdeletequeue62103c4b54ee98", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "b9c9cbb0-2003-0008-0788-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:51 GMT" + } + }, { + "Method" : "DELETE", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceasyncapitestsdeletequeue62103c4b54ee98", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "b9c9cbbb-2003-0008-1188-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:51 GMT" + } + }, { + "Method" : "POST", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceasyncapitestsdeletequeue62103c4b54ee98/messages?visibilitytimeout=0&messagettl=604800", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "QueueNotFound", + "retry-after" : "0", + "Content-Length" : "217", + "StatusCode" : "404", + "x-ms-request-id" : "b9c9cbc3-2003-0008-1888-532b05000000", + "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:b9c9cbc3-2003-0008-1888-532b05000000\nTime:2019-08-15T16:40:51.4946206Z", + "Date" : "Thu, 15 Aug 2019 16:40:51 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ "queueserviceasyncapitestsdeletequeue62103c4b54ee98" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/createWithSASToken.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsDeleteQueueError.json similarity index 68% rename from sdk/storage/azure-storage-queue/src/test/resources/session-records/createWithSASToken.json rename to sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsDeleteQueueError.json index 06af19821b53..a07d9d72098a 100644 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/createWithSASToken.json +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsDeleteQueueError.json @@ -1,10 +1,10 @@ { "networkCallRecords" : [ { "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue95805f24/messages", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/5686b8e172374fd8", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -13,11 +13,11 @@ "retry-after" : "0", "Content-Length" : "217", "StatusCode" : "404", - "x-ms-request-id" : "8071d154-4003-00b9-2803-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:8071d154-4003-00b9-2803-47d378000000\nTime:2019-07-30T18:19:02.4945662Z", - "Date" : "Tue, 30 Jul 2019 18:19:02 GMT", + "x-ms-request-id" : "b9c9cbcf-2003-0008-2388-532b05000000", + "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:b9c9cbcf-2003-0008-2388-532b05000000\nTime:2019-08-15T16:40:51.5867065Z", + "Date" : "Thu, 15 Aug 2019 16:40:51 GMT", "Content-Type" : "application/xml" } } ], - "variables" : [ "queue95805f24" ] + "variables" : [ "5686b8e172374fd8" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsGetAndSetProperties.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsGetAndSetProperties.json new file mode 100644 index 000000000000..47c703d98b5f --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsGetAndSetProperties.json @@ -0,0 +1,59 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?restype=service&comp=properties", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "b9c9ccbc-2003-0008-6b88-532b05000000", + "Body" : "1.0falsetruetruetrue31.0truefalsetrue31.0truefalsetrue3", + "Date" : "Thu, 15 Aug 2019 16:40:52 GMT", + "Content-Type" : "application/xml" + } + }, { + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?restype=service&comp=properties", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "b9c9ccc0-2003-0008-6f88-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:55 GMT" + } + }, { + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?restype=service&comp=properties", + "Headers" : { + "x-ms-version" : "2018-03-28", + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2018-03-28", + "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "b9c9cf1c-2003-0008-7788-532b05000000", + "Body" : "1.0falsetruetruetrue31.0truefalsetrue31.0truefalsetrue3", + "Date" : "Thu, 15 Aug 2019 16:40:56 GMT", + "Content-Type" : "application/xml" + } + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsGetQueueClient.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsGetQueueClient.json new file mode 100644 index 000000000000..a9126688e816 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsGetQueueClient.json @@ -0,0 +1,4 @@ +{ + "networkCallRecords" : [ ], + "variables" : [ "queueserviceasyncapitestsgetqueueclient2398679f4afbe" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsListEmptyQueues.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsListEmptyQueues.json new file mode 100644 index 000000000000..ba5f37f8f855 --- /dev/null +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsListEmptyQueues.json @@ -0,0 +1,4 @@ +{ + "networkCallRecords" : [ ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteExistingQueue.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsListQueues0.json similarity index 57% rename from sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteExistingQueue.json rename to sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsListQueues0.json index d711d370bf2b..2c54e0279c11 100644 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteExistingQueue.json +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsListQueues0.json @@ -1,10 +1,10 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue520260d0", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceasyncapitestslistqueues009680da03558a90", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -12,51 +12,47 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "201", - "x-ms-request-id" : "1cdd8083-e003-0073-6a09-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:01 GMT" + "x-ms-request-id" : "b9c9cbdd-2003-0008-3088-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:51 GMT" } }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue520260d0", + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceasyncapitestslistqueues009680da03558a91", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", "retry-after" : "0", "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd8163-e003-0073-3009-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:02 GMT" + "StatusCode" : "201", + "x-ms-request-id" : "b9c9cbe6-2003-0008-3788-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:51 GMT" } }, { - "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue520260d0/messages?visibilitytimeout=0&messagettl=604800", + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceasyncapitestslistqueues009680da03558a92", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "1cdd8174-e003-0073-4009-4740b5000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:1cdd8174-e003-0073-4009-4740b5000000\nTime:2019-07-30T19:01:03.1630238Z", - "Date" : "Tue, 30 Jul 2019 19:01:02 GMT", - "Content-Type" : "application/xml" + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "b9c9cbf2-2003-0008-3f88-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:51 GMT" } }, { "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queue520260d0&include=&comp=list", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queueserviceasyncapitestslistqueues&include=&comp=list", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "Transfer-Encoding" : "chunked", @@ -65,11 +61,11 @@ "Cache-Control" : "no-cache", "retry-after" : "0", "StatusCode" : "200", - "x-ms-request-id" : "1cdd817e-e003-0073-4809-4740b5000000", - "Body" : "queue520260d0", - "Date" : "Tue, 30 Jul 2019 19:01:02 GMT", + "x-ms-request-id" : "b9c9cbfa-2003-0008-4688-532b05000000", + "Body" : "queueserviceasyncapitestslistqueuesqueueserviceasyncapitestslistqueues009680da03558a90queueserviceasyncapitestslistqueues009680da03558a91queueserviceasyncapitestslistqueues009680da03558a92", + "Date" : "Thu, 15 Aug 2019 16:40:51 GMT", "Content-Type" : "application/xml" } } ], - "variables" : [ "queue520260d0" ] + "variables" : [ "queueserviceasyncapitestslistqueues009680da03558a9" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/createQueue.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsListQueues1.json similarity index 50% rename from sdk/storage/azure-storage-queue/src/test/resources/session-records/createQueue.json rename to sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsListQueues1.json index 6ace1ebfcc3d..e1af0b2334f9 100644 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/createQueue.json +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsListQueues1.json @@ -1,10 +1,10 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue41192d54", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceasyncapitestslistqueues104635a5e67dfac0", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -12,79 +12,79 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "201", - "x-ms-request-id" : "1cdd818b-e003-0073-5309-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:02 GMT" + "x-ms-request-id" : "b9c9cc1f-2003-0008-6888-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:51 GMT" } }, { - "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue41192d54/messages?visibilitytimeout=0&messagettl=604800", + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceasyncapitestslistqueues104635a5e67dfac1", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { - "Transfer-Encoding" : "chunked", "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", "retry-after" : "0", + "Content-Length" : "0", "StatusCode" : "201", - "x-ms-request-id" : "1cdd818f-e003-0073-5609-4740b5000000", - "Body" : "0f84abde-fb8c-4049-b6de-4e353f4af767Tue, 30 Jul 2019 19:01:03 GMTTue, 06 Aug 2019 19:01:03 GMTAgAAAAMAAAAAAAAAnQ1cIglH1QE=Tue, 30 Jul 2019 19:01:03 GMT", - "Date" : "Tue, 30 Jul 2019 19:01:02 GMT", - "Content-Type" : "application/xml" + "x-ms-request-id" : "b9c9cc2b-2003-0008-7188-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:52 GMT" } }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queue41192d54&include=&comp=list", + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceasyncapitestslistqueues104635a5e67dfac2", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { - "Transfer-Encoding" : "chunked", "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "1cdd8195-e003-0073-5b09-4740b5000000", - "Body" : "queue41192d54queue41192d54", - "Date" : "Tue, 30 Jul 2019 19:01:02 GMT", - "Content-Type" : "application/xml" + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "b9c9cc33-2003-0008-7788-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:52 GMT" } }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue41192d54/messages", + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queueserviceasyncapitestslistqueues&maxresults=2&include=&comp=list", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { + "Transfer-Encoding" : "chunked", "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd8199-e003-0073-5f09-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:03 GMT" + "StatusCode" : "200", + "x-ms-request-id" : "b9c9cc4e-2003-0008-0d88-532b05000000", + "Body" : "queueserviceasyncapitestslistqueues2queueserviceasyncapitestslistqueues104635a5e67dfac0queueserviceasyncapitestslistqueues104635a5e67dfac1/azstoragesdkaccount/queueserviceasyncapitestslistqueues104635a5e67dfac2", + "Date" : "Thu, 15 Aug 2019 16:40:52 GMT", + "Content-Type" : "application/xml" } }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue41192d54", + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queueserviceasyncapitestslistqueues&marker=/azstoragesdkaccount/queueserviceasyncapitestslistqueues104635a5e67dfac2&maxresults=2&include=&comp=list", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { + "Transfer-Encoding" : "chunked", "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd81bb-e003-0073-7c09-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:03 GMT" + "StatusCode" : "200", + "x-ms-request-id" : "b9c9cc55-2003-0008-1488-532b05000000", + "Body" : "queueserviceasyncapitestslistqueues/azstoragesdkaccount/queueserviceasyncapitestslistqueues104635a5e67dfac22queueserviceasyncapitestslistqueues104635a5e67dfac2", + "Date" : "Thu, 15 Aug 2019 16:40:52 GMT", + "Content-Type" : "application/xml" } } ], - "variables" : [ "queue41192d54" ] + "variables" : [ "queueserviceasyncapitestslistqueues104635a5e67dfac" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/createQueueWithMetadata.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsListQueues2.json similarity index 51% rename from sdk/storage/azure-storage-queue/src/test/resources/session-records/createQueueWithMetadata.json rename to sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsListQueues2.json index a884a0d89d21..f42927acdd60 100644 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/createQueueWithMetadata.json +++ b/sdk/storage/azure-storage-queue/src/test/resources/session-records/QueueServiceAsyncAPITestsListQueues2.json @@ -1,10 +1,10 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue84974cab", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceasyncapitestslistqueues25858399726d6ba0", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", @@ -12,80 +12,60 @@ "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "201", - "x-ms-request-id" : "1cdd81fa-e003-0073-3209-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:04 GMT" + "x-ms-request-id" : "b9c9cc71-2003-0008-2e88-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:52 GMT" } }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue84974cab?comp=metadata", + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceasyncapitestslistqueues25858399726d6ba1", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", "retry-after" : "0", "Content-Length" : "0", - "x-ms-approximate-messages-count" : "0", - "x-ms-meta-metadata1" : "value1", - "StatusCode" : "200", - "x-ms-request-id" : "1cdd824c-e003-0073-7709-4740b5000000", - "x-ms-meta-metadata2" : "value2", - "Date" : "Tue, 30 Jul 2019 19:01:04 GMT" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queue84974cab&include=&comp=list", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "1cdd8258-e003-0073-0209-4740b5000000", - "Body" : "queue84974cabqueue84974cab", - "Date" : "Tue, 30 Jul 2019 19:01:05 GMT", - "Content-Type" : "application/xml" + "StatusCode" : "201", + "x-ms-request-id" : "b9c9cc77-2003-0008-3188-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:52 GMT" } }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue84974cab/messages", + "Method" : "PUT", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queueserviceasyncapitestslistqueues25858399726d6ba2", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", "retry-after" : "0", "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd8260-e003-0073-0a09-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:05 GMT" + "StatusCode" : "201", + "x-ms-request-id" : "b9c9cc86-2003-0008-3e88-532b05000000", + "Date" : "Thu, 15 Aug 2019 16:40:52 GMT" } }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue84974cab", + "Method" : "GET", + "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queueserviceasyncapitestslistqueues&include=metadata&comp=list", "Headers" : { "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" + "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.3 1.8.0_201; Windows 10 10.0" }, "Response" : { + "Transfer-Encoding" : "chunked", "x-ms-version" : "2018-03-28", "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd8267-e003-0073-1109-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:05 GMT" + "StatusCode" : "200", + "x-ms-request-id" : "b9c9cc8c-2003-0008-4388-532b05000000", + "Body" : "queueserviceasyncapitestslistqueuesqueueserviceasyncapitestslistqueues25858399726d6ba0value0queueserviceasyncapitestslistqueues25858399726d6ba1value1queueserviceasyncapitestslistqueues25858399726d6ba2value2", + "Date" : "Thu, 15 Aug 2019 16:40:52 GMT", + "Content-Type" : "application/xml" } } ], - "variables" : [ "queue84974cab" ] + "variables" : [ "queueserviceasyncapitestslistqueues25858399726d6ba" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/clearMessagesQueueDoesNotExist.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/clearMessagesQueueDoesNotExist.json deleted file mode 100644 index d5ff4fab7281..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/clearMessagesQueueDoesNotExist.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue95540dc6/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "8071dd7c-4003-00b9-4f03-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:8071dd7c-4003-00b9-4f03-47d378000000\nTime:2019-07-30T18:19:06.4682531Z", - "Date" : "Tue, 30 Jul 2019 18:19:06 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue95540dc6/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "8071dd94-4003-00b9-6603-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:8071dd94-4003-00b9-6603-47d378000000\nTime:2019-07-30T18:19:06.4982809Z", - "Date" : "Tue, 30 Jul 2019 18:19:06 GMT", - "Content-Type" : "application/xml" - } - } ], - "variables" : [ "queue95540dc6" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/createQueueTwiceDifferentMetadata.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/createQueueTwiceDifferentMetadata.json deleted file mode 100644 index 104f97276190..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/createQueueTwiceDifferentMetadata.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue88691a05", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "1cdd82fd-e003-0073-1609-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:06 GMT" - } - }, { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue88691a05", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueAlreadyExists", - "retry-after" : "0", - "Content-Length" : "222", - "StatusCode" : "409", - "x-ms-request-id" : "1cdd8301-e003-0073-1909-4740b5000000", - "Body" : "QueueAlreadyExistsThe specified queue already exists.\nRequestId:1cdd8301-e003-0073-1909-4740b5000000\nTime:2019-07-30T19:01:07.1007793Z", - "Date" : "Tue, 30 Jul 2019 19:01:06 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queue88691a05&include=&comp=list", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "1cdd830a-e003-0073-2009-4740b5000000", - "Body" : "queue88691a05queue88691a05", - "Date" : "Tue, 30 Jul 2019 19:01:06 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue88691a05/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd830e-e003-0073-2409-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:06 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue88691a05", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd8317-e003-0073-2d09-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:06 GMT" - } - } ], - "variables" : [ "queue88691a05" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteExisting.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteExisting.json deleted file mode 100644 index 326bd01d83b8..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteExisting.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue11519005", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "8071de75-4003-00b9-4103-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:06 GMT" - } - }, { - "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue11519005/messages?visibilitytimeout=0&messagettl=604800", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "8071dea3-4003-00b9-6e03-47d378000000", - "Body" : "30cc479a-af92-4451-8a41-8413a8f9c095Tue, 30 Jul 2019 18:19:06 GMTTue, 06 Aug 2019 18:19:06 GMTAgAAAAMAAAAAAAAAFWldRgNH1QE=Tue, 30 Jul 2019 18:19:06 GMT", - "Date" : "Tue, 30 Jul 2019 18:19:06 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue11519005", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071debe-4003-00b9-0903-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:06 GMT" - } - }, { - "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue11519005/messages?visibilitytimeout=0&messagettl=604800", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "80724410-4003-00b9-3903-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:80724410-4003-00b9-3903-47d378000000\nTime:2019-07-30T18:19:36.9024744Z", - "Date" : "Tue, 30 Jul 2019 18:19:36 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue11519005/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "80724439-4003-00b9-6003-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:80724439-4003-00b9-6003-47d378000000\nTime:2019-07-30T18:19:36.9335030Z", - "Date" : "Tue, 30 Jul 2019 18:19:36 GMT", - "Content-Type" : "application/xml" - } - } ], - "variables" : [ "queue11519005" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteMessageInvalidMessageId.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteMessageInvalidMessageId.json deleted file mode 100644 index 02698922bb52..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteMessageInvalidMessageId.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue5582925f", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "8071bd76-4003-00b9-5603-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:18:56 GMT" - } - }, { - "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue5582925f/messages?visibilitytimeout=0&messagettl=604800", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "8071bda8-4003-00b9-0603-47d378000000", - "Body" : "6c6a6f5b-e93c-4712-a9e6-9d882ef2725dTue, 30 Jul 2019 18:18:56 GMTTue, 06 Aug 2019 18:18:56 GMTAgAAAAMAAAAAAAAAJ00nQANH1QE=Tue, 30 Jul 2019 18:18:56 GMT", - "Date" : "Tue, 30 Jul 2019 18:18:56 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue5582925f/messages?numofmessages=1&visibilitytimeout=30", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "8071bdd6-4003-00b9-3403-47d378000000", - "Body" : "6c6a6f5b-e93c-4712-a9e6-9d882ef2725dTue, 30 Jul 2019 18:18:56 GMTTue, 06 Aug 2019 18:18:56 GMTAgAAAAMAAAAAAAAAb4EPUgNH1QE=Tue, 30 Jul 2019 18:19:26 GMT1test message", - "Date" : "Tue, 30 Jul 2019 18:18:56 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue5582925f/messages/6c6a6f5b-e93c-4712-a9e6-9d882ef2725drandom?popreceipt=AgAAAAMAAAAAAAAAb4EPUgNH1QE%3d", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "MessageNotFound", - "retry-after" : "0", - "Content-Length" : "221", - "StatusCode" : "404", - "x-ms-request-id" : "8071be01-4003-00b9-5f03-47d378000000", - "Body" : "MessageNotFoundThe specified message does not exist.\nRequestId:8071be01-4003-00b9-5f03-47d378000000\nTime:2019-07-30T18:18:56.4930009Z", - "Date" : "Tue, 30 Jul 2019 18:18:56 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue5582925f/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071be28-4003-00b9-0603-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:18:56 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue5582925f", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071be47-4003-00b9-2403-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:18:56 GMT" - } - } ], - "variables" : [ "queue5582925f" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteMessageInvalidPopReceipt.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteMessageInvalidPopReceipt.json deleted file mode 100644 index 875c4a238ffb..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteMessageInvalidPopReceipt.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue76680d09", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "8071bc63-4003-00b9-4d03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:18:56 GMT" - } - }, { - "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue76680d09/messages?visibilitytimeout=0&messagettl=604800", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "8071bc9c-4003-00b9-0403-47d378000000", - "Body" : "9a59b835-0fa6-4bcb-8094-61e61a4120c2Tue, 30 Jul 2019 18:18:56 GMTTue, 06 Aug 2019 18:18:56 GMTAgAAAAMAAAAAAAAAGXD/PwNH1QE=Tue, 30 Jul 2019 18:18:56 GMT", - "Date" : "Tue, 30 Jul 2019 18:18:56 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue76680d09/messages?numofmessages=1&visibilitytimeout=30", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "8071bcc5-4003-00b9-2b03-47d378000000", - "Body" : "9a59b835-0fa6-4bcb-8094-61e61a4120c2Tue, 30 Jul 2019 18:18:56 GMTTue, 06 Aug 2019 18:18:56 GMTAgAAAAMAAAAAAAAAb6TnUQNH1QE=Tue, 30 Jul 2019 18:19:26 GMT1test message", - "Date" : "Tue, 30 Jul 2019 18:18:56 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue76680d09/messages/9a59b835-0fa6-4bcb-8094-61e61a4120c2?popreceipt=AgAAAAMAAAAAAAAAb6TnUQNH1QE%3drandom", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "InvalidQueryParameterValue", - "retry-after" : "0", - "Content-Length" : "444", - "StatusCode" : "400", - "x-ms-request-id" : "8071bcf4-4003-00b9-5803-47d378000000", - "Body" : "InvalidQueryParameterValueValue for one of the query parameters specified in the request URI is invalid.\nRequestId:8071bcf4-4003-00b9-5803-47d378000000\nTime:2019-07-30T18:18:56.2297573ZpopreceiptAgAAAAMAAAAAAAAAb6TnUQNH1QE=randomInvalid pop receipt format", - "Date" : "Tue, 30 Jul 2019 18:18:56 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue76680d09/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071bd1d-4003-00b9-7e03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:18:56 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue76680d09", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071bd3c-4003-00b9-1c03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:18:56 GMT" - } - } ], - "variables" : [ "queue76680d09" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteMessageQueueDoesNotExist.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteMessageQueueDoesNotExist.json deleted file mode 100644 index 287a17ccf8f1..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteMessageQueueDoesNotExist.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue5543243d/messages/invalid?popreceipt=call", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "80724c3c-4003-00b9-2003-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:80724c3c-4003-00b9-2003-47d378000000\nTime:2019-07-30T18:19:39.3217165Z", - "Date" : "Tue, 30 Jul 2019 18:19:39 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue5543243d/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "80724c62-4003-00b9-4503-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:80724c62-4003-00b9-4503-47d378000000\nTime:2019-07-30T18:19:39.3547455Z", - "Date" : "Tue, 30 Jul 2019 18:19:39 GMT", - "Content-Type" : "application/xml" - } - } ], - "variables" : [ "queue5543243d" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteMetadata.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteMetadata.json deleted file mode 100644 index 705c7722d081..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteMetadata.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue743794d9", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "80724d57-4003-00b9-3403-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:39 GMT" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue743794d9?comp=metadata", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "Content-Length" : "0", - "x-ms-approximate-messages-count" : "0", - "x-ms-meta-metadata1" : "value1", - "StatusCode" : "200", - "x-ms-request-id" : "80724d80-4003-00b9-5a03-47d378000000", - "x-ms-meta-metadata2" : "value2", - "Date" : "Tue, 30 Jul 2019 18:19:39 GMT" - } - }, { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue743794d9?comp=metadata", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "80724d98-4003-00b9-7203-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:39 GMT" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue743794d9?comp=metadata", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "Content-Length" : "0", - "x-ms-approximate-messages-count" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "80724db1-4003-00b9-0b03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:39 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue743794d9/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "80724dd4-4003-00b9-2d03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:39 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue743794d9", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "80724dec-4003-00b9-4503-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:39 GMT" - } - } ], - "variables" : [ "queue743794d9" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteNonExistent.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteNonExistent.json deleted file mode 100644 index 525cc82bc6b9..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteNonExistent.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue784292a2", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "80724806-4003-00b9-0b03-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:80724806-4003-00b9-0b03-47d378000000\nTime:2019-07-30T18:19:38.1306132Z", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue784292a2/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "80724826-4003-00b9-2a03-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:80724826-4003-00b9-2a03-47d378000000\nTime:2019-07-30T18:19:38.1606401Z", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT", - "Content-Type" : "application/xml" - } - } ], - "variables" : [ "queue784292a2" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteNonExistentQueue.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteNonExistentQueue.json deleted file mode 100644 index 2e67336c2204..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/deleteNonExistentQueue.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue5883546e", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "1cdd8355-e003-0073-6209-4740b5000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:1cdd8355-e003-0073-6209-4740b5000000\nTime:2019-07-30T19:01:07.7774261Z", - "Date" : "Tue, 30 Jul 2019 19:01:06 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queue5883546e&include=&comp=list", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "1cdd8359-e003-0073-6609-4740b5000000", - "Body" : "queue5883546e", - "Date" : "Tue, 30 Jul 2019 19:01:06 GMT", - "Content-Type" : "application/xml" - } - } ], - "variables" : [ "queue5883546e" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/dequeueMultipleMessages.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/dequeueMultipleMessages.json deleted file mode 100644 index aacfeda6c1d6..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/dequeueMultipleMessages.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue41164c5f", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "80724a13-4003-00b9-0803-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT" - } - }, { - "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue41164c5f/messages?visibilitytimeout=0&messagettl=604800", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "80724a33-4003-00b9-2703-47d378000000", - "Body" : "be3d48d4-b018-40ad-85a7-d426fb4d785fTue, 30 Jul 2019 18:19:38 GMTTue, 06 Aug 2019 18:19:38 GMTAgAAAAMAAAAAAAAAA2tgWQNH1QE=Tue, 30 Jul 2019 18:19:38 GMT", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue41164c5f/messages?visibilitytimeout=0&messagettl=604800", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "80724a57-4003-00b9-4a03-47d378000000", - "Body" : "f39387d0-8ac4-4739-80a3-a1e1f8d118dfTue, 30 Jul 2019 18:19:38 GMTTue, 06 Aug 2019 18:19:38 GMTAgAAAAMAAAAAAAAANU5lWQNH1QE=Tue, 30 Jul 2019 18:19:38 GMT", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue41164c5f/messages?numofmessages=2&visibilitytimeout=30", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "80724a74-4003-00b9-6603-47d378000000", - "Body" : "be3d48d4-b018-40ad-85a7-d426fb4d785fTue, 30 Jul 2019 18:19:38 GMTTue, 06 Aug 2019 18:19:38 GMTAgAAAAMAAAAAAAAAeftLawNH1QE=Tue, 30 Jul 2019 18:20:08 GMT1test messagef39387d0-8ac4-4739-80a3-a1e1f8d118dfTue, 30 Jul 2019 18:19:38 GMTTue, 06 Aug 2019 18:19:38 GMTAgAAAAMAAAAAAAAAeftLawNH1QE=Tue, 30 Jul 2019 18:20:08 GMT1test message 2", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue41164c5f/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "80724a8f-4003-00b9-7e03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue41164c5f", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "80724aa5-4003-00b9-1403-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT" - } - } ], - "variables" : [ "queue41164c5f" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/dequeueQueueDoesNotExist.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/dequeueQueueDoesNotExist.json deleted file mode 100644 index c92f5ac1b9fb..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/dequeueQueueDoesNotExist.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue03640269/messages?numofmessages=1&visibilitytimeout=30", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "807247b8-4003-00b9-4003-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:807247b8-4003-00b9-4003-47d378000000\nTime:2019-07-30T18:19:38.0495370Z", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue03640269/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "807247d2-4003-00b9-5803-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:807247d2-4003-00b9-5803-47d378000000\nTime:2019-07-30T18:19:38.0825673Z", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT", - "Content-Type" : "application/xml" - } - } ], - "variables" : [ "queue03640269" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/dequeueTooManyMessages.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/dequeueTooManyMessages.json deleted file mode 100644 index c1216be98ccd..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/dequeueTooManyMessages.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue33803725", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "8071cf82-4003-00b9-6203-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:01 GMT" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue33803725/messages?numofmessages=64&visibilitytimeout=30", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "OutOfRangeQueryParameterValue", - "retry-after" : "0", - "Content-Length" : "456", - "StatusCode" : "400", - "x-ms-request-id" : "8071cfa7-4003-00b9-0503-47d378000000", - "Body" : "OutOfRangeQueryParameterValueOne of the query parameters specified in the request URI is outside the permissible range.\nRequestId:8071cfa7-4003-00b9-0503-47d378000000\nTime:2019-07-30T18:19:01.9911001Znumofmessages64132", - "Date" : "Tue, 30 Jul 2019 18:19:01 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue33803725/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071cfc0-4003-00b9-1d03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:01 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue33803725", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071cfe1-4003-00b9-3d03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:02 GMT" - } - } ], - "variables" : [ "queue33803725" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/enqueueEmptyMessage.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/enqueueEmptyMessage.json deleted file mode 100644 index 015e74ada642..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/enqueueEmptyMessage.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue85000300", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "80724adb-4003-00b9-4903-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT" - } - }, { - "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue85000300/messages?visibilitytimeout=0&messagettl=604800", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "80724b04-4003-00b9-7103-47d378000000", - "Body" : "f1339f74-d98e-4e9c-bfb7-b53cda993323Tue, 30 Jul 2019 18:19:38 GMTTue, 06 Aug 2019 18:19:38 GMTAgAAAAMAAAAAAAAApySGWQNH1QE=Tue, 30 Jul 2019 18:19:38 GMT", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue85000300/messages?peekonly=true", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "80724b26-4003-00b9-1303-47d378000000", - "Body" : "f1339f74-d98e-4e9c-bfb7-b53cda993323Tue, 30 Jul 2019 18:19:38 GMTTue, 06 Aug 2019 18:19:38 GMT0", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue85000300/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "80724b3f-4003-00b9-2c03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue85000300", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "80724b51-4003-00b9-3e03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT" - } - } ], - "variables" : [ "queue85000300" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/enqueueMessage.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/enqueueMessage.json deleted file mode 100644 index 4be6f36d26c0..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/enqueueMessage.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue857326bc", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "8071d362-4003-00b9-1a03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:03 GMT" - } - }, { - "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue857326bc/messages?visibilitytimeout=0&messagettl=604800", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "8071d37c-4003-00b9-3203-47d378000000", - "Body" : "f39a6db5-cb4a-4f70-be21-c72803c0253eTue, 30 Jul 2019 18:19:03 GMTTue, 06 Aug 2019 18:19:03 GMTAgAAAAMAAAAAAAAAV6QtRANH1QE=Tue, 30 Jul 2019 18:19:03 GMT", - "Date" : "Tue, 30 Jul 2019 18:19:03 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue857326bc/messages?peekonly=true", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "8071d393-4003-00b9-4903-47d378000000", - "Body" : "f39a6db5-cb4a-4f70-be21-c72803c0253eTue, 30 Jul 2019 18:19:03 GMTTue, 06 Aug 2019 18:19:03 GMT0test message", - "Date" : "Tue, 30 Jul 2019 18:19:03 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue857326bc/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071d3a6-4003-00b9-5c03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:03 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue857326bc", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071d3b4-4003-00b9-6a03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:03 GMT" - } - } ], - "variables" : [ "queue857326bc" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/enqueueQueueDoesNotExist.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/enqueueQueueDoesNotExist.json deleted file mode 100644 index 9859c91ffdb1..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/enqueueQueueDoesNotExist.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue50657bc8/messages?visibilitytimeout=0&messagettl=604800", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "8071d2c1-4003-00b9-8003-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:8071d2c1-4003-00b9-8003-47d378000000\nTime:2019-07-30T18:19:02.9379772Z", - "Date" : "Tue, 30 Jul 2019 18:19:02 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue50657bc8/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "8071d2ea-4003-00b9-2703-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:8071d2ea-4003-00b9-2703-47d378000000\nTime:2019-07-30T18:19:02.9770131Z", - "Date" : "Tue, 30 Jul 2019 18:19:02 GMT", - "Content-Type" : "application/xml" - } - } ], - "variables" : [ "queue50657bc8" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/enqueueShortTimeToLiveMessage.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/enqueueShortTimeToLiveMessage.json deleted file mode 100644 index 5c546664731c..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/enqueueShortTimeToLiveMessage.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue4952015f", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "8071be6d-4003-00b9-4a03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:18:56 GMT" - } - }, { - "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue4952015f/messages?visibilitytimeout=0&messagettl=2", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "8071be9d-4003-00b9-7603-47d378000000", - "Body" : "f2a72af5-11f7-4174-9bca-0c6bbc7a1a4fTue, 30 Jul 2019 18:18:56 GMTTue, 30 Jul 2019 18:18:58 GMTAgAAAAMAAAAAAAAAl7hMQANH1QE=Tue, 30 Jul 2019 18:18:56 GMT", - "Date" : "Tue, 30 Jul 2019 18:18:56 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue4952015f/messages?peekonly=true", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "8071cea8-4003-00b9-0e03-47d378000000", - "Body" : "", - "Date" : "Tue, 30 Jul 2019 18:19:01 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue4952015f/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071cec0-4003-00b9-2603-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:01 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue4952015f", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071cee0-4003-00b9-4603-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:01 GMT" - } - } ], - "variables" : [ "queue4952015f" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/getAccessPolicyQueueDoesNotExist.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/getAccessPolicyQueueDoesNotExist.json deleted file mode 100644 index f51ee48724c7..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/getAccessPolicyQueueDoesNotExist.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue066060ee?comp=acl", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "8072468c-4003-00b9-2603-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:8072468c-4003-00b9-2603-47d378000000\nTime:2019-07-30T18:19:37.6481654Z", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue066060ee/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "807246a7-4003-00b9-3f03-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:807246a7-4003-00b9-3f03-47d378000000\nTime:2019-07-30T18:19:37.6781928Z", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT", - "Content-Type" : "application/xml" - } - } ], - "variables" : [ "queue066060ee" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/getPropertiesQueueDoesNotExist.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/getPropertiesQueueDoesNotExist.json deleted file mode 100644 index c81fadfa36f6..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/getPropertiesQueueDoesNotExist.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue89138457?comp=metadata", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "8071cf1e-4003-00b9-0203-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:8071cf1e-4003-00b9-0203-47d378000000\nTime:2019-07-30T18:19:01.8439650Z", - "Date" : "Tue, 30 Jul 2019 18:19:01 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue89138457/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "8071cf3f-4003-00b9-2103-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:8071cf3f-4003-00b9-2103-47d378000000\nTime:2019-07-30T18:19:01.8769939Z", - "Date" : "Tue, 30 Jul 2019 18:19:01 GMT", - "Content-Type" : "application/xml" - } - } ], - "variables" : [ "queue89138457" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/getQueueDoesNotCreateAQueue.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/getQueueDoesNotCreateAQueue.json deleted file mode 100644 index 0f91979ead55..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/getQueueDoesNotCreateAQueue.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue881089d3/messages?visibilitytimeout=0&messagettl=604800", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "1cdd82f3-e003-0073-0f09-4740b5000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:1cdd82f3-e003-0073-0f09-4740b5000000\nTime:2019-07-30T19:01:06.9836664Z", - "Date" : "Tue, 30 Jul 2019 19:01:06 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queue881089d3&include=&comp=list", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "1cdd82f9-e003-0073-1409-4740b5000000", - "Body" : "queue881089d3", - "Date" : "Tue, 30 Jul 2019 19:01:06 GMT", - "Content-Type" : "application/xml" - } - } ], - "variables" : [ "queue881089d3" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/listQueuesIncludeMetadata.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/listQueuesIncludeMetadata.json deleted file mode 100644 index a3a8affdfea0..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/listQueuesIncludeMetadata.json +++ /dev/null @@ -1,186 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue3555933b0", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "1cdd8362-e003-0073-6e09-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:07 GMT" - } - }, { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue3555933b1", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "1cdd8373-e003-0073-7b09-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:07 GMT" - } - }, { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue3555933b2", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "1cdd8378-e003-0073-7f09-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:07 GMT" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queue3555933b&include=metadata&comp=list", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "1cdd837b-e003-0073-0109-4740b5000000", - "Body" : "queue3555933bqueue3555933b0value1value2queue3555933b1queue3555933b2value1value2", - "Date" : "Tue, 30 Jul 2019 19:01:07 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queue3555933b&include=&comp=list", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "1cdd8382-e003-0073-0409-4740b5000000", - "Body" : "queue3555933bqueue3555933b0queue3555933b1queue3555933b2", - "Date" : "Tue, 30 Jul 2019 19:01:07 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue3555933b0/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd838a-e003-0073-0a09-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:07 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue3555933b0", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd838d-e003-0073-0d09-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:07 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue3555933b1/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd8395-e003-0073-1409-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:07 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue3555933b1", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd839b-e003-0073-1909-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:07 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue3555933b2/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd83a1-e003-0073-1f09-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:07 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue3555933b2", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd83a4-e003-0073-2209-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:07 GMT" - } - } ], - "variables" : [ "queue3555933b" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/listQueuesWithLimit.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/listQueuesWithLimit.json deleted file mode 100644 index fc87bcea2c77..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/listQueuesWithLimit.json +++ /dev/null @@ -1,205 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue20354e780", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "4ab9e4e1-4003-00df-40f2-4b6122000000", - "Date" : "Tue, 06 Aug 2019 00:59:14 GMT" - } - }, { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue20354e781", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "4ab9e592-4003-00df-55f2-4b6122000000", - "Date" : "Tue, 06 Aug 2019 00:59:14 GMT" - } - }, { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue20354e782", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "4ab9e59c-4003-00df-5df2-4b6122000000", - "Date" : "Tue, 06 Aug 2019 00:59:14 GMT" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queue20354e78&maxresults=2&include=&comp=list", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "4ab9e5a9-4003-00df-66f2-4b6122000000", - "Body" : "queue20354e782queue20354e780queue20354e781/azstoragesdkaccount/queue20354e782", - "Date" : "Tue, 06 Aug 2019 00:59:14 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queue20354e78&marker=/azstoragesdkaccount/queue20354e782&maxresults=2&include=&comp=list", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "4ab9e5b3-4003-00df-6ff2-4b6122000000", - "Body" : "queue20354e78/azstoragesdkaccount/queue20354e7822queue20354e782", - "Date" : "Tue, 06 Aug 2019 00:59:14 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queue20354e78&include=&comp=list", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "4ab9e5b5-4003-00df-71f2-4b6122000000", - "Body" : "queue20354e78queue20354e780queue20354e781queue20354e782", - "Date" : "Tue, 06 Aug 2019 00:59:14 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue20354e780/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "4ab9e5bb-4003-00df-76f2-4b6122000000", - "Date" : "Tue, 06 Aug 2019 00:59:14 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue20354e780", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "4ab9e5bd-4003-00df-78f2-4b6122000000", - "Date" : "Tue, 06 Aug 2019 00:59:15 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue20354e781/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "4ab9e5d7-4003-00df-0df2-4b6122000000", - "Date" : "Tue, 06 Aug 2019 00:59:15 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue20354e781", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "4ab9e5d9-4003-00df-0ff2-4b6122000000", - "Date" : "Tue, 06 Aug 2019 00:59:15 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue20354e782/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "4ab9e5df-4003-00df-13f2-4b6122000000", - "Date" : "Tue, 06 Aug 2019 00:59:15 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue20354e782", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "4ab9e5e4-4003-00df-17f2-4b6122000000", - "Date" : "Tue, 06 Aug 2019 00:59:15 GMT" - } - } ], - "variables" : [ "queue20354e78" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/listQueuesWithPrefix.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/listQueuesWithPrefix.json deleted file mode 100644 index 25ab0025e774..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/listQueuesWithPrefix.json +++ /dev/null @@ -1,186 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue360442b5prefix0", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "1cdd8322-e003-0073-3709-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:06 GMT" - } - }, { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue360442b51", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "1cdd8329-e003-0073-3c09-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:06 GMT" - } - }, { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue360442b5prefix2", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "1cdd8330-e003-0073-4109-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:06 GMT" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queue360442b5prefix&include=&comp=list", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "1cdd8334-e003-0073-4409-4740b5000000", - "Body" : "queue360442b5prefixqueue360442b5prefix0queue360442b5prefix2", - "Date" : "Tue, 30 Jul 2019 19:01:06 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queue360442b5&include=&comp=list", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "1cdd8337-e003-0073-4709-4740b5000000", - "Body" : "queue360442b5queue360442b51queue360442b5prefix0queue360442b5prefix2", - "Date" : "Tue, 30 Jul 2019 19:01:06 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue360442b51/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd8339-e003-0073-4909-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:06 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue360442b51", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd833c-e003-0073-4c09-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:06 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue360442b5prefix0/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd833f-e003-0073-4e09-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:06 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue360442b5prefix0", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd8343-e003-0073-5209-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:06 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue360442b5prefix2/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd8345-e003-0073-5409-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:06 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue360442b5prefix2", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1cdd8349-e003-0073-5709-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:06 GMT" - } - } ], - "variables" : [ "queue360442b5" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/peekMessage.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/peekMessage.json deleted file mode 100644 index dd793491431d..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/peekMessage.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue9289930b", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "80724592-4003-00b9-3103-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT" - } - }, { - "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue9289930b/messages?visibilitytimeout=0&messagettl=604800", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "807245b2-4003-00b9-5003-47d378000000", - "Body" : "4af8da31-fef8-48bb-9c58-e31cb39648bcTue, 30 Jul 2019 18:19:37 GMTTue, 06 Aug 2019 18:19:37 GMTAgAAAAMAAAAAAAAAY9qQWANH1QE=Tue, 30 Jul 2019 18:19:37 GMT", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue9289930b/messages?peekonly=true", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "807245d1-4003-00b9-6f03-47d378000000", - "Body" : "4af8da31-fef8-48bb-9c58-e31cb39648bcTue, 30 Jul 2019 18:19:37 GMTTue, 06 Aug 2019 18:19:37 GMT0test message", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue9289930b/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "807245e5-4003-00b9-0303-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue9289930b", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "807245f8-4003-00b9-1603-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT" - } - } ], - "variables" : [ "queue9289930b" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/peekMultipleMessages.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/peekMultipleMessages.json deleted file mode 100644 index ec67bb0d5044..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/peekMultipleMessages.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue17331e05", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "8071d3de-4003-00b9-1203-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:03 GMT" - } - }, { - "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue17331e05/messages?visibilitytimeout=0&messagettl=604800", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "8071d3fe-4003-00b9-3103-47d378000000", - "Body" : "eb154178-fd28-4e7d-9bb4-502bd3aa9472Tue, 30 Jul 2019 18:19:03 GMTTue, 06 Aug 2019 18:19:03 GMTAgAAAAMAAAAAAAAAZNBKRANH1QE=Tue, 30 Jul 2019 18:19:03 GMT", - "Date" : "Tue, 30 Jul 2019 18:19:03 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue17331e05/messages?visibilitytimeout=0&messagettl=604800", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "8071d435-4003-00b9-6503-47d378000000", - "Body" : "c2697011-4b18-4aae-b894-92e681fe9af3Tue, 30 Jul 2019 18:19:03 GMTTue, 06 Aug 2019 18:19:03 GMTAgAAAAMAAAAAAAAAEZNWRANH1QE=Tue, 30 Jul 2019 18:19:03 GMT", - "Date" : "Tue, 30 Jul 2019 18:19:03 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue17331e05/messages?numofmessages=2&peekonly=true", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "8071d45c-4003-00b9-0b03-47d378000000", - "Body" : "eb154178-fd28-4e7d-9bb4-502bd3aa9472Tue, 30 Jul 2019 18:19:03 GMTTue, 06 Aug 2019 18:19:03 GMT0test messagec2697011-4b18-4aae-b894-92e681fe9af3Tue, 30 Jul 2019 18:19:03 GMTTue, 06 Aug 2019 18:19:03 GMT0test message 2", - "Date" : "Tue, 30 Jul 2019 18:19:03 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue17331e05/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071d478-4003-00b9-2703-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:03 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue17331e05", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071d495-4003-00b9-4303-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:03 GMT" - } - } ], - "variables" : [ "queue17331e05" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/peekQueueDoesNotExist.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/peekQueueDoesNotExist.json deleted file mode 100644 index 5efe773a0a36..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/peekQueueDoesNotExist.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue163539f6/messages?peekonly=true", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "8071bbf5-4003-00b9-6403-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:8071bbf5-4003-00b9-6403-47d378000000\nTime:2019-07-30T18:18:55.9785249Z", - "Date" : "Tue, 30 Jul 2019 18:18:55 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue163539f6/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "8071bc16-4003-00b9-0303-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:8071bc16-4003-00b9-0303-47d378000000\nTime:2019-07-30T18:18:56.0175608Z", - "Date" : "Tue, 30 Jul 2019 18:18:55 GMT", - "Content-Type" : "application/xml" - } - } ], - "variables" : [ "queue163539f6" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/peekTooManyMessages.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/peekTooManyMessages.json deleted file mode 100644 index 0e21d3f3e056..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/peekTooManyMessages.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue007623b2", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "80724850-4003-00b9-5203-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue007623b2/messages?numofmessages=64&peekonly=true", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "OutOfRangeQueryParameterValue", - "retry-after" : "0", - "Content-Length" : "456", - "StatusCode" : "400", - "x-ms-request-id" : "8072486a-4003-00b9-6b03-47d378000000", - "Body" : "OutOfRangeQueryParameterValueOne of the query parameters specified in the request URI is outside the permissible range.\nRequestId:8072486a-4003-00b9-6b03-47d378000000\nTime:2019-07-30T18:19:38.2327064Znumofmessages64132", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue007623b2/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "80724884-4003-00b9-0503-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue007623b2", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "807248a6-4003-00b9-2603-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:38 GMT" - } - } ], - "variables" : [ "queue007623b2" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/setInvalidAccessPolicy.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/setInvalidAccessPolicy.json deleted file mode 100644 index c053664720a1..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/setInvalidAccessPolicy.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue598515b0", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "80724b93-4003-00b9-7c03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:39 GMT" - } - }, { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue598515b0?comp=acl", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "InvalidXmlDocument", - "retry-after" : "0", - "Content-Length" : "371", - "StatusCode" : "400", - "x-ms-request-id" : "80724bb2-4003-00b9-1a03-47d378000000", - "Body" : "InvalidXmlDocumentXML specified is not syntactically valid.\nRequestId:80724bb2-4003-00b9-1a03-47d378000000\nTime:2019-07-30T18:19:39.1915951Z1304Signed identifier ID cannot be empty or over 64 characters in length", - "Date" : "Tue, 30 Jul 2019 18:19:39 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue598515b0/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "80724bde-4003-00b9-4503-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:39 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue598515b0", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "80724bf9-4003-00b9-6003-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:39 GMT" - } - } ], - "variables" : [ "queue598515b0" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/setInvalidMetadata.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/setInvalidMetadata.json deleted file mode 100644 index 5e4a36f56436..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/setInvalidMetadata.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue04921afb", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "8071d01e-4003-00b9-7903-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:02 GMT" - } - }, { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue04921afb?comp=metadata", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "EmptyMetadataKey", - "retry-after" : "0", - "Content-Length" : "285", - "StatusCode" : "400", - "x-ms-request-id" : "8071d048-4003-00b9-2003-47d378000000", - "Body" : "EmptyMetadataKeyThe key for one of the metadata key-value pairs is empty.\nRequestId:8071d048-4003-00b9-2003-47d378000000\nTime:2019-07-30T18:19:02.1712670Zbad metadata", - "Date" : "Tue, 30 Jul 2019 18:19:02 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue04921afb/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071d05e-4003-00b9-3603-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:02 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue04921afb", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071d078-4003-00b9-5003-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:02 GMT" - } - } ], - "variables" : [ "queue04921afb" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/setMetadata.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/setMetadata.json deleted file mode 100644 index 4f5b33d48612..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/setMetadata.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue228395ba", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "80724c9b-4003-00b9-7c03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:39 GMT" - } - }, { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue228395ba?comp=metadata", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "80724cc8-4003-00b9-2803-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:39 GMT" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue228395ba?comp=metadata", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "Content-Length" : "0", - "x-ms-approximate-messages-count" : "0", - "x-ms-meta-metadata1" : "value1", - "StatusCode" : "200", - "x-ms-request-id" : "80724ce7-4003-00b9-4503-47d378000000", - "x-ms-meta-metadata2" : "value2", - "Date" : "Tue, 30 Jul 2019 18:19:39 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue228395ba/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "80724d0c-4003-00b9-6903-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:39 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue228395ba", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "80724d24-4003-00b9-0103-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:39 GMT" - } - } ], - "variables" : [ "queue228395ba" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/setMetadataQueueDoesNotExist.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/setMetadataQueueDoesNotExist.json deleted file mode 100644 index 2403d75b3cd8..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/setMetadataQueueDoesNotExist.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue1023979b?comp=metadata", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "80724760-4003-00b9-7003-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:80724760-4003-00b9-7003-47d378000000\nTime:2019-07-30T18:19:37.9564505Z", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue1023979b/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "8072477f-4003-00b9-0d03-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:8072477f-4003-00b9-0d03-47d378000000\nTime:2019-07-30T18:19:37.9904825Z", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT", - "Content-Type" : "application/xml" - } - } ], - "variables" : [ "queue1023979b" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/setProperties.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/setProperties.json deleted file mode 100644 index 6788bd49edd8..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/setProperties.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?restype=service&comp=properties", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "1cdd81c0-e003-0073-8009-4740b5000000", - "Body" : "1.0falsefalsefalsefalse1.0truetruetrue71.0falsefalse", - "Date" : "Tue, 30 Jul 2019 19:01:03 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?restype=service&comp=properties", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "202", - "x-ms-request-id" : "1cdd81d5-e003-0073-1309-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:03 GMT" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?restype=service&comp=properties", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "1cdd81e5-e003-0073-1d09-4740b5000000", - "Body" : "1.0falsetruetruetrue31.0truefalsetrue31.0truefalsetrue3", - "Date" : "Tue, 30 Jul 2019 19:01:03 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?restype=service&comp=properties", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "202", - "x-ms-request-id" : "1cdd81eb-e003-0073-2309-4740b5000000", - "Date" : "Tue, 30 Jul 2019 19:01:03 GMT" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?restype=service&comp=properties", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "1cdd81ed-e003-0073-2509-4740b5000000", - "Body" : "1.0falsefalsefalsefalse1.0truetruetrue71.0falsefalse", - "Date" : "Tue, 30 Jul 2019 19:01:03 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net?prefix=queue30084080&include=&comp=list", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "1cdd81f3-e003-0073-2b09-4740b5000000", - "Body" : "queue30084080", - "Date" : "Tue, 30 Jul 2019 19:01:03 GMT", - "Content-Type" : "application/xml" - } - } ], - "variables" : [ "queue30084080" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/setTooManyAccessPolicies.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/setTooManyAccessPolicies.json deleted file mode 100644 index 52ffab91ef1e..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/setTooManyAccessPolicies.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue02682f2a", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "80724626-4003-00b9-4103-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT" - } - }, { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue02682f2a?comp=acl", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "InvalidXmlDocument", - "retry-after" : "0", - "Content-Length" : "294", - "StatusCode" : "400", - "x-ms-request-id" : "80724645-4003-00b9-5f03-47d378000000", - "Body" : "InvalidXmlDocumentXML specified is not syntactically valid.\nRequestId:80724645-4003-00b9-5f03-47d378000000\nTime:2019-07-30T18:19:37.5430678Z00", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue02682f2a/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8072465c-4003-00b9-7603-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue02682f2a", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "80724670-4003-00b9-0a03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:37 GMT" - } - } ], - "variables" : [ "queue02682f2a" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/updateMessageInvalidMessageId.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/updateMessageInvalidMessageId.json deleted file mode 100644 index 849ea36b90c2..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/updateMessageInvalidMessageId.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue70821c12", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "8071dc01-4003-00b9-6903-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:06 GMT" - } - }, { - "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue70821c12/messages?visibilitytimeout=0&messagettl=604800", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "8071dc22-4003-00b9-0703-47d378000000", - "Body" : "2d1bf643-019d-41da-8a3e-635dba5df867Tue, 30 Jul 2019 18:19:06 GMTTue, 06 Aug 2019 18:19:06 GMTAgAAAAMAAAAAAAAAtDTwRQNH1QE=Tue, 30 Jul 2019 18:19:06 GMT", - "Date" : "Tue, 30 Jul 2019 18:19:06 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue70821c12/messages?numofmessages=1&visibilitytimeout=30", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "8071dc41-4003-00b9-2503-47d378000000", - "Body" : "2d1bf643-019d-41da-8a3e-635dba5df867Tue, 30 Jul 2019 18:19:06 GMTTue, 06 Aug 2019 18:19:06 GMTAgAAAAMAAAAAAAAA6kHYVwNH1QE=Tue, 30 Jul 2019 18:19:36 GMT1test message", - "Date" : "Tue, 30 Jul 2019 18:19:06 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue70821c12/messages/2d1bf643-019d-41da-8a3e-635dba5df867random?popreceipt=AgAAAAMAAAAAAAAA6kHYVwNH1QE%3d&visibilitytimeout=1", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "MessageNotFound", - "retry-after" : "0", - "Content-Length" : "221", - "StatusCode" : "404", - "x-ms-request-id" : "8071dc6d-4003-00b9-5003-47d378000000", - "Body" : "MessageNotFoundThe specified message does not exist.\nRequestId:8071dc6d-4003-00b9-5003-47d378000000\nTime:2019-07-30T18:19:06.1889942Z", - "Date" : "Tue, 30 Jul 2019 18:19:06 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue70821c12/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071dc88-4003-00b9-6b03-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:06 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue70821c12", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071dca6-4003-00b9-0803-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:06 GMT" - } - } ], - "variables" : [ "queue70821c12" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/updateMessageInvalidPopReceipt.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/updateMessageInvalidPopReceipt.json deleted file mode 100644 index 960abdc79ba2..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/updateMessageInvalidPopReceipt.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue12446d02", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "8071ddb6-4003-00b9-0603-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:06 GMT" - } - }, { - "Method" : "POST", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue12446d02/messages?visibilitytimeout=0&messagettl=604800", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "StatusCode" : "201", - "x-ms-request-id" : "8071dddf-4003-00b9-2d03-47d378000000", - "Body" : "af0f96cb-a19e-4f9a-b1ba-08e6c27944dbTue, 30 Jul 2019 18:19:06 GMTTue, 06 Aug 2019 18:19:06 GMTAgAAAAMAAAAAAAAAzks4RgNH1QE=Tue, 30 Jul 2019 18:19:06 GMT", - "Date" : "Tue, 30 Jul 2019 18:19:06 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "GET", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue12446d02/messages?numofmessages=1&visibilitytimeout=30", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "8071ddf9-4003-00b9-4703-47d378000000", - "Body" : "af0f96cb-a19e-4f9a-b1ba-08e6c27944dbTue, 30 Jul 2019 18:19:06 GMTTue, 06 Aug 2019 18:19:06 GMTAgAAAAMAAAAAAAAA5KoeWANH1QE=Tue, 30 Jul 2019 18:19:36 GMT1test message", - "Date" : "Tue, 30 Jul 2019 18:19:06 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue12446d02/messages/af0f96cb-a19e-4f9a-b1ba-08e6c27944db?popreceipt=AgAAAAMAAAAAAAAA5KoeWANH1QE%3drandom&visibilitytimeout=1", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "InvalidQueryParameterValue", - "retry-after" : "0", - "Content-Length" : "444", - "StatusCode" : "400", - "x-ms-request-id" : "8071de13-4003-00b9-6103-47d378000000", - "Body" : "InvalidQueryParameterValueValue for one of the query parameters specified in the request URI is invalid.\nRequestId:8071de13-4003-00b9-6103-47d378000000\nTime:2019-07-30T18:19:06.6474193ZpopreceiptAgAAAAMAAAAAAAAA5KoeWANH1QE=randomInvalid pop receipt format", - "Date" : "Tue, 30 Jul 2019 18:19:06 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue12446d02/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071de2b-4003-00b9-7803-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:06 GMT" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue12446d02", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "8071de43-4003-00b9-1003-47d378000000", - "Date" : "Tue, 30 Jul 2019 18:19:06 GMT" - } - } ], - "variables" : [ "queue12446d02" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/src/test/resources/session-records/updateMessageQueueDoesNotExist.json b/sdk/storage/azure-storage-queue/src/test/resources/session-records/updateMessageQueueDoesNotExist.json deleted file mode 100644 index b87cef21fed8..000000000000 --- a/sdk/storage/azure-storage-queue/src/test/resources/session-records/updateMessageQueueDoesNotExist.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PUT", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue960895d5/messages/doesn't?popreceipt=exist&visibilitytimeout=5", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0", - "Content-Type" : "application/xml; charset=utf-8" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "InvalidQueryParameterValue", - "retry-after" : "0", - "Content-Length" : "415", - "StatusCode" : "400", - "x-ms-request-id" : "8071d32f-4003-00b9-6803-47d378000000", - "Body" : "InvalidQueryParameterValueValue for one of the query parameters specified in the request URI is invalid.\nRequestId:8071d32f-4003-00b9-6803-47d378000000\nTime:2019-07-30T18:19:03.0460773ZpopreceiptexistInvalid pop receipt format", - "Date" : "Tue, 30 Jul 2019 18:19:02 GMT", - "Content-Type" : "application/xml" - } - }, { - "Method" : "DELETE", - "Uri" : "https://azstoragesdkaccount.queue.core.windows.net/queue960895d5/messages", - "Headers" : { - "x-ms-version" : "2018-03-28", - "User-Agent" : "azsdk-java-azure-storage-queue/12.0.0-preview.2 1.8.0_201; Windows 10 10.0" - }, - "Response" : { - "x-ms-version" : "2018-03-28", - "Server" : "Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-error-code" : "QueueNotFound", - "retry-after" : "0", - "Content-Length" : "217", - "StatusCode" : "404", - "x-ms-request-id" : "8071d341-4003-00b9-7a03-47d378000000", - "Body" : "QueueNotFoundThe specified queue does not exist.\nRequestId:8071d341-4003-00b9-7a03-47d378000000\nTime:2019-07-30T18:19:03.0771058Z", - "Date" : "Tue, 30 Jul 2019 18:19:03 GMT", - "Content-Type" : "application/xml" - } - } ], - "variables" : [ "queue960895d5" ] -} \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/swagger/README.md b/sdk/storage/azure-storage-queue/swagger/README.md new file mode 100644 index 000000000000..c3d45d9acacc --- /dev/null +++ b/sdk/storage/azure-storage-queue/swagger/README.md @@ -0,0 +1,175 @@ +# Azure Queue Storage for Java + +> see https://aka.ms/autorest + +### Setup +```ps +cd C:\work +git clone --recursive https://github.com/Azure/autorest.java/ +cd autorest.java +git checkout v3 +npm install +cd .. +git clone --recursive https://github.com/jianghaolu/autorest.modeler/ +cd autorest.modeler +git checkout headerprefixfix +npm install +``` + +### Generation +```ps +cd +autorest --use=C:/work/autorest.java --use=C:/work/autorest.modeler --version=2.0.4280 +``` + +### Code generation settings +``` yaml +input-file: ./queue-2018-03-28.json +java: true +output-folder: ../ +namespace: com.azure.storage.queue +enable-xml: true +generate-client-interfaces: false +sync-methods: none +license-header: MICROSOFT_MIT_SMALL +add-context-parameter: true +``` + +### /{queueName} +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{queueName}"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("QueueName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/QueueName"); + $.put.parameters.splice(0, 0, { "$ref": path }); + $.delete.parameters.splice(0, 0, { "$ref": path }); + } +``` + +### /{queueName}?comp=metadata +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{queueName}?comp=metadata"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("QueueName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/QueueName"); + $.put.parameters.splice(0, 0, { "$ref": path }); + $.get.parameters.splice(0, 0, { "$ref": path }); + } +``` + +### /{queueName}?comp=acl +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{queueName}?comp=acl"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("QueueName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/QueueName"); + $.put.parameters.splice(0, 0, { "$ref": path }); + $.get.parameters.splice(0, 0, { "$ref": path }); + } +``` + +### /{queueName}/messages +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{queueName}/messages"] + transform: > + let param = $.get.parameters[0]; + if (!param["$ref"].endsWith("QueueName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/QueueName"); + $.get.parameters.splice(0, 0, { "$ref": path }); + $.delete.parameters.splice(0, 0, { "$ref": path }); + } +``` + +### /{queueName}/messages?visibilitytimeout={visibilityTimeout}&messagettl={messageTimeToLive} +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{queueName}/messages?visibilitytimeout={visibilityTimeout}&messagettl={messageTimeToLive}"] + transform: > + let param = $.post.parameters[0]; + if (!param["$ref"].endsWith("QueueName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/QueueName"); + $.post.parameters.splice(0, 0, { "$ref": path }); + } +``` + +### /{queueName}/messages?peekonly=true +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{queueName}/messages?peekonly=true"] + transform: > + let param = $.get.parameters[0]; + if (!param["$ref"].endsWith("QueueName")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/QueueName"); + $.get.parameters.splice(0, 0, { "$ref": path }); + } +``` + +### /{queueName}/messages/{messageid}?popreceipt={popReceipt}&visibilitytimeout={visibilityTimeout} +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{queueName}/messages/{messageid}?popreceipt={popReceipt}&visibilitytimeout={visibilityTimeout}"] + transform: > + let param = $.put.parameters[0]; + if (!param["$ref"].endsWith("QueueName")) { + const queueNamePath = param["$ref"].replace(/[#].*$/, "#/parameters/QueueName"); + const messageIdPath = param["$ref"].replace(/[#].*$/, "#/parameters/MessageId"); + $.put.parameters.splice(0, 0, { "$ref": queueNamePath }); + $.put.parameters.splice(1, 0, { "$ref": messageIdPath }); + } +``` + +### /{queueName}/messages/{messageid}?popreceipt={popReceipt} +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{queueName}/messages/{messageid}?popreceipt={popReceipt}"] + transform: > + let param = $.delete.parameters[0]; + if (!param["$ref"].endsWith("QueueName")) { + const queueNamePath = param["$ref"].replace(/[#].*$/, "#/parameters/QueueName"); + const messageIdPath = param["$ref"].replace(/[#].*$/, "#/parameters/MessageId"); + $.delete.parameters.splice(0, 0, { "$ref": queueNamePath }); + $.delete.parameters.splice(1, 0, { "$ref": messageIdPath }); + } +``` + +### Rename MessageItems +``` yaml +directive: +- from: swagger-document + where: $.definitions + transform: > + if (!$.DequeuedMessage) { + $.DequeuedMessage = $.DequeuedMessageItem; + delete $.DequeuedMessageItem; + $.DequeuedMessagesList.items.$ref = $.DequeuedMessagesList.items.$ref.replace("DequeuedMessageItem", "DequeuedMessage"); + } + if (!$.PeekedMessage) { + $.PeekedMessage = $.PeekedMessageItem; + delete $.PeekedMessageItem; + $.PeekedMessagesList.items.$ref = $.PeekedMessagesList.items.$ref.replace("PeekedMessageItem", "PeekedMessage"); + } +``` + +### MessageId +``` yaml +directive: +- from: swagger-document + where: $.parameters.MessageId + transform: > + $.description = "The message ID name."; +``` diff --git a/sdk/storage/azure-storage-queue/swagger/queue-2018-03-28.json b/sdk/storage/azure-storage-queue/swagger/queue-2018-03-28.json new file mode 100644 index 000000000000..49ca3244ed16 --- /dev/null +++ b/sdk/storage/azure-storage-queue/swagger/queue-2018-03-28.json @@ -0,0 +1,1856 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Queue Storage", + "version": "2018-03-28", + "x-ms-code-generation-settings": { + "header": "MIT", + "strictSpecAdherence": false + } + }, + "x-ms-parameterized-host": { + "hostTemplate": "{url}", + "useSchemePrefix": false, + "positionInOperation": "first", + "parameters": [ + { + "$ref": "#/parameters/Url" + } + ] + }, + "securityDefinitions": { + "queue_shared_key": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + } + }, + "schemes": [ + "https" + ], + "consumes": [ + "application/xml" + ], + "produces": [ + "application/xml" + ], + "paths": {}, + "x-ms-paths": { + "/?restype=service&comp=properties": { + "put": { + "tags": [ + "service" + ], + "operationId": "Service_SetProperties", + "description": "Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules", + "parameters": [ + { + "$ref": "#/parameters/StorageServiceProperties" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "Success (Accepted)", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "get": { + "tags": [ + "service" + ], + "operationId": "Service_GetProperties", + "description": "gets the properties of a storage account's Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + } + }, + "schema": { + "$ref": "#/definitions/StorageServiceProperties" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "service" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/?restype=service&comp=stats": { + "get": { + "tags": [ + "service" + ], + "operationId": "Service_GetStatistics", + "description": "Retrieves statistics related to replication for the Queue service. It is only available on the secondary location endpoint when read-access geo-redundant replication is enabled for the storage account.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/StorageServiceStats" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "service" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "stats" + ] + } + ] + }, + "/?comp=list": { + "get": { + "tags": [ + "service" + ], + "operationId": "Service_ListQueuesSegment", + "description": "The List Queues Segment operation returns a list of the queues under the specified account", + "parameters": [ + { + "$ref": "#/parameters/Prefix" + }, + { + "$ref": "#/parameters/Marker" + }, + { + "$ref": "#/parameters/MaxResults" + }, + { + "$ref": "#/parameters/ListQueuesInclude" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/ListQueuesSegmentResponse" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "NextMarker" + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "list" + ] + } + ] + }, + "/{queueName}": { + "put": { + "tags": [ + "service" + ], + "operationId": "Queue_Create", + "description": "creates a new queue under the given account.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "Success, queue created.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "204": { + "description": "Success, queue created.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "delete": { + "tags": [ + "queue" + ], + "operationId": "Queue_Delete", + "description": "operation permanently deletes the specified queue", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "204": { + "description": "No Content", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [] + }, + "/{queueName}?comp=metadata": { + "get": { + "tags": [ + "queue" + ], + "operationId": "Queue_GetProperties", + "description": "Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with the queue as name-values pairs.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-meta": { + "type": "string", + "x-ms-client-name": "Metadata", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "x-ms-approximate-messages-count": { + "type": "integer", + "x-ms-client-name": "ApproximateMessagesCount", + "description": "The approximate number of messages in the queue. This number is not lower than the actual number of messages in the queue, but could be higher." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "put": { + "tags": [ + "queue" + ], + "operationId": "Queue_SetMetadata", + "description": "sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "204": { + "description": "No Content", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "metadata" + ] + } + ] + }, + "/{queueName}?comp=acl": { + "get": { + "tags": [ + "queue" + ], + "operationId": "Queue_GetAccessPolicy", + "description": "returns details about any stored access policies specified on the queue that may be used with Shared Access Signatures.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/SignedIdentifiers" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "put": { + "tags": [ + "queue" + ], + "operationId": "Queue_SetAccessPolicy", + "description": "sets stored access policies for the queue that may be used with Shared Access Signatures", + "parameters": [ + { + "$ref": "#/parameters/QueueAcl" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "204": { + "description": "No Content", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "acl" + ] + } + ] + }, + "/{queueName}/messages": { + "get": { + "tags": [ + "message" + ], + "operationId": "Messages_Dequeue", + "description": "The Dequeue operation retrieves one or more messages from the front of the queue.", + "parameters": [ + { + "$ref": "#/parameters/NumOfMessages" + }, + { + "$ref": "#/parameters/VisibilityTimeout" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/DequeuedMessagesList" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "delete": { + "tags": [ + "message" + ], + "operationId": "Messages_Clear", + "description": "The Clear operation deletes all messages from the specified queue.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "204": { + "description": "No Content", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [] + }, + "/{queueName}/messages?visibilitytimeout={visibilityTimeout}&messagettl={messageTimeToLive}": { + "post": { + "tags": [ + "message" + ], + "operationId": "Messages_Enqueue", + "description": "The Enqueue operation adds a new message to the back of the message queue. A visibility timeout can also be specified to make the message invisible until the visibility timeout expires. A message must be in a format that can be included in an XML request with UTF-8 encoding. The encoded message can be up to 64 KB in size for versions 2011-08-18 and newer, or 8 KB in size for previous versions.", + "parameters": [ + { + "$ref": "#/parameters/QueueMessage" + }, + { + "$ref": "#/parameters/VisibilityTimeout" + }, + { + "$ref": "#/parameters/MessageTTL" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "Created", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/EnqueuedMessageList" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [] + }, + "/{queueName}/messages?peekonly=true": { + "get": { + "tags": [ + "message" + ], + "operationId": "Messages_Peek", + "description": "The Peek operation retrieves one or more messages from the front of the queue, but does not alter the visibility of the message.", + "parameters": [ + { + "$ref": "#/parameters/NumOfMessages" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/PeekedMessagesList" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "peekonly", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "true" + ] + } + ] + }, + "/{queueName}/messages/{messageid}?popreceipt={popReceipt}&visibilitytimeout={visibilityTimeout}": { + "put": { + "tags": [ + "messageId" + ], + "operationId": "MessageId_Update", + "description": "The Update operation was introduced with version 2011-08-18 of the Queue service API. The Update Message operation updates the visibility timeout of a message. You can also use this operation to update the contents of a message. A message must be in a format that can be included in an XML request with UTF-8 encoding, and the encoded message can be up to 64KB in size.", + "parameters": [ + { + "$ref": "#/parameters/QueueMessage" + }, + { + "$ref": "#/parameters/PopReceipt" + }, + { + "$ref": "#/parameters/VisibilityTimeoutRequired" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "204": { + "description": "No Content", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-popreceipt": { + "x-ms-client-name": "PopReceipt", + "type": "string", + "description": "The pop receipt of the queue message." + }, + "x-ms-time-next-visible": { + "x-ms-client-name": "TimeNextVisible", + "type": "string", + "format": "date-time-rfc1123", + "description": "A UTC date/time value that represents when the message will be visible on the queue." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [] + }, + "/{queueName}/messages/{messageid}?popreceipt={popReceipt}": { + "delete": { + "tags": [ + "messageId" + ], + "operationId": "MessageId_Delete", + "description": "The Delete operation deletes the specified message.", + "parameters": [ + { + "$ref": "#/parameters/PopReceipt" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "204": { + "description": "No Content", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [] + } + }, + "definitions": { + "AccessPolicy": { + "type": "object", + "required": [ + "Start", + "Expiry", + "Permission" + ], + "description": "An Access policy", + "properties": { + "Start": { + "description": "the date-time the policy is active", + "type": "string", + "format": "date-time" + }, + "Expiry": { + "description": "the date-time the policy expires", + "type": "string", + "format": "date-time" + }, + "Permission": { + "description": "the permissions for the acl policy", + "type": "string" + } + } + }, + "ListQueuesSegmentResponse": { + "xml": { + "name": "EnumerationResults" + }, + "description": "The object returned when calling List Queues on a Queue Service.", + "type": "object", + "required": [ + "ServiceEndpoint", + "Prefix", + "MaxResults", + "NextMarker" + ], + "properties": { + "ServiceEndpoint": { + "type": "string", + "xml": { + "attribute": true + } + }, + "Prefix": { + "type": "string" + }, + "Marker": { + "type": "string" + }, + "MaxResults": { + "type": "integer" + }, + "QueueItems": { + "xml": { + "wrapped": true, + "name": "Queues" + }, + "type": "array", + "items": { + "$ref": "#/definitions/QueueItem" + } + }, + "NextMarker": { + "type": "string" + } + } + }, + "CorsRule": { + "description": "CORS is an HTTP feature that enables a web application running under one domain to access resources in another domain. Web browsers implement a security restriction known as same-origin policy that prevents a web page from calling APIs in a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs in another domain", + "type": "object", + "required": [ + "AllowedOrigins", + "AllowedMethods", + "AllowedHeaders", + "ExposedHeaders", + "MaxAgeInSeconds" + ], + "properties": { + "AllowedOrigins": { + "description": "The origin domains that are permitted to make a request against the storage service via CORS. The origin domain is the domain from which the request originates. Note that the origin must be an exact case-sensitive match with the origin that the user age sends to the service. You can also use the wildcard character '*' to allow all origin domains to make requests via CORS.", + "type": "string" + }, + "AllowedMethods": { + "description": "The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated)", + "type": "string" + }, + "AllowedHeaders": { + "description": "the request headers that the origin domain may specify on the CORS request.", + "type": "string" + }, + "ExposedHeaders": { + "description": "The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer", + "type": "string" + }, + "MaxAgeInSeconds": { + "description": "The maximum amount time that a browser should cache the preflight OPTIONS request.", + "type": "integer", + "minimum": 0 + } + } + }, + "ErrorCode": { + "description": "Error codes returned by the service", + "type": "string", + "enum": [ + "AccountAlreadyExists", + "AccountBeingCreated", + "AccountIsDisabled", + "AuthenticationFailed", + "AuthorizationFailure", + "ConditionHeadersNotSupported", + "ConditionNotMet", + "EmptyMetadataKey", + "InsufficientAccountPermissions", + "InternalError", + "InvalidAuthenticationInfo", + "InvalidHeaderValue", + "InvalidHttpVerb", + "InvalidInput", + "InvalidMd5", + "InvalidMetadata", + "InvalidQueryParameterValue", + "InvalidRange", + "InvalidResourceName", + "InvalidUri", + "InvalidXmlDocument", + "InvalidXmlNodeValue", + "Md5Mismatch", + "MetadataTooLarge", + "MissingContentLengthHeader", + "MissingRequiredQueryParameter", + "MissingRequiredHeader", + "MissingRequiredXmlNode", + "MultipleConditionHeadersNotSupported", + "OperationTimedOut", + "OutOfRangeInput", + "OutOfRangeQueryParameterValue", + "RequestBodyTooLarge", + "ResourceTypeMismatch", + "RequestUrlFailedToParse", + "ResourceAlreadyExists", + "ResourceNotFound", + "ServerBusy", + "UnsupportedHeader", + "UnsupportedXmlNode", + "UnsupportedQueryParameter", + "UnsupportedHttpVerb", + "InvalidMarker", + "MessageNotFound", + "MessageTooLarge", + "PopReceiptMismatch", + "QueueAlreadyExists", + "QueueBeingDeleted", + "QueueDisabled", + "QueueNotEmpty", + "QueueNotFound" + ], + "x-ms-enum": { + "name": "StorageErrorCode", + "modelAsString": true + } + }, + "GeoReplication": { + "type": "object", + "required": [ + "Status", + "LastSyncTime" + ], + "properties": { + "Status": { + "description": "The status of the secondary location", + "type": "string", + "enum": [ + "live", + "bootstrap", + "unavailable" + ], + "x-ms-enum": { + "name": "GeoReplicationStatusType", + "modelAsString": true + } + }, + "LastSyncTime": { + "description": "A GMT date/time value, to the second. All primary writes preceding this value are guaranteed to be available for read operations at the secondary. Primary writes after this point in time may or may not be available for reads.", + "type": "string", + "format": "date-time-rfc1123" + } + } + }, + "Logging": { + "description": "Azure Analytics Logging settings.", + "type": "object", + "required": [ + "Version", + "Delete", + "Read", + "Write", + "RetentionPolicy" + ], + "properties": { + "Version": { + "description": "The version of Storage Analytics to configure.", + "type": "string" + }, + "Delete": { + "description": "Indicates whether all delete requests should be logged.", + "type": "boolean" + }, + "Read": { + "description": "Indicates whether all read requests should be logged.", + "type": "boolean" + }, + "Write": { + "description": "Indicates whether all write requests should be logged.", + "type": "boolean" + }, + "RetentionPolicy": { + "$ref": "#/definitions/RetentionPolicy" + } + } + }, + "Metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "StorageError": { + "type": "object", + "properties": { + "Message": { + "type": "string" + } + } + }, + "Metrics": { + "description": "", + "required": [ + "Enabled" + ], + "properties": { + "Version": { + "description": "The version of Storage Analytics to configure.", + "type": "string" + }, + "Enabled": { + "description": "Indicates whether metrics are enabled for the Queue service.", + "type": "boolean" + }, + "IncludeAPIs": { + "description": "Indicates whether metrics should generate summary statistics for called API operations.", + "type": "boolean" + }, + "RetentionPolicy": { + "$ref": "#/definitions/RetentionPolicy" + } + } + }, + "QueueItem": { + "description": "An Azure Storage Queue.", + "type": "object", + "required": [ + "Name" + ], + "properties": { + "Name": { + "type": "string", + "description": "The name of the Queue." + }, + "Metadata": { + "$ref": "#/definitions/Metadata" + } + }, + "xml": { + "name": "Queue" + } + }, + "QueueMessage": { + "description": "A Message object which can be stored in a Queue", + "type": "object", + "required": [ + "MessageText" + ], + "properties": { + "MessageText": { + "type": "string", + "description": "The content of the message" + } + } + }, + "DequeuedMessageItem": { + "description": "The object returned in the QueueMessageList array when calling Get Messages on a Queue.", + "type": "object", + "required": [ + "MessageId", + "InsertionTime", + "ExpirationTime", + "PopReceipt", + "TimeNextVisible", + "DequeueCount", + "MessageText" + ], + "properties": { + "MessageId": { + "type": "string", + "description": "The Id of the Message." + }, + "InsertionTime": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The time the Message was inserted into the Queue." + }, + "ExpirationTime": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The time that the Message will expire and be automatically deleted." + }, + "PopReceipt": { + "type": "string", + "description": "This value is required to delete the Message. If deletion fails using this popreceipt then the message has been dequeued by another client." + }, + "TimeNextVisible": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The time that the message will again become visible in the Queue." + }, + "DequeueCount": { + "type": "integer", + "format": "int64", + "description": "The number of times the message has been dequeued." + }, + "MessageText": { + "type": "string", + "description": "The content of the Message." + } + }, + "xml": { + "wrapped": true, + "name": "QueueMessage" + } + }, + "PeekedMessageItem": { + "description": "The object returned in the QueueMessageList array when calling Peek Messages on a Queue", + "type": "object", + "required": [ + "MessageId", + "InsertionTime", + "ExpirationTime", + "DequeueCount", + "MessageText" + ], + "properties": { + "MessageId": { + "type": "string", + "description": "The Id of the Message." + }, + "InsertionTime": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The time the Message was inserted into the Queue." + }, + "ExpirationTime": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The time that the Message will expire and be automatically deleted." + }, + "DequeueCount": { + "type": "integer", + "format": "int64", + "description": "The number of times the message has been dequeued." + }, + "MessageText": { + "type": "string", + "description": "The content of the Message." + } + }, + "xml": { + "wrapped": true, + "name": "QueueMessage" + } + }, + "EnqueuedMessage": { + "description": "The object returned in the QueueMessageList array when calling Put Message on a Queue", + "type": "object", + "required": [ + "MessageId", + "InsertionTime", + "ExpirationTime", + "PopReceipt", + "TimeNextVisible" + ], + "properties": { + "MessageId": { + "type": "string", + "description": "The Id of the Message." + }, + "InsertionTime": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The time the Message was inserted into the Queue." + }, + "ExpirationTime": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The time that the Message will expire and be automatically deleted." + }, + "PopReceipt": { + "type": "string", + "description": "This value is required to delete the Message. If deletion fails using this popreceipt then the message has been dequeued by another client." + }, + "TimeNextVisible": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The time that the message will again become visible in the Queue." + } + }, + "xml": { + "wrapped": true, + "name": "QueueMessage" + } + }, + "DequeuedMessagesList": { + "description": "The object returned when calling Get Messages on a Queue", + "type": "array", + "items": { + "$ref": "#/definitions/DequeuedMessageItem", + "xml": { + "name": "QueueMessage" + } + }, + "xml": { + "wrapped": true, + "name": "QueueMessagesList" + } + }, + "PeekedMessagesList": { + "description": "The object returned when calling Peek Messages on a Queue", + "type": "array", + "items": { + "$ref": "#/definitions/PeekedMessageItem", + "xml": { + "name": "QueueMessage" + } + }, + "xml": { + "wrapped": true, + "name": "QueueMessagesList" + } + }, + "EnqueuedMessageList": { + "description": "The object returned when calling Put Message on a Queue", + "type": "array", + "items": { + "$ref": "#/definitions/EnqueuedMessage", + "xml": { + "name": "QueueMessage" + } + }, + "xml": { + "wrapped": true, + "name": "QueueMessagesList" + } + }, + "RetentionPolicy": { + "description": "the retention policy", + "type": "object", + "required": [ + "Enabled" + ], + "properties": { + "Enabled": { + "description": "Indicates whether a retention policy is enabled for the storage service", + "type": "boolean" + }, + "Days": { + "description": "Indicates the number of days that metrics or logging or soft-deleted data should be retained. All data older than this value will be deleted", + "type": "integer", + "minimum": 1 + } + } + }, + "SignedIdentifier": { + "description": "signed identifier", + "type": "object", + "required": [ + "Id", + "AccessPolicy" + ], + "properties": { + "Id": { + "type": "string", + "description": "a unique id" + }, + "AccessPolicy": { + "description": "The access policy", + "$ref": "#/definitions/AccessPolicy" + } + } + }, + "SignedIdentifiers": { + "description": "a collection of signed identifiers", + "type": "array", + "items": { + "$ref": "#/definitions/SignedIdentifier", + "xml": { + "name": "SignedIdentifier" + } + }, + "xml": { + "wrapped": true, + "name": "SignedIdentifiers" + } + }, + "StorageServiceProperties": { + "description": "Storage Service Properties.", + "type": "object", + "properties": { + "Logging": { + "description": "Azure Analytics Logging settings", + "$ref": "#/definitions/Logging" + }, + "HourMetrics": { + "description": "A summary of request statistics grouped by API in hourly aggregates for queues", + "$ref": "#/definitions/Metrics" + }, + "MinuteMetrics": { + "description": "a summary of request statistics grouped by API in minute aggregates for queues", + "$ref": "#/definitions/Metrics" + }, + "Cors": { + "description": "The set of CORS rules.", + "type": "array", + "items": { + "$ref": "#/definitions/CorsRule", + "xml": { + "name": "CorsRule" + } + }, + "xml": { + "wrapped": true + } + } + } + }, + "StorageServiceStats": { + "description": "Stats for the storage service.", + "type": "object", + "properties": { + "GeoReplication": { + "description": "Geo-Replication information for the Secondary Storage Service", + "$ref": "#/definitions/GeoReplication" + } + } + } + }, + "parameters": { + "Url": { + "name": "url", + "description": "The URL of the service account, queue or message that is the targe of the desired operation.", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true + }, + "ApiVersionParameter": { + "name": "x-ms-version", + "x-ms-client-name": "version", + "in": "header", + "required": true, + "type": "string", + "description": "Specifies the version of the operation to use for this request.", + "enum": [ + "2018-03-28" + ] + }, + "Body": { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "format": "file" + }, + "x-ms-parameter-location": "method", + "description": "Initial data" + }, + "QueueAcl": { + "name": "queueAcl", + "in": "body", + "schema": { + "$ref": "#/definitions/SignedIdentifiers" + }, + "x-ms-parameter-location": "method", + "description": "the acls for the queue" + }, + "ClientRequestId": { + "name": "x-ms-client-request-id", + "x-ms-client-name": "requestId", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled." + }, + "ContentLength": { + "name": "Content-Length", + "in": "header", + "required": true, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "description": "The length of the request." + }, + "ListQueuesInclude": { + "name": "include", + "in": "query", + "required": false, + "type": "array", + "collectionFormat": "csv", + "items": { + "type": "string", + "enum": [ + "metadata" + ], + "x-ms-enum": { + "name": "ListQueuesIncludeType", + "modelAsString": false + } + }, + "x-ms-parameter-location": "method", + "description": "Include this parameter to specify that the queues's metadata be returned as part of the response body." + }, + "Marker": { + "name": "marker", + "in": "query", + "required": false, + "type": "string", + "description": "A string value that identifies the portion of the list of queues to be returned with the next listing operation. The operation returns the NextMarker value within the response body if the listing operation did not return all queues remaining to be listed with the current page. The NextMarker value can be used as the value for the marker parameter in a subsequent call to request the next page of list items. The marker value is opaque to the client.", + "x-ms-parameter-location": "method" + }, + "MaxResults": { + "name": "maxresults", + "in": "query", + "required": false, + "type": "integer", + "minimum": 1, + "x-ms-parameter-location": "method", + "description": "Specifies the maximum number of queues to return. If the request does not specify maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the listing operation crosses a partition boundary, then the service will return a continuation token for retrieving the remainder of the results. For this reason, it is possible that the service will return fewer results than specified by maxresults, or than the default of 5000." + }, + "MessageId": { + "name": "messageid", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The container name." + }, + "MessageTTL": { + "name": "messagettl", + "x-ms-client-name": "MessageTimeToLive", + "in": "query", + "required": false, + "type": "integer", + "minimum": -1, + "x-ms-parameter-location": "method", + "description": "Optional. Specifies the time-to-live interval for the message, in seconds. Prior to version 2017-07-29, the maximum time-to-live allowed is 7 days. For version 2017-07-29 or later, the maximum time-to-live can be any positive number, as well as -1 indicating that the message does not expire. If this parameter is omitted, the default time-to-live is 7 days." + }, + "Metadata": { + "name": "x-ms-meta", + "x-ms-client-name": "metadata", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Optional. Include this parameter to specify that the queue's metadata be returned as part of the response body. Note that metadata requested with this parameter must be stored in accordance with the naming restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata names must adhere to the naming conventions for C# identifiers.", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "NumOfMessages": { + "name": "numofmessages", + "x-ms-client-name": "numberOfMessages", + "in": "query", + "required": false, + "type": "integer", + "minimum": 1, + "x-ms-parameter-location": "method", + "description": "Optional. A nonzero integer value that specifies the number of messages to retrieve from the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single message is retrieved from the queue with this operation." + }, + "PopReceipt": { + "name": "popreceipt", + "x-ms-client-name": "popReceipt", + "in": "query", + "required": true, + "x-ms-parameter-location": "method", + "description": "Required. Specifies the valid pop receipt value returned from an earlier call to the Get Messages or Update Message operation.", + "type": "string" + }, + "Prefix": { + "name": "prefix", + "in": "query", + "required": false, + "type": "string", + "description": "Filters the results to return only queues whose name begins with the specified prefix.", + "x-ms-parameter-location": "method" + }, + "QueueMessage": { + "name": "QueueMessage", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/QueueMessage" + }, + "x-ms-parameter-location": "method", + "description": "A Message object which can be stored in a Queue" + }, + "QueueName": { + "name": "queueName", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The queue name." + }, + "StorageServiceProperties": { + "name": "StorageServiceProperties", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/StorageServiceProperties" + }, + "x-ms-parameter-location": "method", + "description": "The StorageService properties." + }, + "Timeout": { + "name": "timeout", + "in": "query", + "required": false, + "type": "integer", + "minimum": 0, + "x-ms-parameter-location": "method", + "description": "The The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Queue Service Operations." + }, + "VisibilityTimeout": { + "name": "visibilitytimeout", + "in": "query", + "required": false, + "type": "integer", + "minimum": 0, + "maximum": 604800, + "x-ms-parameter-location": "method", + "description": "Optional. Specifies the new visibility timeout value, in seconds, relative to server time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility timeout of a message can be set to a value later than the expiry time." + }, + "VisibilityTimeoutRequired": { + "name": "visibilitytimeout", + "in": "query", + "required": true, + "type": "integer", + "minimum": 0, + "maximum": 604800, + "x-ms-parameter-location": "method", + "description": "Optional. Specifies the new visibility timeout value, in seconds, relative to server time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility timeout of a message can be set to a value later than the expiry time." + } + } + } \ No newline at end of file diff --git a/sdk/storage/azure-storage-queue/swagger/queue.json b/sdk/storage/azure-storage-queue/swagger/queue.json deleted file mode 100644 index 977d767b9f84..000000000000 --- a/sdk/storage/azure-storage-queue/swagger/queue.json +++ /dev/null @@ -1,1898 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Azure Queue Storage", - "version": "2018-03-28", - "x-ms-code-generation-settings": { - "header": "MIT", - "strictSpecAdherence": false - } - }, - "x-ms-parameterized-host": { - "hostTemplate": "{url}", - "useSchemePrefix": false, - "positionInOperation": "first", - "parameters": [ - { - "$ref": "#/parameters/Url" - } - ] - }, - "securityDefinitions": { - "queue_shared_key": { - "type": "apiKey", - "name": "Authorization", - "in": "header" - } - }, - "schemes": [ - "https" - ], - "consumes": [ - "application/xml" - ], - "produces": [ - "application/xml" - ], - "paths": {}, - "x-ms-paths": { - "/?restype=service&comp=properties": { - "put": { - "tags": [ - "service" - ], - "operationId": "Service_SetProperties", - "description": "Sets properties for a storage account's Queue service endpoint, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules", - "parameters": [ - { - "$ref": "#/parameters/StorageServiceProperties" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "202": { - "description": "Success (Accepted)", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "get": { - "tags": [ - "service" - ], - "operationId": "Service_GetProperties", - "description": "gets the properties of a storage account's Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.", - "parameters": [ - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "Success.", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - } - }, - "schema": { - "$ref": "#/definitions/StorageServiceProperties" - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "restype", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "service" - ] - }, - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "properties" - ] - } - ] - }, - "/?restype=service&comp=stats": { - "get": { - "tags": [ - "service" - ], - "operationId": "Service_GetStatistics", - "description": "Retrieves statistics related to replication for the Queue service. It is only available on the secondary location endpoint when read-access geo-redundant replication is enabled for the storage account.", - "parameters": [ - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "Success.", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - }, - "schema": { - "$ref": "#/definitions/StorageServiceStats" - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "restype", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "service" - ] - }, - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "stats" - ] - } - ] - }, - "/?comp=list": { - "get": { - "tags": [ - "service" - ], - "operationId": "Service_ListQueuesSegment", - "description": "The List Queues Segment operation returns a list of the queues under the specified account", - "parameters": [ - { - "$ref": "#/parameters/Prefix" - }, - { - "$ref": "#/parameters/Marker" - }, - { - "$ref": "#/parameters/MaxResults" - }, - { - "$ref": "#/parameters/ListQueuesInclude" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "Success.", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - }, - "schema": { - "$ref": "#/definitions/ListQueuesSegmentResponse" - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "NextMarker" - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "list" - ] - } - ] - }, - "/{queueName}": { - "put": { - "tags": [ - "service" - ], - "operationId": "Queue_Create", - "description": "creates a new queue under the given account.", - "parameters": [ - { - "$ref": "#/parameters/QueueName" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/Metadata" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "201": { - "description": "Success, queue created.", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "204": { - "description": "Success, queue created.", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "delete": { - "tags": [ - "queue" - ], - "operationId": "Queue_Delete", - "description": "operation permanently deletes the specified queue", - "parameters": [ - { - "$ref": "#/parameters/QueueName" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "204": { - "description": "No Content", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [] - }, - "/{queueName}?comp=metadata": { - "get": { - "tags": [ - "queue" - ], - "operationId": "Queue_GetProperties", - "description": "Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with the queue as name-values pairs.", - "parameters": [ - { - "$ref": "#/parameters/QueueName" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "Success.", - "headers": { - "x-ms-meta": { - "type": "string", - "x-ms-client-name": "Metadata", - "x-ms-header-collection-prefix": "x-ms-meta-" - }, - "x-ms-approximate-messages-count": { - "type": "integer", - "x-ms-client-name": "ApproximateMessagesCount", - "description": "The approximate number of messages in the queue. This number is not lower than the actual number of messages in the queue, but could be higher." - }, - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "put": { - "tags": [ - "queue" - ], - "operationId": "Queue_SetMetadata", - "description": "sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs.", - "parameters": [ - { - "$ref": "#/parameters/QueueName" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/Metadata" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "204": { - "description": "No Content", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "metadata" - ] - } - ] - }, - "/{queueName}?comp=acl": { - "get": { - "tags": [ - "queue" - ], - "operationId": "Queue_GetAccessPolicy", - "description": "returns details about any stored access policies specified on the queue that may be used with Shared Access Signatures.", - "parameters": [ - { - "$ref": "#/parameters/QueueName" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "Success", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - }, - "schema": { - "$ref": "#/definitions/SignedIdentifiers" - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "put": { - "tags": [ - "queue" - ], - "operationId": "Queue_SetAccessPolicy", - "description": "sets stored access policies for the queue that may be used with Shared Access Signatures", - "parameters": [ - { - "$ref": "#/parameters/QueueName" - }, - { - "$ref": "#/parameters/QueueAcl" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "204": { - "description": "No Content", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "acl" - ] - } - ] - }, - "/{queueName}/messages": { - "get": { - "tags": [ - "message" - ], - "operationId": "Messages_Dequeue", - "description": "The Dequeue operation retrieves one or more messages from the front of the queue.", - "parameters": [ - { - "$ref": "#/parameters/QueueName" - }, - { - "$ref": "#/parameters/NumOfMessages" - }, - { - "$ref": "#/parameters/VisibilityTimeout" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "OK", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - }, - "schema": { - "$ref": "#/definitions/DequeuedMessagesList" - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "delete": { - "tags": [ - "message" - ], - "operationId": "Messages_Clear", - "description": "The Clear operation deletes all messages from the specified queue.", - "parameters": [ - { - "$ref": "#/parameters/QueueName" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "204": { - "description": "No Content", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [] - }, - "/{queueName}/messages?visibilitytimeout={visibilityTimeout}&messagettl={messageTimeToLive}": { - "post": { - "tags": [ - "message" - ], - "operationId": "Messages_Enqueue", - "description": "The Enqueue operation adds a new message to the back of the message queue. A visibility timeout can also be specified to make the message invisible until the visibility timeout expires. A message must be in a format that can be included in an XML request with UTF-8 encoding. The encoded message can be up to 64 KB in size for versions 2011-08-18 and newer, or 8 KB in size for previous versions.", - "parameters": [ - { - "$ref": "#/parameters/QueueName" - }, - { - "$ref": "#/parameters/QueueMessage" - }, - { - "$ref": "#/parameters/VisibilityTimeout" - }, - { - "$ref": "#/parameters/MessageTTL" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "201": { - "description": "Created", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - }, - "schema": { - "$ref": "#/definitions/EnqueuedMessageList" - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [] - }, - "/{queueName}/messages?peekonly=true": { - "get": { - "tags": [ - "message" - ], - "operationId": "Messages_Peek", - "description": "The Peek operation retrieves one or more messages from the front of the queue, but does not alter the visibility of the message.", - "parameters": [ - { - "$ref": "#/parameters/QueueName" - }, - { - "$ref": "#/parameters/NumOfMessages" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "200": { - "description": "OK", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - }, - "schema": { - "$ref": "#/definitions/PeekedMessagesList" - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [ - { - "name": "peekonly", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "true" - ] - } - ] - }, - "/{queueName}/messages/{messageid}?popreceipt={popReceipt}&visibilitytimeout={visibilityTimeout}": { - "put": { - "tags": [ - "messageId" - ], - "operationId": "MessageId_Update", - "description": "The Update operation was introduced with version 2011-08-18 of the Queue service API. The Update Message operation updates the visibility timeout of a message. You can also use this operation to update the contents of a message. A message must be in a format that can be included in an XML request with UTF-8 encoding, and the encoded message can be up to 64KB in size.", - "parameters": [ - { - "$ref": "#/parameters/QueueName" - }, - { - "$ref": "#/parameters/MessageId" - }, - { - "$ref": "#/parameters/QueueMessage" - }, - { - "$ref": "#/parameters/PopReceipt" - }, - { - "$ref": "#/parameters/VisibilityTimeoutRequired" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "204": { - "description": "No Content", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - }, - "x-ms-popreceipt": { - "x-ms-client-name": "PopReceipt", - "type": "string", - "description": "The pop receipt of the queue message." - }, - "x-ms-time-next-visible": { - "x-ms-client-name": "TimeNextVisible", - "type": "string", - "format": "date-time-rfc1123", - "description": "A UTC date/time value that represents when the message will be visible on the queue." - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [] - }, - "/{queueName}/messages/{messageid}?popreceipt={popReceipt}": { - "delete": { - "tags": [ - "messageId" - ], - "operationId": "MessageId_Delete", - "description": "The Delete operation deletes the specified message.", - "parameters": [ - { - "$ref": "#/parameters/QueueName" - }, - { - "$ref": "#/parameters/MessageId" - }, - { - "$ref": "#/parameters/PopReceipt" - }, - { - "$ref": "#/parameters/Timeout" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ClientRequestId" - } - ], - "responses": { - "204": { - "description": "No Content", - "headers": { - "x-ms-request-id": { - "x-ms-client-name": "RequestId", - "type": "string", - "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." - }, - "x-ms-version": { - "x-ms-client-name": "Version", - "type": "string", - "description": "Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." - }, - "Date": { - "type": "string", - "format": "date-time-rfc1123", - "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" - } - } - }, - "default": { - "description": "Failure", - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/StorageError" - } - } - } - }, - "parameters": [] - } - }, - "definitions": { - "AccessPolicy": { - "type": "object", - "required": [ - "Start", - "Expiry", - "Permission" - ], - "description": "An Access policy", - "properties": { - "Start": { - "description": "the date-time the policy is active", - "type": "string", - "format": "date-time" - }, - "Expiry": { - "description": "the date-time the policy expires", - "type": "string", - "format": "date-time" - }, - "Permission": { - "description": "the permissions for the acl policy", - "type": "string" - } - } - }, - "ListQueuesSegmentResponse": { - "xml": { - "name": "EnumerationResults" - }, - "description": "The object returned when calling List Queues on a Queue Service.", - "type": "object", - "required": [ - "ServiceEndpoint", - "Prefix", - "MaxResults", - "NextMarker" - ], - "properties": { - "ServiceEndpoint": { - "type": "string", - "xml": { - "attribute": true - } - }, - "Prefix": { - "type": "string" - }, - "Marker": { - "type": "string" - }, - "MaxResults": { - "type": "integer" - }, - "QueueItems": { - "xml": { - "wrapped": true, - "name": "Queues" - }, - "type": "array", - "items": { - "$ref": "#/definitions/QueueItem" - } - }, - "NextMarker": { - "type": "string" - } - } - }, - "CorsRule": { - "description": "CORS is an HTTP feature that enables a web application running under one domain to access resources in another domain. Web browsers implement a security restriction known as same-origin policy that prevents a web page from calling APIs in a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs in another domain", - "type": "object", - "required": [ - "AllowedOrigins", - "AllowedMethods", - "AllowedHeaders", - "ExposedHeaders", - "MaxAgeInSeconds" - ], - "properties": { - "AllowedOrigins": { - "description": "The origin domains that are permitted to make a request against the storage service via CORS. The origin domain is the domain from which the request originates. Note that the origin must be an exact case-sensitive match with the origin that the user age sends to the service. You can also use the wildcard character '*' to allow all origin domains to make requests via CORS.", - "type": "string" - }, - "AllowedMethods": { - "description": "The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated)", - "type": "string" - }, - "AllowedHeaders": { - "description": "the request headers that the origin domain may specify on the CORS request.", - "type": "string" - }, - "ExposedHeaders": { - "description": "The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer", - "type": "string" - }, - "MaxAgeInSeconds": { - "description": "The maximum amount time that a browser should cache the preflight OPTIONS request.", - "type": "integer", - "minimum": 0 - } - } - }, - "ErrorCode": { - "description": "Error codes returned by the service", - "type": "string", - "enum": [ - "AccountAlreadyExists", - "AccountBeingCreated", - "AccountIsDisabled", - "AuthenticationFailed", - "AuthorizationFailure", - "ConditionHeadersNotSupported", - "ConditionNotMet", - "EmptyMetadataKey", - "InsufficientAccountPermissions", - "InternalError", - "InvalidAuthenticationInfo", - "InvalidHeaderValue", - "InvalidHttpVerb", - "InvalidInput", - "InvalidMd5", - "InvalidMetadata", - "InvalidQueryParameterValue", - "InvalidRange", - "InvalidResourceName", - "InvalidUri", - "InvalidXmlDocument", - "InvalidXmlNodeValue", - "Md5Mismatch", - "MetadataTooLarge", - "MissingContentLengthHeader", - "MissingRequiredQueryParameter", - "MissingRequiredHeader", - "MissingRequiredXmlNode", - "MultipleConditionHeadersNotSupported", - "OperationTimedOut", - "OutOfRangeInput", - "OutOfRangeQueryParameterValue", - "RequestBodyTooLarge", - "ResourceTypeMismatch", - "RequestUrlFailedToParse", - "ResourceAlreadyExists", - "ResourceNotFound", - "ServerBusy", - "UnsupportedHeader", - "UnsupportedXmlNode", - "UnsupportedQueryParameter", - "UnsupportedHttpVerb", - "InvalidMarker", - "MessageNotFound", - "MessageTooLarge", - "PopReceiptMismatch", - "QueueAlreadyExists", - "QueueBeingDeleted", - "QueueDisabled", - "QueueNotEmpty", - "QueueNotFound" - ], - "x-ms-enum": { - "name": "StorageErrorCode", - "modelAsString": true - } - }, - "GeoReplication": { - "type": "object", - "required": [ - "Status", - "LastSyncTime" - ], - "properties": { - "Status": { - "description": "The status of the secondary location", - "type": "string", - "enum": [ - "live", - "bootstrap", - "unavailable" - ], - "x-ms-enum": { - "name": "GeoReplicationStatusType", - "modelAsString": true - } - }, - "LastSyncTime": { - "description": "A GMT date/time value, to the second. All primary writes preceding this value are guaranteed to be available for read operations at the secondary. Primary writes after this point in time may or may not be available for reads.", - "type": "string", - "format": "date-time-rfc1123" - } - } - }, - "Logging": { - "description": "Azure Analytics Logging settings.", - "type": "object", - "required": [ - "Version", - "Delete", - "Read", - "Write", - "RetentionPolicy" - ], - "properties": { - "Version": { - "description": "The version of Storage Analytics to configure.", - "type": "string" - }, - "Delete": { - "description": "Indicates whether all delete requests should be logged.", - "type": "boolean" - }, - "Read": { - "description": "Indicates whether all read requests should be logged.", - "type": "boolean" - }, - "Write": { - "description": "Indicates whether all write requests should be logged.", - "type": "boolean" - }, - "RetentionPolicy": { - "$ref": "#/definitions/RetentionPolicy" - } - } - }, - "Metadata": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "StorageError": { - "type": "object", - "properties": { - "Message": { - "type": "string" - } - } - }, - "Metrics": { - "description": "", - "required": [ - "Enabled" - ], - "properties": { - "Version": { - "description": "The version of Storage Analytics to configure.", - "type": "string" - }, - "Enabled": { - "description": "Indicates whether metrics are enabled for the Queue service.", - "type": "boolean" - }, - "IncludeAPIs": { - "description": "Indicates whether metrics should generate summary statistics for called API operations.", - "type": "boolean" - }, - "RetentionPolicy": { - "$ref": "#/definitions/RetentionPolicy" - } - } - }, - "QueueItem": { - "description": "An Azure Storage Queue.", - "type": "object", - "required": [ - "Name" - ], - "properties": { - "Name": { - "type": "string", - "description": "The name of the Queue." - }, - "Metadata": { - "$ref": "#/definitions/Metadata" - } - }, - "xml": { - "name": "Queue" - } - }, - "QueueMessage": { - "description": "A Message object which can be stored in a Queue", - "type": "object", - "required": [ - "MessageText" - ], - "properties": { - "MessageText": { - "type": "string", - "description": "The content of the message" - } - } - }, - "DequeuedMessage": { - "description": "The object returned in the QueueMessageList array when calling Get Messages on a Queue.", - "type": "object", - "required": [ - "MessageId", - "InsertionTime", - "ExpirationTime", - "PopReceipt", - "TimeNextVisible", - "DequeueCount", - "MessageText" - ], - "properties": { - "MessageId": { - "type": "string", - "description": "The Id of the Message." - }, - "InsertionTime": { - "type": "string", - "format": "date-time-rfc1123", - "description": "The time the Message was inserted into the Queue." - }, - "ExpirationTime": { - "type": "string", - "format": "date-time-rfc1123", - "description": "The time that the Message will expire and be automatically deleted." - }, - "PopReceipt": { - "type": "string", - "description": "This value is required to delete the Message. If deletion fails using this popreceipt then the message has been dequeued by another client." - }, - "TimeNextVisible": { - "type": "string", - "format": "date-time-rfc1123", - "description": "The time that the message will again become visible in the Queue." - }, - "DequeueCount": { - "type": "integer", - "format": "int64", - "description": "The number of times the message has been dequeued." - }, - "MessageText": { - "type": "string", - "description": "The content of the Message." - } - }, - "xml": { - "wrapped": true, - "name": "QueueMessage" - } - }, - "PeekedMessage": { - "description": "The object returned in the QueueMessageList array when calling Peek Messages on a Queue", - "type": "object", - "required": [ - "MessageId", - "InsertionTime", - "ExpirationTime", - "DequeueCount", - "MessageText" - ], - "properties": { - "MessageId": { - "type": "string", - "description": "The Id of the Message." - }, - "InsertionTime": { - "type": "string", - "format": "date-time-rfc1123", - "description": "The time the Message was inserted into the Queue." - }, - "ExpirationTime": { - "type": "string", - "format": "date-time-rfc1123", - "description": "The time that the Message will expire and be automatically deleted." - }, - "DequeueCount": { - "type": "integer", - "format": "int64", - "description": "The number of times the message has been dequeued." - }, - "MessageText": { - "type": "string", - "description": "The content of the Message." - } - }, - "xml": { - "wrapped": true, - "name": "QueueMessage" - } - }, - "EnqueuedMessage": { - "description": "The object returned in the QueueMessageList array when calling Put Message on a Queue", - "type": "object", - "required": [ - "MessageId", - "InsertionTime", - "ExpirationTime", - "PopReceipt", - "TimeNextVisible" - ], - "properties": { - "MessageId": { - "type": "string", - "description": "The Id of the Message." - }, - "InsertionTime": { - "type": "string", - "format": "date-time-rfc1123", - "description": "The time the Message was inserted into the Queue." - }, - "ExpirationTime": { - "type": "string", - "format": "date-time-rfc1123", - "description": "The time that the Message will expire and be automatically deleted." - }, - "PopReceipt": { - "type": "string", - "description": "This value is required to delete the Message. If deletion fails using this popreceipt then the message has been dequeued by another client." - }, - "TimeNextVisible": { - "type": "string", - "format": "date-time-rfc1123", - "description": "The time that the message will again become visible in the Queue." - } - }, - "xml": { - "wrapped": true, - "name": "QueueMessage" - } - }, - "DequeuedMessagesList": { - "description": "The object returned when calling Get Messages on a Queue", - "type": "array", - "items": { - "$ref": "#/definitions/DequeuedMessage", - "xml": { - "name": "QueueMessage" - } - }, - "xml": { - "wrapped": true, - "name": "QueueMessagesList" - } - }, - "PeekedMessagesList": { - "description": "The object returned when calling Peek Messages on a Queue", - "type": "array", - "items": { - "$ref": "#/definitions/PeekedMessage", - "xml": { - "name": "QueueMessage" - } - }, - "xml": { - "wrapped": true, - "name": "QueueMessagesList" - } - }, - "EnqueuedMessageList": { - "description": "The object returned when calling Put Message on a Queue", - "type": "array", - "items": { - "$ref": "#/definitions/EnqueuedMessage", - "xml": { - "name": "QueueMessage" - } - }, - "xml": { - "wrapped": true, - "name": "QueueMessagesList" - } - }, - "RetentionPolicy": { - "description": "the retention policy", - "type": "object", - "required": [ - "Enabled" - ], - "properties": { - "Enabled": { - "description": "Indicates whether a retention policy is enabled for the storage service", - "type": "boolean" - }, - "Days": { - "description": "Indicates the number of days that metrics or logging or soft-deleted data should be retained. All data older than this value will be deleted", - "type": "integer", - "minimum": 1 - } - } - }, - "SignedIdentifier": { - "description": "signed identifier", - "type": "object", - "required": [ - "Id", - "AccessPolicy" - ], - "properties": { - "Id": { - "type": "string", - "description": "a unique id" - }, - "AccessPolicy": { - "description": "The access policy", - "$ref": "#/definitions/AccessPolicy" - } - } - }, - "SignedIdentifiers": { - "description": "a collection of signed identifiers", - "type": "array", - "items": { - "$ref": "#/definitions/SignedIdentifier", - "xml": { - "name": "SignedIdentifier" - } - }, - "xml": { - "wrapped": true, - "name": "SignedIdentifiers" - } - }, - "StorageServiceProperties": { - "description": "Storage Service Properties.", - "type": "object", - "properties": { - "Logging": { - "description": "Azure Analytics Logging settings", - "$ref": "#/definitions/Logging" - }, - "HourMetrics": { - "description": "A summary of request statistics grouped by API in hourly aggregates for queues", - "$ref": "#/definitions/Metrics" - }, - "MinuteMetrics": { - "description": "a summary of request statistics grouped by API in minute aggregates for queues", - "$ref": "#/definitions/Metrics" - }, - "Cors": { - "description": "The set of CORS rules.", - "type": "array", - "items": { - "$ref": "#/definitions/CorsRule", - "xml": { - "name": "CorsRule" - } - }, - "xml": { - "wrapped": true - } - } - } - }, - "StorageServiceStats": { - "description": "Stats for the storage service.", - "type": "object", - "properties": { - "GeoReplication": { - "description": "Geo-Replication information for the Secondary Storage Service", - "$ref": "#/definitions/GeoReplication" - } - } - } - }, - "parameters": { - "Url": { - "name": "url", - "description": "The URL of the service account, queue or message that is the targe of the desired operation.", - "required": true, - "type": "string", - "in": "path", - "x-ms-skip-url-encoding": true - }, - "ApiVersionParameter": { - "name": "x-ms-version", - "x-ms-client-name": "version", - "in": "header", - "required": true, - "type": "string", - "description": "Specifies the version of the operation to use for this request.", - "enum": [ - "2018-03-28" - ] - }, - "Body": { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "format": "file" - }, - "x-ms-parameter-location": "method", - "description": "Initial data" - }, - "QueueAcl": { - "name": "queueAcl", - "in": "body", - "schema": { - "$ref": "#/definitions/SignedIdentifiers" - }, - "x-ms-parameter-location": "method", - "description": "the acls for the queue" - }, - "ClientRequestId": { - "name": "x-ms-client-request-id", - "x-ms-client-name": "requestId", - "in": "header", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "description": "Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled." - }, - "ContentLength": { - "name": "Content-Length", - "in": "header", - "required": true, - "type": "integer", - "format": "int64", - "x-ms-parameter-location": "method", - "description": "The length of the request." - }, - "ListQueuesInclude": { - "name": "include", - "in": "query", - "required": false, - "type": "array", - "collectionFormat": "csv", - "items": { - "type": "string", - "enum": [ - "metadata" - ], - "x-ms-enum": { - "name": "ListQueuesIncludeType", - "modelAsString": false - } - }, - "x-ms-parameter-location": "method", - "description": "Include this parameter to specify that the queues's metadata be returned as part of the response body." - }, - "Marker": { - "name": "marker", - "in": "query", - "required": false, - "type": "string", - "description": "A string value that identifies the portion of the list of queues to be returned with the next listing operation. The operation returns the NextMarker value within the response body if the listing operation did not return all queues remaining to be listed with the current page. The NextMarker value can be used as the value for the marker parameter in a subsequent call to request the next page of list items. The marker value is opaque to the client.", - "x-ms-parameter-location": "method" - }, - "MaxResults": { - "name": "maxresults", - "in": "query", - "required": false, - "type": "integer", - "minimum": 1, - "x-ms-parameter-location": "method", - "description": "Specifies the maximum number of queues to return. If the request does not specify maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the listing operation crosses a partition boundary, then the service will return a continuation token for retrieving the remainder of the results. For this reason, it is possible that the service will return fewer results than specified by maxresults, or than the default of 5000." - }, - "MessageId": { - "name": "messageid", - "in": "path", - "required": true, - "type": "string", - "x-ms-parameter-location": "method", - "description": "The message ID name." - }, - "MessageTTL": { - "name": "messagettl", - "x-ms-client-name": "MessageTimeToLive", - "in": "query", - "required": false, - "type": "integer", - "minimum": -1, - "x-ms-parameter-location": "method", - "description": "Optional. Specifies the time-to-live interval for the message, in seconds. Prior to version 2017-07-29, the maximum time-to-live allowed is 7 days. For version 2017-07-29 or later, the maximum time-to-live can be any positive number, as well as -1 indicating that the message does not expire. If this parameter is omitted, the default time-to-live is 7 days." - }, - "Metadata": { - "name": "x-ms-meta", - "x-ms-client-name": "metadata", - "in": "header", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "description": "Optional. Include this parameter to specify that the queue's metadata be returned as part of the response body. Note that metadata requested with this parameter must be stored in accordance with the naming restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata names must adhere to the naming conventions for C# identifiers.", - "x-ms-header-collection-prefix": "x-ms-meta-" - }, - "NumOfMessages": { - "name": "numofmessages", - "x-ms-client-name": "numberOfMessages", - "in": "query", - "required": false, - "type": "integer", - "minimum": 1, - "x-ms-parameter-location": "method", - "description": "Optional. A nonzero integer value that specifies the number of messages to retrieve from the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single message is retrieved from the queue with this operation." - }, - "PopReceipt": { - "name": "popreceipt", - "x-ms-client-name": "popReceipt", - "in": "query", - "required": true, - "x-ms-parameter-location": "method", - "description": "Required. Specifies the valid pop receipt value returned from an earlier call to the Get Messages or Update Message operation.", - "type": "string" - }, - "Prefix": { - "name": "prefix", - "in": "query", - "required": false, - "type": "string", - "description": "Filters the results to return only queues whose name begins with the specified prefix.", - "x-ms-parameter-location": "method" - }, - "QueueMessage": { - "name": "QueueMessage", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/QueueMessage" - }, - "x-ms-parameter-location": "method", - "description": "A Message object which can be stored in a Queue" - }, - "QueueName": { - "name": "queueName", - "in": "path", - "required": true, - "type": "string", - "x-ms-parameter-location": "method", - "description": "The queue name." - }, - "StorageServiceProperties": { - "name": "StorageServiceProperties", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/StorageServiceProperties" - }, - "x-ms-parameter-location": "method", - "description": "The StorageService properties." - }, - "Timeout": { - "name": "timeout", - "in": "query", - "required": false, - "type": "integer", - "minimum": 0, - "x-ms-parameter-location": "method", - "description": "The The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Queue Service Operations." - }, - "VisibilityTimeout": { - "name": "visibilitytimeout", - "in": "query", - "required": false, - "type": "integer", - "minimum": 0, - "maximum": 604800, - "x-ms-parameter-location": "method", - "description": "Optional. Specifies the new visibility timeout value, in seconds, relative to server time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility timeout of a message can be set to a value later than the expiry time." - }, - "VisibilityTimeoutRequired": { - "name": "visibilitytimeout", - "in": "query", - "required": true, - "type": "integer", - "minimum": 0, - "maximum": 604800, - "x-ms-parameter-location": "method", - "description": "Optional. Specifies the new visibility timeout value, in seconds, relative to server time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility timeout of a message can be set to a value later than the expiry time." - } - } -} \ No newline at end of file diff --git a/sdk/template/azure-sdk-template/pom.xml b/sdk/template/azure-sdk-template/pom.xml index 3c5ff41f6fc2..0d15dd67d620 100644 --- a/sdk/template/azure-sdk-template/pom.xml +++ b/sdk/template/azure-sdk-template/pom.xml @@ -1,17 +1,16 @@ - + 4.0.0 com.azure azure-client-sdk-parent - 1.1.0 + 1.3.0 ../../../pom.client.xml azure-sdk-template - 1.0.2-SNAPSHOT - jar + 1.0.2 Microsoft Azure SDK for Template This package contains Microsoft Azure SDK for Template. @@ -23,9 +22,16 @@
- https://github.com/Azure/azure-sdk-for-java + + https://github.com/Azure/azure-sdk-for-java + + + com.azure + azure-core + 1.0.0-preview.3 + junit junit