Skip to content

Commit

Permalink
Updated swagger for Storage
Browse files Browse the repository at this point in the history
  • Loading branch information
anudeepsharma committed Feb 22, 2017
1 parent b621823 commit c6c3d0d
Show file tree
Hide file tree
Showing 19 changed files with 64 additions and 47 deletions.
Expand Up @@ -19,13 +19,14 @@ public class CustomDomain {
* Gets or sets the custom domain name assigned to the storage account.
* Name is the CNAME source.
*/
@JsonProperty(required = true)
@JsonProperty(value = "name", required = true)
private String name;

/**
* Indicates whether indirect CName validation is enabled. Default value is
* false. This should only be set on updates.
*/
@JsonProperty(value = "useSubDomain")
private Boolean useSubDomain;

/**
Expand Down
Expand Up @@ -17,13 +17,14 @@ public class Encryption {
/**
* List of services which support encryption.
*/
@JsonProperty(value = "services")
private EncryptionServices services;

/**
* The encryption keySource (provider). Possible values (case-insensitive):
* Microsoft.Storage.
*/
@JsonProperty(required = true)
@JsonProperty(value = "keySource", required = true)
private String keySource;

/**
Expand Down
Expand Up @@ -19,6 +19,7 @@ public class EncryptionService {
* A boolean indicating whether or not the service encrypts the data as it
* is stored.
*/
@JsonProperty(value = "enabled")
private Boolean enabled;

/**
Expand All @@ -27,7 +28,7 @@ public class EncryptionService {
* might be some unencrypted blobs which were written after this time, as
* it is just a rough estimate.
*/
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@JsonProperty(value = "lastEnabledTime", access = JsonProperty.Access.WRITE_ONLY)
private DateTime lastEnabledTime;

/**
Expand Down
Expand Up @@ -8,6 +8,7 @@

package com.microsoft.azure.management.storage;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* A list of services that support encryption.
Expand All @@ -16,6 +17,7 @@ public class EncryptionServices {
/**
* The encryption function of the blob storage service.
*/
@JsonProperty(value = "blob")
private EncryptionService blob;

/**
Expand Down
Expand Up @@ -18,25 +18,25 @@ public class Endpoints {
/**
* Gets the blob endpoint.
*/
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@JsonProperty(value = "blob", access = JsonProperty.Access.WRITE_ONLY)
private String blob;

/**
* Gets the queue endpoint.
*/
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@JsonProperty(value = "queue", access = JsonProperty.Access.WRITE_ONLY)
private String queue;

/**
* Gets the table endpoint.
*/
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@JsonProperty(value = "table", access = JsonProperty.Access.WRITE_ONLY)
private String table;

/**
* Gets the file endpoint.
*/
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@JsonProperty(value = "file", access = JsonProperty.Access.WRITE_ONLY)
private String file;

/**
Expand Down
Expand Up @@ -20,14 +20,14 @@ public class Sku {
* Possible values include: 'Standard_LRS', 'Standard_GRS',
* 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS'.
*/
@JsonProperty(required = true)
@JsonProperty(value = "name", required = true)
private SkuName name;

/**
* Gets the sku tier. This is based on the SKU name. Possible values
* include: 'Standard', 'Premium'.
*/
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY)
private SkuTier tier;

/**
Expand Down
Expand Up @@ -17,13 +17,13 @@ public class StorageAccountCheckNameAvailabilityParameters {
/**
* The name property.
*/
@JsonProperty(required = true)
@JsonProperty(value = "name", required = true)
private String name;

/**
* The type property.
*/
@JsonProperty(required = true)
@JsonProperty(value = "type", required = true)
private String type;

/**
Expand Down
Expand Up @@ -17,20 +17,20 @@ public class StorageAccountKey {
/**
* Name of the key.
*/
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@JsonProperty(value = "keyName", access = JsonProperty.Access.WRITE_ONLY)
private String keyName;

