Skip to content

Commit

Permalink
feat: Automated regeneration of Monitoring client (#10930)
Browse files Browse the repository at this point in the history
Auto-created at 2024-03-12 02:31:47 +0000 using the toys pull request generator.
  • Loading branch information
yoshi-code-bot authored Mar 12, 2024
1 parent 9f00bd2 commit 648495e
Show file tree
Hide file tree
Showing 24 changed files with 740 additions and 20 deletions.
293 changes: 289 additions & 4 deletions clients/monitoring/lib/google_api/monitoring/v3/api/projects.ex

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ defmodule GoogleApi.Monitoring.V3.Api.Services do
## Parameters
* `connection` (*type:* `GoogleApi.Monitoring.V3.Connection.t`) - Connection to server
* `v3_id` (*type:* `String.t`) - Part of `service.name`. Resource name for this Service. The format is: projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
* `v3_id` (*type:* `String.t`) - Part of `service.name`. Identifier. Resource name for this Service. The format is: projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
* `v3_id1` (*type:* `String.t`) - Part of `service.name`. See documentation of `v3Id`.
* `services_id` (*type:* `String.t`) - Part of `service.name`. See documentation of `v3Id`.
* `optional_params` (*type:* `keyword()`) - Optional parameters
Expand Down Expand Up @@ -424,7 +424,7 @@ defmodule GoogleApi.Monitoring.V3.Api.Services do
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:serviceLevelObjectiveId` (*type:* `String.t`) - Optional. The ServiceLevelObjective id to use for this ServiceLevelObjective. If omitted, an id will be generated instead. Must match the pattern [a-z0-9\\-]+
* `:serviceLevelObjectiveId` (*type:* `String.t`) - Optional. The ServiceLevelObjective id to use for this ServiceLevelObjective. If omitted, an id will be generated instead. Must match the pattern ^[a-zA-Z0-9-_:.]+$
* `:body` (*type:* `GoogleApi.Monitoring.V3.Model.ServiceLevelObjective.t`) -
* `opts` (*type:* `keyword()`) - Call options
Expand Down Expand Up @@ -753,7 +753,7 @@ defmodule GoogleApi.Monitoring.V3.Api.Services do
## Parameters
* `connection` (*type:* `GoogleApi.Monitoring.V3.Connection.t`) - Connection to server
* `v3_id` (*type:* `String.t`) - Part of `serviceLevelObjective.name`. Resource name for this ServiceLevelObjective. The format is: projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME]
* `v3_id` (*type:* `String.t`) - Part of `serviceLevelObjective.name`. Identifier. Resource name for this ServiceLevelObjective. The format is: projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME]
* `v3_id1` (*type:* `String.t`) - Part of `serviceLevelObjective.name`. See documentation of `v3Id`.
* `services_id` (*type:* `String.t`) - Part of `serviceLevelObjective.name`. See documentation of `v3Id`.
* `service_level_objectives_id` (*type:* `String.t`) - Part of `serviceLevelObjective.name`. See documentation of `v3Id`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.Monitoring.V3 do
API client metadata for GoogleApi.Monitoring.V3.
"""

@discovery_revision "20221114"
@discovery_revision "20240303"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ defmodule GoogleApi.Monitoring.V3.Model.AlertPolicy do
* `alertStrategy` (*type:* `GoogleApi.Monitoring.V3.Model.AlertStrategy.t`, *default:* `nil`) - Control over how this alert policy's notification channels are notified.
* `combiner` (*type:* `String.t`, *default:* `nil`) - How to combine the results of multiple conditions to determine if an incident should be opened. If condition_time_series_query_language is present, this must be COMBINE_UNSPECIFIED.
* `conditions` (*type:* `list(GoogleApi.Monitoring.V3.Model.Condition.t)`, *default:* `nil`) - A list of conditions for the policy. The conditions are combined by AND or OR according to the combiner field. If the combined conditions evaluate to true, then an incident is created. A policy can have from one to six conditions. If condition_time_series_query_language is present, it must be the only condition.
* `conditions` (*type:* `list(GoogleApi.Monitoring.V3.Model.Condition.t)`, *default:* `nil`) - A list of conditions for the policy. The conditions are combined by AND or OR according to the combiner field. If the combined conditions evaluate to true, then an incident is created. A policy can have from one to six conditions. If condition_time_series_query_language is present, it must be the only condition. If condition_monitoring_query_language is present, it must be the only condition.
* `creationRecord` (*type:* `GoogleApi.Monitoring.V3.Model.MutationRecord.t`, *default:* `nil`) - A read-only record of the creation of the alerting policy. If provided in a call to create or update, this field will be ignored.
* `displayName` (*type:* `String.t`, *default:* `nil`) - A short name or phrase used to identify the policy in dashboards, notifications, and incidents. To avoid confusion, don't use the same display name for multiple policies in the same project. The name is limited to 512 Unicode characters.
* `displayName` (*type:* `String.t`, *default:* `nil`) - A short name or phrase used to identify the policy in dashboards, notifications, and incidents. To avoid confusion, don't use the same display name for multiple policies in the same project. The name is limited to 512 Unicode characters.The convention for the display_name of a PrometheusQueryLanguageCondition is "{rule group name}/{alert name}", where the {rule group name} and {alert name} should be taken from the corresponding Prometheus configuration file. This convention is not enforced. In any case the display_name is not a unique key of the AlertPolicy.
* `documentation` (*type:* `GoogleApi.Monitoring.V3.Model.Documentation.t`, *default:* `nil`) - Documentation that is included with notifications and incidents related to this policy. Best practice is for the documentation to include information to help responders understand, mitigate, escalate, and correct the underlying problems detected by the alerting policy. Notification channels that have limited capacity might not show this documentation.
* `enabled` (*type:* `boolean()`, *default:* `nil`) - Whether or not the policy is enabled. On write, the default interpretation if unset is that the policy is enabled. On read, clients should not make any assumption about the state if it has not been populated. The field should always be populated on List and Get operations, unless a field projection has been specified that strips it out.
* `mutationRecord` (*type:* `GoogleApi.Monitoring.V3.Model.MutationRecord.t`, *default:* `nil`) - A read-only record of the most recent change to the alerting policy. If provided in a call to create or update, this field will be ignored.
* `name` (*type:* `String.t`, *default:* `nil`) - Required if the policy exists. The resource name for this policy. The format is: projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] [ALERT_POLICY_ID] is assigned by Cloud Monitoring when the policy is created. When calling the alertPolicies.create method, do not include the name field in the alerting policy passed as part of the request.
* `notificationChannels` (*type:* `list(String.t)`, *default:* `nil`) - Identifies the notification channels to which notifications should be sent when incidents are opened or closed or when new violations occur on an already opened incident. Each element of this array corresponds to the name field in each of the NotificationChannel objects that are returned from the ListNotificationChannels method. The format of the entries in this field is: projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
* `userLabels` (*type:* `map()`, *default:* `nil`) - User-supplied key/value data to be used for organizing and identifying the AlertPolicy objects.The field can contain up to 64 entries. Each key and value is limited to 63 Unicode characters or 128 bytes, whichever is smaller. Labels and values can contain only lowercase letters, numerals, underscores, and dashes. Keys must begin with a letter.
* `validity` (*type:* `GoogleApi.Monitoring.V3.Model.Status.t`, *default:* `nil`) - Read-only description of how the alert policy is invalid. OK if the alert policy is valid. If not OK, the alert policy will not generate incidents.
* `severity` (*type:* `String.t`, *default:* `nil`) - Optional. The severity of an alert policy indicates how important incidents generated by that policy are. The severity level will be displayed on the Incident detail page and in notifications.
* `userLabels` (*type:* `map()`, *default:* `nil`) - User-supplied key/value data to be used for organizing and identifying the AlertPolicy objects.The field can contain up to 64 entries. Each key and value is limited to 63 Unicode characters or 128 bytes, whichever is smaller. Labels and values can contain only lowercase letters, numerals, underscores, and dashes. Keys must begin with a letter.Note that Prometheus {alert name} is a valid Prometheus label names (https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), whereas Prometheus {rule group} is an unrestricted UTF-8 string. This means that they cannot be stored as-is in user labels, because they may contain characters that are not allowed in user-label values.
* `validity` (*type:* `GoogleApi.Monitoring.V3.Model.Status.t`, *default:* `nil`) - Read-only description of how the alert policy is invalid. This field is only set when the alert policy is invalid. An invalid alert policy will not generate incidents.
"""

use GoogleApi.Gax.ModelBase
Expand All @@ -48,6 +49,7 @@ defmodule GoogleApi.Monitoring.V3.Model.AlertPolicy do
:mutationRecord => GoogleApi.Monitoring.V3.Model.MutationRecord.t() | nil,
:name => String.t() | nil,
:notificationChannels => list(String.t()) | nil,
:severity => String.t() | nil,
:userLabels => map() | nil,
:validity => GoogleApi.Monitoring.V3.Model.Status.t() | nil
}
Expand All @@ -62,6 +64,7 @@ defmodule GoogleApi.Monitoring.V3.Model.AlertPolicy do
field(:mutationRecord, as: GoogleApi.Monitoring.V3.Model.MutationRecord)
field(:name)
field(:notificationChannels, type: :list)
field(:severity)
field(:userLabels, type: :map)
field(:validity, as: GoogleApi.Monitoring.V3.Model.Status)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,26 @@ defmodule GoogleApi.Monitoring.V3.Model.AlertStrategy do
## Attributes
* `autoClose` (*type:* `String.t`, *default:* `nil`) - If an alert policy that was active has no data for this long, any open incidents will close
* `notificationChannelStrategy` (*type:* `list(GoogleApi.Monitoring.V3.Model.NotificationChannelStrategy.t)`, *default:* `nil`) - Control how notifications will be sent out, on a per-channel basis.
* `notificationRateLimit` (*type:* `GoogleApi.Monitoring.V3.Model.NotificationRateLimit.t`, *default:* `nil`) - Required for alert policies with a LogMatch condition.This limit is not implemented for alert policies that are not log-based.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:autoClose => String.t() | nil,
:notificationChannelStrategy =>
list(GoogleApi.Monitoring.V3.Model.NotificationChannelStrategy.t()) | nil,
:notificationRateLimit => GoogleApi.Monitoring.V3.Model.NotificationRateLimit.t() | nil
}

field(:autoClose)

field(:notificationChannelStrategy,
as: GoogleApi.Monitoring.V3.Model.NotificationChannelStrategy,
type: :list
)

field(:notificationRateLimit, as: GoogleApi.Monitoring.V3.Model.NotificationRateLimit)
end

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Monitoring.V3.Model.CloudFunctionV2Target do
@moduledoc """
A Synthetic Monitor deployed to a Cloud Functions V2 instance.
## Attributes
* `cloudRunRevision` (*type:* `GoogleApi.Monitoring.V3.Model.MonitoredResource.t`, *default:* `nil`) - Output only. The cloud_run_revision Monitored Resource associated with the GCFv2. The Synthetic Monitor execution results (metrics, logs, and spans) are reported against this Monitored Resource. This field is output only.
* `name` (*type:* `String.t`, *default:* `nil`) - Required. Fully qualified GCFv2 resource name i.e. projects/{project}/locations/{location}/functions/{function} Required.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:cloudRunRevision => GoogleApi.Monitoring.V3.Model.MonitoredResource.t() | nil,
:name => String.t() | nil
}

field(:cloudRunRevision, as: GoogleApi.Monitoring.V3.Model.MonitoredResource)
field(:name)
end

defimpl Poison.Decoder, for: GoogleApi.Monitoring.V3.Model.CloudFunctionV2Target do
def decode(value, options) do
GoogleApi.Monitoring.V3.Model.CloudFunctionV2Target.decode(value, options)
end
end

defimpl Poison.Encoder, for: GoogleApi.Monitoring.V3.Model.CloudFunctionV2Target do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ defmodule GoogleApi.Monitoring.V3.Model.Condition do
* `conditionAbsent` (*type:* `GoogleApi.Monitoring.V3.Model.MetricAbsence.t`, *default:* `nil`) - A condition that checks that a time series continues to receive new data points.
* `conditionMatchedLog` (*type:* `GoogleApi.Monitoring.V3.Model.LogMatch.t`, *default:* `nil`) - A condition that checks for log messages matching given constraints. If set, no other conditions can be present.
* `conditionMonitoringQueryLanguage` (*type:* `GoogleApi.Monitoring.V3.Model.MonitoringQueryLanguageCondition.t`, *default:* `nil`) - A condition that uses the Monitoring Query Language to define alerts.
* `conditionPrometheusQueryLanguage` (*type:* `GoogleApi.Monitoring.V3.Model.PrometheusQueryLanguageCondition.t`, *default:* `nil`) - A condition that uses the Prometheus query language to define alerts.
* `conditionThreshold` (*type:* `GoogleApi.Monitoring.V3.Model.MetricThreshold.t`, *default:* `nil`) - A condition that compares a time series against a threshold.
* `displayName` (*type:* `String.t`, *default:* `nil`) - A short name or phrase used to identify the condition in dashboards, notifications, and incidents. To avoid confusion, don't use the same display name for multiple conditions in the same policy.
* `name` (*type:* `String.t`, *default:* `nil`) - Required if the condition exists. The unique resource name for this condition. Its format is: projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID] [CONDITION_ID] is assigned by Cloud Monitoring when the condition is created as part of a new or updated alerting policy.When calling the alertPolicies.create method, do not include the name field in the conditions of the requested alerting policy. Cloud Monitoring creates the condition identifiers and includes them in the new policy.When calling the alertPolicies.update method to update a policy, including a condition name causes the existing condition to be updated. Conditions without names are added to the updated policy. Existing conditions are deleted if they are not updated.Best practice is to preserve [CONDITION_ID] if you make only small changes, such as those to condition thresholds, durations, or trigger values. Otherwise, treat the change as a new condition and let the existing condition be deleted.
Expand All @@ -36,6 +37,8 @@ defmodule GoogleApi.Monitoring.V3.Model.Condition do
:conditionMatchedLog => GoogleApi.Monitoring.V3.Model.LogMatch.t() | nil,
:conditionMonitoringQueryLanguage =>
GoogleApi.Monitoring.V3.Model.MonitoringQueryLanguageCondition.t() | nil,
:conditionPrometheusQueryLanguage =>
GoogleApi.Monitoring.V3.Model.PrometheusQueryLanguageCondition.t() | nil,
:conditionThreshold => GoogleApi.Monitoring.V3.Model.MetricThreshold.t() | nil,
:displayName => String.t() | nil,
:name => String.t() | nil
Expand All @@ -48,6 +51,10 @@ defmodule GoogleApi.Monitoring.V3.Model.Condition do
as: GoogleApi.Monitoring.V3.Model.MonitoringQueryLanguageCondition
)

field(:conditionPrometheusQueryLanguage,
as: GoogleApi.Monitoring.V3.Model.PrometheusQueryLanguageCondition
)

field(:conditionThreshold, as: GoogleApi.Monitoring.V3.Model.MetricThreshold)
field(:displayName)
field(:name)
Expand Down
46 changes: 46 additions & 0 deletions clients/monitoring/lib/google_api/monitoring/v3/model/criteria.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Monitoring.V3.Model.Criteria do
@moduledoc """
Criteria specific to the AlertPolicys that this Snooze applies to. The Snooze will suppress alerts that come from one of the AlertPolicys whose names are supplied.
## Attributes
* `policies` (*type:* `list(String.t)`, *default:* `nil`) - The specific AlertPolicy names for the alert that should be snoozed. The format is: projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] There is a limit of 16 policies per snooze. This limit is checked during snooze creation.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:policies => list(String.t()) | nil
}

field(:policies, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.Monitoring.V3.Model.Criteria do
def decode(value, options) do
GoogleApi.Monitoring.V3.Model.Criteria.decode(value, options)
end
end

defimpl Poison.Encoder, for: GoogleApi.Monitoring.V3.Model.Criteria do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Loading

0 comments on commit 648495e

Please sign in to comment.