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 datafactory/resource-manager] Webhook activity #3204

Merged
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 @@ -18,6 +18,7 @@
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonTypeName("Container")
@JsonSubTypes({
@JsonSubTypes.Type(name = "WebHook", value = WebHookActivity.class),
@JsonSubTypes.Type(name = "AppendVariable", value = AppendVariableActivity.class),
@JsonSubTypes.Type(name = "SetVariable", value = SetVariableActivity.class),
@JsonSubTypes.Type(name = "Filter", value = FilterActivity.class),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.datafactoryv2.v2018_06_01;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.microsoft.rest.serializer.JsonFlatten;

/**
* WebHook activity.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonTypeName("WebHook")
@JsonFlatten
public class WebHookActivity extends ControlActivity {
/**
* Rest API method for target endpoint.
*/
@JsonProperty(value = "typeProperties.method", required = true)
private String method;

/**
* WebHook activity target endpoint and path. Type: string (or Expression
* with resultType string).
*/
@JsonProperty(value = "typeProperties.url", required = true)
private Object url;

/**
* The timeout within which the webhook should be called back. If there is
* no value specified, it defaults to 10 minutes. Type: string. Pattern:
* ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])).
*/
@JsonProperty(value = "typeProperties.timeout")
private String timeout;

/**
* Represents the headers that will be sent to the request. For example, to
* set the language and type on a request: "headers" : { "Accept-Language":
* "en-us", "Content-Type": "application/json" }. Type: string (or
* Expression with resultType string).
*/
@JsonProperty(value = "typeProperties.headers")
private Object headers;

/**
* Represents the payload that will be sent to the endpoint. Required for
* POST/PUT method, not allowed for GET method Type: string (or Expression
* with resultType string).
*/
@JsonProperty(value = "typeProperties.body")
private Object body;

/**
* Authentication method used for calling the endpoint.
*/
@JsonProperty(value = "typeProperties.authentication")
private WebActivityAuthentication authentication;

/**
* Creates an instance of WebHookActivity class.
* @param url webHook activity target endpoint and path. Type: string (or Expression with resultType string).
*/
public WebHookActivity() {
method = "POST";
}

/**
* Get rest API method for target endpoint.
*
* @return the method value
*/
public String method() {
return this.method;
}

/**
* Set rest API method for target endpoint.
*
* @param method the method value to set
* @return the WebHookActivity object itself.
*/
public WebHookActivity withMethod(String method) {
this.method = method;
return this;
}

/**
* Get webHook activity target endpoint and path. Type: string (or Expression with resultType string).
*
* @return the url value
*/
public Object url() {
return this.url;
}

/**
* Set webHook activity target endpoint and path. Type: string (or Expression with resultType string).
*
* @param url the url value to set
* @return the WebHookActivity object itself.
*/
public WebHookActivity withUrl(Object url) {
this.url = url;
return this;
}

/**
* Get the timeout within which the webhook should be called back. If there is no value specified, it defaults to 10 minutes. Type: string. Pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])).
*
* @return the timeout value
*/
public String timeout() {
return this.timeout;
}

/**
* Set the timeout within which the webhook should be called back. If there is no value specified, it defaults to 10 minutes. Type: string. Pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])).
*
* @param timeout the timeout value to set
* @return the WebHookActivity object itself.
*/
public WebHookActivity withTimeout(String timeout) {
this.timeout = timeout;
return this;
}

/**
* Get represents the headers that will be sent to the request. For example, to set the language and type on a request: "headers" : { "Accept-Language": "en-us", "Content-Type": "application/json" }. Type: string (or Expression with resultType string).
*
* @return the headers value
*/
public Object headers() {
return this.headers;
}

/**
* Set represents the headers that will be sent to the request. For example, to set the language and type on a request: "headers" : { "Accept-Language": "en-us", "Content-Type": "application/json" }. Type: string (or Expression with resultType string).
*
* @param headers the headers value to set
* @return the WebHookActivity object itself.
*/
public WebHookActivity withHeaders(Object headers) {
this.headers = headers;
return this;
}

/**
* Get represents the payload that will be sent to the endpoint. Required for POST/PUT method, not allowed for GET method Type: string (or Expression with resultType string).
*
* @return the body value
*/
public Object body() {
return this.body;
}

/**
* Set represents the payload that will be sent to the endpoint. Required for POST/PUT method, not allowed for GET method Type: string (or Expression with resultType string).
*
* @param body the body value to set
* @return the WebHookActivity object itself.
*/
public WebHookActivity withBody(Object body) {
this.body = body;
return this;
}

/**
* Get authentication method used for calling the endpoint.
*
* @return the authentication value
*/
public WebActivityAuthentication authentication() {
return this.authentication;
}

/**
* Set authentication method used for calling the endpoint.
*
* @param authentication the authentication value to set
* @return the WebHookActivity object itself.
*/
public WebHookActivity withAuthentication(WebActivityAuthentication authentication) {
this.authentication = authentication;
return this;
}

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

import java.util.Collection;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.microsoft.rest.ExpandableStringEnum;

/**
* Defines values for WebHookActivityMethod.
*/
public final class WebHookActivityMethod extends ExpandableStringEnum<WebHookActivityMethod> {
/** Static value POST for WebHookActivityMethod. */
public static final WebHookActivityMethod POST = fromString("POST");

/**
* Creates or finds a WebHookActivityMethod from its string representation.
* @param name a name to look for
* @return the corresponding WebHookActivityMethod
*/
@JsonCreator
public static WebHookActivityMethod fromString(String name) {
return fromString(name, WebHookActivityMethod.class);
}

/**
* @return known WebHookActivityMethod values
*/
public static Collection<WebHookActivityMethod> values() {
return values(WebHookActivityMethod.class);
}
}