Class CreateAlertPolicyRequest.Builder (3.31.0)

public static final class CreateAlertPolicyRequest.Builder extends GeneratedMessageV3.Builder<CreateAlertPolicyRequest.Builder> implements CreateAlertPolicyRequestOrBuilder

The protocol for the CreateAlertPolicy request.

Protobuf type google.monitoring.v3.CreateAlertPolicyRequest

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public CreateAlertPolicyRequest.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
CreateAlertPolicyRequest.Builder
Overrides

build()

public CreateAlertPolicyRequest build()
Returns
TypeDescription
CreateAlertPolicyRequest

buildPartial()

public CreateAlertPolicyRequest buildPartial()
Returns
TypeDescription
CreateAlertPolicyRequest

clear()

public CreateAlertPolicyRequest.Builder clear()
Returns
TypeDescription
CreateAlertPolicyRequest.Builder
Overrides

clearAlertPolicy()

public CreateAlertPolicyRequest.Builder clearAlertPolicy()

Required. The requested alerting policy. You should omit the name field in this policy. The name will be returned in the new policy, including a new [ALERT_POLICY_ID] value.

.google.monitoring.v3.AlertPolicy alert_policy = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
CreateAlertPolicyRequest.Builder

clearField(Descriptors.FieldDescriptor field)

public CreateAlertPolicyRequest.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
CreateAlertPolicyRequest.Builder
Overrides

clearName()

public CreateAlertPolicyRequest.Builder clearName()

Required. The project in which to create the alerting policy. The format is:

 projects/[PROJECT_ID_OR_NUMBER]

Note that this field names the parent container in which the alerting policy will be written, not the name of the created policy. |name| must be a host project of a Metrics Scope, otherwise INVALID_ARGUMENT error will return. The alerting policy that is returned will have a name that contains a normalized representation of this name as a prefix but adds a suffix of the form /alertPolicies/[ALERT_POLICY_ID], identifying the policy in the container.

string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
CreateAlertPolicyRequest.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public CreateAlertPolicyRequest.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
CreateAlertPolicyRequest.Builder
Overrides

clone()

public CreateAlertPolicyRequest.Builder clone()
Returns
TypeDescription
CreateAlertPolicyRequest.Builder
Overrides

getAlertPolicy()

public AlertPolicy getAlertPolicy()

Required. The requested alerting policy. You should omit the name field in this policy. The name will be returned in the new policy, including a new [ALERT_POLICY_ID] value.

.google.monitoring.v3.AlertPolicy alert_policy = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
AlertPolicy

The alertPolicy.

getAlertPolicyBuilder()

public AlertPolicy.Builder getAlertPolicyBuilder()

Required. The requested alerting policy. You should omit the name field in this policy. The name will be returned in the new policy, including a new [ALERT_POLICY_ID] value.

.google.monitoring.v3.AlertPolicy alert_policy = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
AlertPolicy.Builder

getAlertPolicyOrBuilder()

public AlertPolicyOrBuilder getAlertPolicyOrBuilder()

Required. The requested alerting policy. You should omit the name field in this policy. The name will be returned in the new policy, including a new [ALERT_POLICY_ID] value.

.google.monitoring.v3.AlertPolicy alert_policy = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
AlertPolicyOrBuilder

getDefaultInstanceForType()

public CreateAlertPolicyRequest getDefaultInstanceForType()
Returns
TypeDescription
CreateAlertPolicyRequest

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getName()

public String getName()

Required. The project in which to create the alerting policy. The format is:

 projects/[PROJECT_ID_OR_NUMBER]

Note that this field names the parent container in which the alerting policy will be written, not the name of the created policy. |name| must be a host project of a Metrics Scope, otherwise INVALID_ARGUMENT error will return. The alerting policy that is returned will have a name that contains a normalized representation of this name as a prefix but adds a suffix of the form /alertPolicies/[ALERT_POLICY_ID], identifying the policy in the container.

string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

Required. The project in which to create the alerting policy. The format is:

 projects/[PROJECT_ID_OR_NUMBER]

