Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR billing/resource-manager] [Hub Generated] Review request for Microsoft.Billing to add version preview/2018-11-01-preview #3648

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.billing.v2018_11_01_preview;

import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* The parameters for creating a new billing profile.
*/
public class BillingProfileCreationParameters {
/**
* 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 Address address;

/**
* If the billing profile is opted in to receive invoices via email.
*/
@JsonProperty(value = "invoiceEmailOptIn")
private Boolean invoiceEmailOptIn;

/**
* Azure skus to enable for this billing profile..
*/
@JsonProperty(value = "enableAzureSKUs")
private List<EnabledAzureSKUs> enableAzureSKUs;

/**
* Create azure subscriptions when creating this billing profile.
*/
@JsonProperty(value = "createAzureSubscriptions")
private Boolean createAzureSubscriptions;

/**
* 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 BillingProfileCreationParameters object itself.
*/
public BillingProfileCreationParameters 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 BillingProfileCreationParameters object itself.
*/
public BillingProfileCreationParameters withPoNumber(String poNumber) {
this.poNumber = poNumber;
return this;
}

/**
* Get billing address.
*
* @return the address value
*/
public Address address() {
return this.address;
}

/**
* Set billing address.
*
* @param address the address value to set
* @return the BillingProfileCreationParameters object itself.
*/
public BillingProfileCreationParameters withAddress(Address 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 BillingProfileCreationParameters object itself.
*/
public BillingProfileCreationParameters withInvoiceEmailOptIn(Boolean invoiceEmailOptIn) {
this.invoiceEmailOptIn = invoiceEmailOptIn;
return this;
}

/**
* Get azure skus to enable for this billing profile..
*
* @return the enableAzureSKUs value
*/
public List<EnabledAzureSKUs> enableAzureSKUs() {
return this.enableAzureSKUs;
}

/**
* Set azure skus to enable for this billing profile..
*
* @param enableAzureSKUs the enableAzureSKUs value to set
* @return the BillingProfileCreationParameters object itself.
*/
public BillingProfileCreationParameters withEnableAzureSKUs(List<EnabledAzureSKUs> enableAzureSKUs) {
this.enableAzureSKUs = enableAzureSKUs;
return this;
}

/**
* Get create azure subscriptions when creating this billing profile.
*
* @return the createAzureSubscriptions value
*/
public Boolean createAzureSubscriptions() {
return this.createAzureSubscriptions;
}

/**
* Set create azure subscriptions when creating this billing profile.
*
* @param createAzureSubscriptions the createAzureSubscriptions value to set
* @return the BillingProfileCreationParameters object itself.
*/
public BillingProfileCreationParameters withCreateAzureSubscriptions(Boolean createAzureSubscriptions) {
this.createAzureSubscriptions = createAzureSubscriptions;
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,14 @@ public interface BillingProfiles extends HasInner<BillingProfilesInner> {
*/
Observable<BillingProfile> getAsync(String billingAccountName, String billingProfileName);

/**
* The operation to create a BillingProfile.
*
* @param billingAccountName billing Account Id.
* @param parameters Parameters supplied to the Create BillingProfile operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<BillingProfile> createAsync(String billingAccountName, BillingProfileCreationParameters parameters);

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

/**
* URI to poll for the operation status.
*/
@JsonProperty(value = "Azure-AsyncOperation")
private String azureAsyncOperation;

/**
* 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;
}

/**
* Get uRI to poll for the operation status.
*
* @return the azureAsyncOperation value
*/
public String azureAsyncOperation() {
return this.azureAsyncOperation;
}

/**
* Set uRI to poll for the operation status.
*
* @param azureAsyncOperation the azureAsyncOperation value to set
* @return the BillingProfilesCreateHeaders object itself.
*/
public BillingProfilesCreateHeaders withAzureAsyncOperation(String azureAsyncOperation) {
this.azureAsyncOperation = azureAsyncOperation;
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import rx.functions.Func1;
import com.microsoft.azure.management.billing.v2018_11_01_preview.BillingProfileListResult;
import com.microsoft.azure.management.billing.v2018_11_01_preview.BillingProfile;
import com.microsoft.azure.management.billing.v2018_11_01_preview.BillingProfileCreationParameters;

class BillingProfilesImpl extends WrapperImpl<BillingProfilesInner> implements BillingProfiles {
private final BillingManager manager;
Expand Down Expand Up @@ -56,4 +57,16 @@ public BillingProfile call(BillingProfileInner inner) {
});
}

@Override
public Observable<BillingProfile> createAsync(String billingAccountName, BillingProfileCreationParameters parameters) {
BillingProfilesInner client = this.inner();
return client.createAsync(billingAccountName, parameters)
.map(new Func1<BillingProfileInner, BillingProfile>() {
@Override
public BillingProfile call(BillingProfileInner inner) {
return new BillingProfileImpl(inner, manager());
}
});
}

}
Loading