Skip to content

Commit

Permalink
[AutoPR storage/resource-manager] [DO NOT REVIEW/MERGE] Swagger for L…
Browse files Browse the repository at this point in the history
…ease Container API from Oct17 to latest (#3225)

* Generated from 0b71805755e6dd434edbb7298b88a62b0fbd7ec3

remove duplicate x-ms-enum extension on action

* Generated from 52eb48baf153b3091179418b56191d3260b514b8

Fix new API definition section positioning in the json schema

* Generated from be4b9c83e9d49face2ad12d82c2cc978a0e7701b

Camel-case property names
  • Loading branch information
AutorestCI authored Mar 30, 2019
1 parent 0e534b8 commit 79aa998
Show file tree
Hide file tree
Showing 21 changed files with 1,502 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,17 @@ public interface BlobContainers {
*/
Observable<LegalHold> clearLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List<String> tags);

/**
* The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite.
*
* @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
* @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<LeaseContainerResponse> leaseAsync(String resourceGroupName, String accountName, String containerName);

/**
* Gets the existing immutability policy along with the corresponding ETag in response headers and body.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

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

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Lease Container request schema.
*/
public class LeaseContainerRequest {
/**
* Specifies the lease action. Can be one of the available actions.
* Possible values include: 'Acquire', 'Renew', 'Change', 'Release',
* 'Break'.
*/
@JsonProperty(value = "action", required = true)
private String action;

/**
* Identifies the lease. Can be specified in any valid GUID string format.
*/
@JsonProperty(value = "leaseId")
private String leaseId;

/**
* Optional. For a break action, proposed duration the lease should
* continue before it is broken, in seconds, between 0 and 60.
*/
@JsonProperty(value = "breakPeriod")
private Integer breakPeriod;

/**
* Required for acquire. Specifies the duration of the lease, in seconds,
* or negative one (-1) for a lease that never expires.
*/
@JsonProperty(value = "leaseDuration")
private Integer leaseDuration;

/**
* Optional for acquire, required for change. Proposed lease ID, in a GUID
* string format.
*/
@JsonProperty(value = "proposedLeaseId")
private String proposedLeaseId;

/**
* Get specifies the lease action. Can be one of the available actions. Possible values include: 'Acquire', 'Renew', 'Change', 'Release', 'Break'.
*
* @return the action value
*/
public String action() {
return this.action;
}

/**
* Set specifies the lease action. Can be one of the available actions. Possible values include: 'Acquire', 'Renew', 'Change', 'Release', 'Break'.
*
* @param action the action value to set
* @return the LeaseContainerRequest object itself.
*/
public LeaseContainerRequest withAction(String action) {
this.action = action;
return this;
}

/**
* Get identifies the lease. Can be specified in any valid GUID string format.
*
* @return the leaseId value
*/
public String leaseId() {
return this.leaseId;
}

/**
* Set identifies the lease. Can be specified in any valid GUID string format.
*
* @param leaseId the leaseId value to set
* @return the LeaseContainerRequest object itself.
*/
public LeaseContainerRequest withLeaseId(String leaseId) {
this.leaseId = leaseId;
return this;
}

/**
* Get optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60.
*
* @return the breakPeriod value
*/
public Integer breakPeriod() {
return this.breakPeriod;
}

/**
* Set optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60.
*
* @param breakPeriod the breakPeriod value to set
* @return the LeaseContainerRequest object itself.
*/
public LeaseContainerRequest withBreakPeriod(Integer breakPeriod) {
this.breakPeriod = breakPeriod;
return this;
}

/**
* Get required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires.
*
* @return the leaseDuration value
*/
public Integer leaseDuration() {
return this.leaseDuration;
}

/**
* Set required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires.
*
* @param leaseDuration the leaseDuration value to set
* @return the LeaseContainerRequest object itself.
*/
public LeaseContainerRequest withLeaseDuration(Integer leaseDuration) {
this.leaseDuration = leaseDuration;
return this;
}

/**
* Get optional for acquire, required for change. Proposed lease ID, in a GUID string format.
*
* @return the proposedLeaseId value
*/
public String proposedLeaseId() {
return this.proposedLeaseId;
}

/**
* Set optional for acquire, required for change. Proposed lease ID, in a GUID string format.
*
* @param proposedLeaseId the proposedLeaseId value to set
* @return the LeaseContainerRequest object itself.
*/
public LeaseContainerRequest withProposedLeaseId(String proposedLeaseId) {
this.proposedLeaseId = proposedLeaseId;
return this;
}

}
Original file line number Diff line number Diff line change
@@ -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.storage.v2018_02_01;

import com.microsoft.azure.arm.model.HasInner;
import com.microsoft.azure.arm.resources.models.HasManager;
import com.microsoft.azure.management.storage.v2018_02_01.implementation.StorageManager;
import com.microsoft.azure.management.storage.v2018_02_01.implementation.LeaseContainerResponseInner;

/**
* Type representing LeaseContainerResponse.
*/
public interface LeaseContainerResponse extends HasInner<LeaseContainerResponseInner>, HasManager<StorageManager> {
/**
* @return the leaseId value.
*/
String leaseId();

/**
* @return the leaseTimeSeconds value.
*/
String leaseTimeSeconds();

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.microsoft.azure.management.storage.v2018_02_01.ListContainerItems;
import com.microsoft.azure.management.storage.v2018_02_01.BlobContainer;
import com.microsoft.azure.management.storage.v2018_02_01.LegalHold;
import com.microsoft.azure.management.storage.v2018_02_01.LeaseContainerResponse;
import java.util.List;
import com.microsoft.azure.management.storage.v2018_02_01.ImmutabilityPolicy;

Expand Down Expand Up @@ -120,6 +121,18 @@ public LegalHold call(LegalHoldInner inner) {
});
}

@Override
public Observable<LeaseContainerResponse> leaseAsync(String resourceGroupName, String accountName, String containerName) {
BlobContainersInner client = this.inner();
return client.leaseAsync(resourceGroupName, accountName, containerName)
.map(new Func1<LeaseContainerResponseInner, LeaseContainerResponse>() {
@Override
public LeaseContainerResponse call(LeaseContainerResponseInner inner) {
return new LeaseContainerResponseImpl(inner, manager());
}
});
}

@Override
public Observable<ImmutabilityPolicy> getImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName) {
BlobContainersInner client = this.inner();
Expand Down
Loading

0 comments on commit 79aa998

Please sign in to comment.