Note that this field names the parent container in which the alerting policy will be written, not the name of the created policy. |name| must be a host project of a Metrics Scope, otherwise INVALID_ARGUMENT error will return. The alerting policy that is returned will have a name that contains a normalized representation of this name as a prefix but adds a suffix of the form /alertPolicies/[ALERT_POLICY_ID], identifying the policy in the container.

string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
ByteString

The bytes for name.

hasAlertPolicy()

public boolean hasAlertPolicy()

Required. The requested alerting policy. You should omit the name field in this policy. The name will be returned in the new policy, including a new [ALERT_POLICY_ID] value.

.google.monitoring.v3.AlertPolicy alert_policy = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
boolean

Whether the alertPolicy field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeAlertPolicy(AlertPolicy value)

public CreateAlertPolicyRequest.Builder mergeAlertPolicy(AlertPolicy value)

Required. The requested alerting policy. You should omit the name field in this policy. The name will be returned in the new policy, including a new [ALERT_POLICY_ID] value.

.google.monitoring.v3.AlertPolicy alert_policy = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueAlertPolicy
Returns
TypeDescription
CreateAlertPolicyRequest.Builder

mergeFrom(CreateAlertPolicyRequest other)

public CreateAlertPolicyRequest.Builder mergeFrom(CreateAlertPolicyRequest other)
Parameter
NameDescription
otherCreateAlertPolicyRequest
Returns
TypeDescription
CreateAlertPolicyRequest.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public CreateAlertPolicyRequest.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CreateAlertPolicyRequest.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public CreateAlertPolicyRequest.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
CreateAlertPolicyRequest.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final CreateAlertPolicyRequest.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
CreateAlertPolicyRequest.Builder
Overrides

setAlertPolicy(AlertPolicy value)

public CreateAlertPolicyRequest.Builder setAlertPolicy(AlertPolicy value)

Required. The requested alerting policy. You should omit the name field in this policy. The name will be returned in the new policy, including a new [ALERT_POLICY_ID] value.

.google.monitoring.v3.AlertPolicy alert_policy = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueAlertPolicy
Returns
TypeDescription
CreateAlertPolicyRequest.Builder

setAlertPolicy(AlertPolicy.Builder builderForValue)

public CreateAlertPolicyRequest.Builder setAlertPolicy(AlertPolicy.Builder builderForValue)

Required. The requested alerting policy. You should omit the name field in this policy. The name will be returned in the new policy, including a new [ALERT_POLICY_ID] value.

.google.monitoring.v3.AlertPolicy alert_policy = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
builderForValueAlertPolicy.Builder
Returns
TypeDescription
CreateAlertPolicyRequest.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public CreateAlertPolicyRequest.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
CreateAlertPolicyRequest.Builder
Overrides

setName(String value)

public CreateAlertPolicyRequest.Builder setName(String value)

Required. The project in which to create the alerting policy. The format is:

 projects/[PROJECT_ID_OR_NUMBER]

Note that this field names the parent container in which the alerting policy will be written, not the name of the created policy. |name| must be a host project of a Metrics Scope, otherwise INVALID_ARGUMENT error will return. The alerting policy that is returned will have a name that contains a normalized representation of this name as a prefix but adds a suffix of the form /alertPolicies/[ALERT_POLICY_ID], identifying the policy in the container.

string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueString

The name to set.

Returns
TypeDescription
CreateAlertPolicyRequest.Builder

This builder for chaining.

setNameBytes(ByteString value)

public CreateAlertPolicyRequest.Builder setNameBytes(ByteString value)

Required. The project in which to create the alerting policy. The format is:

 projects/[PROJECT_ID_OR_NUMBER]

Note that this field names the parent container in which the alerting policy will be written, not the name of the created policy. |name| must be a host project of a Metrics Scope, otherwise INVALID_ARGUMENT error will return. The alerting policy that is returned will have a name that contains a normalized representation of this name as a prefix but adds a suffix of the form /alertPolicies/[ALERT_POLICY_ID], identifying the policy in the container.

string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
CreateAlertPolicyRequest.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public CreateAlertPolicyRequest.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
CreateAlertPolicyRequest.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final CreateAlertPolicyRequest.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
CreateAlertPolicyRequest.Builder
Overrides