/**
* Base 64-encoded value of the key.
*/
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY)
private String value;

/**
* Permissions for the key -- read-only or full permissions. Possible
* values include: 'READ', 'FULL'.
*/
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@JsonProperty(value = "permissions", access = JsonProperty.Access.WRITE_ONLY)
private KeyPermission permissions;

/**
Expand Down
Expand Up @@ -17,7 +17,7 @@ public class StorageAccountRegenerateKeyParameters {
/**
* The keyName property.
*/
@JsonProperty(required = true)
@JsonProperty(value = "keyName", required = true)
private String keyName;

/**
Expand Down
Expand Up @@ -17,13 +17,13 @@ public class UsageName {
/**
* Gets a string describing the resource name.
*/
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY)
private String value;

/**
* Gets a localized string describing the resource name.
*/
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY)
private String localizedValue;

/**
Expand Down
Expand Up @@ -20,21 +20,21 @@ public class CheckNameAvailabilityResultInner {
* you to use. If true, the name is available. If false, the name has
* already been taken or is invalid and cannot be used.
*/
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY)
private Boolean nameAvailable;

/**
* Gets the reason that a storage account name could not be used. The
* Reason element is only returned if NameAvailable is false. Possible
* values include: 'AccountNameInvalid', 'AlreadyExists'.
*/
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY)
private Reason reason;

/**
* Gets an error message explaining the Reason value in more detail.
*/
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY)
private String message;

/**
Expand Down
Expand Up @@ -25,14 +25,14 @@ public class StorageAccountCreateParametersInner {
/**
* Required. Gets or sets the sku name.
*/
@JsonProperty(required = true)
@JsonProperty(value = "sku", required = true)
private Sku sku;

/**
* Required. Indicates the type of storage account. Possible values
* include: 'Storage', 'BlobStorage'.
*/
@JsonProperty(required = true)
@JsonProperty(value = "kind", required = true)
private Kind kind;

/**
Expand All @@ -42,7 +42,7 @@ public class StorageAccountCreateParametersInner {
* once it is created, but if an identical geo region is specified on
* update, the request will succeed.
*/
@JsonProperty(required = true)
@JsonProperty(value = "location", required = true)
private String location;

/**
Expand All @@ -52,6 +52,7 @@ public class StorageAccountCreateParametersInner {
* must have a key with a length no greater than 128 characters and a value
* with a length no greater than 256 characters.
*/
@JsonProperty(value = "tags")
private Map<String, String> tags;

/**
Expand Down
Expand Up @@ -29,13 +29,13 @@ public class StorageAccountInner extends Resource {
/**
* Gets the SKU.
*/
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY)
private Sku sku;

/**
* Gets the Kind. Possible values include: 'Storage', 'BlobStorage'.
*/
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY)
private Kind kind;

/**
Expand Down
Expand Up @@ -20,7 +20,7 @@ public class StorageAccountListKeysResultInner {
* Gets the list of storage account keys and their properties for the
* specified storage account.
*/
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@JsonProperty(value = "keys", access = JsonProperty.Access.WRITE_ONLY)
private List<StorageAccountKey> keys;

/**
Expand Down
Expand Up @@ -27,6 +27,7 @@ public class StorageAccountUpdateParametersInner {
* Standard_ZRS or Premium_LRS, nor can accounts of those sku names be
* updated to any other value.
*/
@JsonProperty(value = "sku")
private Sku sku;

/**
Expand All @@ -36,6 +37,7 @@ public class StorageAccountUpdateParametersInner {
* must have a key no greater in length than 128 characters and a value no
* greater in length than 256 characters.
*/
@JsonProperty(value = "tags")
private Map<String, String> tags;

