com.azure.ai.metricsadvisor.implementation.models.WebhookHookParameter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-ai-metricsadvisor Show documentation
Show all versions of azure-ai-metricsadvisor Show documentation
This package contains the Microsoft Azure Cognitive Services Metrics Advisor SDK.
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.ai.metricsadvisor.implementation.models;
import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.util.Map;
/**
* The WebhookHookParameter model.
*/
@Fluent
public final class WebhookHookParameter implements JsonSerializable {
/*
* API address, will be called when alert is triggered, only support POST method via SSL
*/
private String endpoint;
/*
* (Deprecated) The username, if using basic authentication
*/
private String username;
/*
* (Deprecated) The password, if using basic authentication
*/
private String password;
/*
* custom headers in api call
*/
private Map headers;
/*
* The certificate key/URL, if using client certificate, please read documents for more informations.
*/
private String certificateKey;
/*
* The certificate password, if using client certificate, please read documents for more informations.
*/
private String certificatePassword;
/**
* Creates an instance of WebhookHookParameter class.
*/
public WebhookHookParameter() {
}
/**
* Get the endpoint property: API address, will be called when alert is triggered, only support POST method via
* SSL.
*
* @return the endpoint value.
*/
public String getEndpoint() {
return this.endpoint;
}
/**
* Set the endpoint property: API address, will be called when alert is triggered, only support POST method via
* SSL.
*
* @param endpoint the endpoint value to set.
* @return the WebhookHookParameter object itself.
*/
public WebhookHookParameter setEndpoint(String endpoint) {
this.endpoint = endpoint;
return this;
}
/**
* Get the username property: (Deprecated) The username, if using basic authentication.
*
* @return the username value.
*/
public String getUsername() {
return this.username;
}
/**
* Set the username property: (Deprecated) The username, if using basic authentication.
*
* @param username the username value to set.
* @return the WebhookHookParameter object itself.
*/
public WebhookHookParameter setUsername(String username) {
this.username = username;
return this;
}
/**
* Get the password property: (Deprecated) The password, if using basic authentication.
*
* @return the password value.
*/
public String getPassword() {
return this.password;
}
/**
* Set the password property: (Deprecated) The password, if using basic authentication.
*
* @param password the password value to set.
* @return the WebhookHookParameter object itself.
*/
public WebhookHookParameter setPassword(String password) {
this.password = password;
return this;
}
/**
* Get the headers property: custom headers in api call.
*
* @return the headers value.
*/
public Map getHeaders() {
return this.headers;
}
/**
* Set the headers property: custom headers in api call.
*
* @param headers the headers value to set.
* @return the WebhookHookParameter object itself.
*/
public WebhookHookParameter setHeaders(Map headers) {
this.headers = headers;
return this;
}
/**
* Get the certificateKey property: The certificate key/URL, if using client certificate, please read documents for
* more informations.
*
* @return the certificateKey value.
*/
public String getCertificateKey() {
return this.certificateKey;
}
/**
* Set the certificateKey property: The certificate key/URL, if using client certificate, please read documents for
* more informations.
*
* @param certificateKey the certificateKey value to set.
* @return the WebhookHookParameter object itself.
*/
public WebhookHookParameter setCertificateKey(String certificateKey) {
this.certificateKey = certificateKey;
return this;
}
/**
* Get the certificatePassword property: The certificate password, if using client certificate, please read
* documents for more informations.
*
* @return the certificatePassword value.
*/
public String getCertificatePassword() {
return this.certificatePassword;
}
/**
* Set the certificatePassword property: The certificate password, if using client certificate, please read
* documents for more informations.
*
* @param certificatePassword the certificatePassword value to set.
* @return the WebhookHookParameter object itself.
*/
public WebhookHookParameter setCertificatePassword(String certificatePassword) {
this.certificatePassword = certificatePassword;
return this;
}
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("endpoint", this.endpoint);
jsonWriter.writeStringField("username", this.username);
jsonWriter.writeStringField("password", this.password);
jsonWriter.writeMapField("headers", this.headers, (writer, element) -> writer.writeString(element));
jsonWriter.writeStringField("certificateKey", this.certificateKey);
jsonWriter.writeStringField("certificatePassword", this.certificatePassword);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of WebhookHookParameter from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of WebhookHookParameter if the JsonReader was pointing to an instance of it, or null if it
* was pointing to JSON null.
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
* @throws IOException If an error occurs while reading the WebhookHookParameter.
*/
public static WebhookHookParameter fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
WebhookHookParameter deserializedWebhookHookParameter = new WebhookHookParameter();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("endpoint".equals(fieldName)) {
deserializedWebhookHookParameter.endpoint = reader.getString();
} else if ("username".equals(fieldName)) {
deserializedWebhookHookParameter.username = reader.getString();
} else if ("password".equals(fieldName)) {
deserializedWebhookHookParameter.password = reader.getString();
} else if ("headers".equals(fieldName)) {
Map headers = reader.readMap(reader1 -> reader1.getString());
deserializedWebhookHookParameter.headers = headers;
} else if ("certificateKey".equals(fieldName)) {
deserializedWebhookHookParameter.certificateKey = reader.getString();
} else if ("certificatePassword".equals(fieldName)) {
deserializedWebhookHookParameter.certificatePassword = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedWebhookHookParameter;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy