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 monitor/resource-manager] Nithin/action group webhooks with azure active directory integration #3979

Merged
merged 1 commit into from
Jun 18, 2019
Merged
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
Expand Up @@ -33,6 +33,30 @@ public class WebhookReceiver {
@JsonProperty(value = "useCommonAlertSchema", required = true)
private boolean useCommonAlertSchema;

/**
* Indicates whether or not use AAD authentication.
*/
@JsonProperty(value = "useAadAuth")
private Boolean useAadAuth;

/**
* Indicates the webhook app object Id for aad auth.
*/
@JsonProperty(value = "objectId")
private String objectId;

/**
* Indicates the identifier uri for aad auth.
*/
@JsonProperty(value = "identifierUri")
private String identifierUri;

/**
* Indicates the tenant id for aad auth.
*/
@JsonProperty(value = "tenantId")
private String tenantId;

/**
* Get the name of the webhook receiver. Names must be unique across all receivers within an action group.
*
Expand Down Expand Up @@ -93,4 +117,84 @@ public WebhookReceiver withUseCommonAlertSchema(boolean useCommonAlertSchema) {
return this;
}

/**
* Get indicates whether or not use AAD authentication.
*
* @return the useAadAuth value
*/
public Boolean useAadAuth() {
return this.useAadAuth;
}

/**
* Set indicates whether or not use AAD authentication.
*
* @param useAadAuth the useAadAuth value to set
* @return the WebhookReceiver object itself.
*/
public WebhookReceiver withUseAadAuth(Boolean useAadAuth) {
this.useAadAuth = useAadAuth;
return this;
}

/**
* Get indicates the webhook app object Id for aad auth.
*
* @return the objectId value
*/
public String objectId() {
return this.objectId;
}

/**
* Set indicates the webhook app object Id for aad auth.
*
* @param objectId the objectId value to set
* @return the WebhookReceiver object itself.
*/
public WebhookReceiver withObjectId(String objectId) {
this.objectId = objectId;
return this;
}

/**
* Get indicates the identifier uri for aad auth.
*
* @return the identifierUri value
*/
public String identifierUri() {
return this.identifierUri;
}

/**
* Set indicates the identifier uri for aad auth.
*
* @param identifierUri the identifierUri value to set
* @return the WebhookReceiver object itself.
*/
public WebhookReceiver withIdentifierUri(String identifierUri) {
this.identifierUri = identifierUri;
return this;
}

/**
* Get indicates the tenant id for aad auth.
*
* @return the tenantId value
*/
public String tenantId() {
return this.tenantId;
}

/**
* Set indicates the tenant id for aad auth.
*
* @param tenantId the tenantId value to set
* @return the WebhookReceiver object itself.
*/
public WebhookReceiver withTenantId(String tenantId) {
this.tenantId = tenantId;
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public Observable<ServiceResponse<ActionGroupResourceInner>> createOrUpdateWithS
throw new IllegalArgumentException("Parameter actionGroup is required and cannot be null.");
}
Validator.validate(actionGroup);
final String apiVersion = "2019-03-01";
final String apiVersion = "2019-06-01";
return service.createOrUpdate(resourceGroupName, actionGroupName, this.client.subscriptionId(), actionGroup, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ActionGroupResourceInner>>>() {
@Override
Expand Down Expand Up @@ -250,7 +250,7 @@ public Observable<ServiceResponse<ActionGroupResourceInner>> getByResourceGroupW
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2019-03-01";
final String apiVersion = "2019-06-01";
return service.getByResourceGroup(resourceGroupName, actionGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ActionGroupResourceInner>>>() {
@Override
Expand Down Expand Up @@ -333,7 +333,7 @@ public Observable<ServiceResponse<Void>> deleteWithServiceResponseAsync(String r
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2019-03-01";
final String apiVersion = "2019-06-01";
return service.delete(resourceGroupName, actionGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
@Override
Expand Down Expand Up @@ -426,7 +426,7 @@ public Observable<ServiceResponse<ActionGroupResourceInner>> updateWithServiceRe
throw new IllegalArgumentException("Parameter actionGroupPatch is required and cannot be null.");
}
Validator.validate(actionGroupPatch);
final String apiVersion = "2019-03-01";
final String apiVersion = "2019-06-01";
return service.update(this.client.subscriptionId(), resourceGroupName, actionGroupName, apiVersion, actionGroupPatch, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ActionGroupResourceInner>>>() {
@Override
Expand Down Expand Up @@ -500,7 +500,7 @@ public Observable<ServiceResponse<List<ActionGroupResourceInner>>> listWithServi
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2019-03-01";
final String apiVersion = "2019-06-01";
return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<ActionGroupResourceInner>>>>() {
@Override
Expand Down Expand Up @@ -586,7 +586,7 @@ public Observable<ServiceResponse<List<ActionGroupResourceInner>>> listByResourc
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2019-03-01";
final String apiVersion = "2019-06-01";
return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<ActionGroupResourceInner>>>>() {
@Override
Expand Down Expand Up @@ -681,7 +681,7 @@ public Observable<ServiceResponse<Void>> enableReceiverWithServiceResponseAsync(
if (receiverName == null) {
throw new IllegalArgumentException("Parameter receiverName is required and cannot be null.");
}
final String apiVersion = "2019-03-01";
final String apiVersion = "2019-06-01";
EnableRequest enableRequest = new EnableRequest();
enableRequest.withReceiverName(receiverName);
return service.enableReceiver(resourceGroupName, actionGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), enableRequest, this.client.userAgent())
Expand Down