/**
Expand Down
Expand Up @@ -8,13 +8,15 @@

package com.microsoft.azure.management.storage.implementation;

import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsListing;
import retrofit2.Retrofit;
import com.google.common.reflect.TypeToken;
import com.microsoft.azure.CloudException;
import com.microsoft.azure.management.storage.StorageAccountCheckNameAvailabilityParameters;
import com.microsoft.azure.management.storage.StorageAccountRegenerateKeyParameters;
import com.microsoft.rest.ServiceFuture;
import com.microsoft.azure.Page;
import com.microsoft.rest.ServiceCallback;
import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.ServiceResponse;
import com.microsoft.rest.Validator;
import java.io.IOException;
Expand All @@ -38,7 +40,7 @@
* An instance of this class provides access to all the operations defined
* in StorageAccounts.
*/
public final class StorageAccountsInner {
public class StorageAccountsInner implements InnerSupportsListing<StorageAccountInner> {
/** The Retrofit service to perform REST calls. */
private StorageAccountsService service;
/** The service client containing this operation class. */
Expand Down Expand Up @@ -608,11 +610,13 @@ public ServiceFuture<List<StorageAccountInner>> listAsync(final ServiceCallback<
*
* @return the observable to the List&lt;StorageAccountInner&gt; object
*/
public Observable<List<StorageAccountInner>> listAsync() {
return listWithServiceResponseAsync().map(new Func1<ServiceResponse<List<StorageAccountInner>>, List<StorageAccountInner>>() {
public Observable<Page<StorageAccountInner>> listAsync() {
return listWithServiceResponseAsync().map(new Func1<ServiceResponse<List<StorageAccountInner>>, Page<StorageAccountInner>>() {
@Override
public List<StorageAccountInner> call(ServiceResponse<List<StorageAccountInner>> response) {
return response.body();
public Page<StorageAccountInner> call(ServiceResponse<List<StorageAccountInner>> response) {
PageImpl<StorageAccountInner> page = new PageImpl<>();
page.setItems(response.body());
return page;
}
});
}
Expand Down Expand Up @@ -678,11 +682,13 @@ public ServiceFuture<List<StorageAccountInner>> listByResourceGroupAsync(String
* @param resourceGroupName The name of the resource group within the user's subscription.
* @return the observable to the List&lt;StorageAccountInner&gt; object
*/
public Observable<List<StorageAccountInner>> listByResourceGroupAsync(String resourceGroupName) {
return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1<ServiceResponse<List<StorageAccountInner>>, List<StorageAccountInner>>() {
public Observable<Page<StorageAccountInner>> listByResourceGroupAsync(String resourceGroupName) {
return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1<ServiceResponse<List<StorageAccountInner>>, Page<StorageAccountInner>>() {
@Override
public List<StorageAccountInner> call(ServiceResponse<List<StorageAccountInner>> response) {
return response.body();
public Page<StorageAccountInner> call(ServiceResponse<List<StorageAccountInner>> response) {
PageImpl<StorageAccountInner> page = new PageImpl<>();
page.setItems(response.body());
return page;
}
});
}
Expand Down
Expand Up @@ -16,7 +16,7 @@
/**
* Initializes a new instance of the StorageManagementClientImpl class.
*/
public final class StorageManagementClientImpl extends AzureServiceClient {
public class StorageManagementClientImpl extends AzureServiceClient {
/** the {@link AzureClient} used for long running operations. */
private AzureClient azureClient;

Expand Down
Expand Up @@ -20,26 +20,26 @@ public class UsageInner {
* Gets the unit of measurement. Possible values include: 'Count', 'Bytes',
* 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond'.
*/
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY)
private UsageUnit unit;

/**
* Gets the current count of the allocated resources in the subscription.
*/
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY)
private Integer currentValue;

/**
* Gets the maximum count of the resources that can be allocated in the
* subscription.
*/
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY)
private Integer limit;

/**
* Gets the name of the type of usage.
*/
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
private UsageName name;

/**
Expand Down

0 comments on commit c6c3d0d

Please sign in to comment.