Class CreateAlertPolicyRequest.Builder (3.48.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
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public CreateAlertPolicyRequest.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
CreateAlertPolicyRequest.Builder
Overrides

build()

public CreateAlertPolicyRequest build()
Returns
Type Description
CreateAlertPolicyRequest

buildPartial()

public CreateAlertPolicyRequest buildPartial()
Returns
Type Description
CreateAlertPolicyRequest

clear()

public CreateAlertPolicyRequest.Builder clear()
Returns
Type Description
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
Type Description
CreateAlertPolicyRequest.Builder

clearField(Descriptors.FieldDescriptor field)

public CreateAlertPolicyRequest.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
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
Type Description
CreateAlertPolicyRequest.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public CreateAlertPolicyRequest.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
CreateAlertPolicyRequest.Builder
Overrides

clone()

public CreateAlertPolicyRequest.Builder clone()
Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
AlertPolicyOrBuilder

getDefaultInstanceForType()

public CreateAlertPolicyRequest getDefaultInstanceForType()
Returns
Type Description
CreateAlertPolicyRequest

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
boolean

Whether the alertPolicy field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
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
Name Description
value AlertPolicy
Returns
Type Description
CreateAlertPolicyRequest.Builder

mergeFrom(CreateAlertPolicyRequest other)

public CreateAlertPolicyRequest.Builder mergeFrom(CreateAlertPolicyRequest other)
Parameter
Name Description
other CreateAlertPolicyRequest
Returns
Type Description
CreateAlertPolicyRequest.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public CreateAlertPolicyRequest.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CreateAlertPolicyRequest.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public CreateAlertPolicyRequest.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
CreateAlertPolicyRequest.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final CreateAlertPolicyRequest.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
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
Name Description
value AlertPolicy
Returns
Type Description
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
Name Description
builderForValue AlertPolicy.Builder
Returns
Type Description
CreateAlertPolicyRequest.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public CreateAlertPolicyRequest.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
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
Name Description
value String

The name to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
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
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
CreateAlertPolicyRequest.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final CreateAlertPolicyRequest.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
CreateAlertPolicyRequest.Builder
Overrides