diff --git a/packages/google-cloud-monitoring/protos/google/monitoring/v3/service.proto b/packages/google-cloud-monitoring/protos/google/monitoring/v3/service.proto new file mode 100644 index 00000000000..5622931c67d --- /dev/null +++ b/packages/google-cloud-monitoring/protos/google/monitoring/v3/service.proto @@ -0,0 +1,377 @@ +// 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. +// + +syntax = "proto3"; + +package google.monitoring.v3; + +import "google/api/monitored_resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/calendar_period.proto"; + +option go_package = "google.golang.org/genproto/googleapis/monitoring/v3;monitoring"; +option java_multiple_files = true; +option java_outer_classname = "ServiceMonitoringProto"; +option java_package = "com.google.monitoring.v3"; + +// A `Service` is a discrete, autonomous, and network-accessible unit, designed +// to solve an individual concern +// ([Wikipedia](https://en.wikipedia.org/wiki/Service-orientation)). In +// Stackdriver Monitoring, a `Service` acts as the root resource under which +// operational aspects of the service are accessible. +message Service { + // Custom view of service telemetry. Currently a place-holder pending final + // design. + message Custom { + + } + + // App Engine service. Learn more at https://cloud.google.com/appengine. + message AppEngine { + // The ID of the App Engine module underlying this service. Corresponds to + // the `module_id` resource label in the `gae_app` monitored resource: + // https://cloud.google.com/monitoring/api/resources#tag_gae_app + string module_id = 1; + } + + // Cloud Endpoints service. Learn more at https://cloud.google.com/endpoints. + message CloudEndpoints { + // The name of the Cloud Endpoints service underlying this service. + // Corresponds to the `service` resource label in the `api` monitored + // resource: https://cloud.google.com/monitoring/api/resources#tag_api + string service = 1; + } + + // Istio service. Learn more at http://istio.io. + message ClusterIstio { + // The location of the Kubernetes cluster in which this Istio service is + // defined. Corresponds to the `location` resource label in `k8s_cluster` + // resources. + string location = 1; + + // The name of the Kubernetes cluster in which this Istio service is + // defined. Corresponds to the `cluster_name` resource label in + // `k8s_cluster` resources. + string cluster_name = 2; + + // The namespace of the Istio service underlying this service. Corresponds + // to the `destination_service_namespace` metric label in Istio metrics. + string service_namespace = 3; + + // The name of the Istio service underlying this service. Corresponds to the + // `destination_service_name` metric label in Istio metrics. + string service_name = 4; + } + + // Configuration for how to query telemetry on a Service. + message Telemetry { + // The full name of the resource that defines this service. Formatted as + // described in https://cloud.google.com/apis/design/resource_names. + string resource_name = 1; + } + + // Resource name for this Service. Of the form + // `projects/{project_id}/services/{service_id}`. + string name = 1; + + // Name used for UI elements listing this Service. + string display_name = 2; + + // REQUIRED. Service-identifying atoms specifying the underlying service. + oneof identifier { + // Custom service type. + Custom custom = 6; + + // Type used for App Engine services. + AppEngine app_engine = 7; + + // Type used for Cloud Endpoints services. + CloudEndpoints cloud_endpoints = 8; + + // Type used for Istio services that live in a Kubernetes cluster. + ClusterIstio cluster_istio = 9; + } + + // Configuration for how to query telemetry on a Service. + Telemetry telemetry = 13; +} + +// A Service-Level Objective (SLO) describes a level of desired good service. It +// consists of a service-level indicator (SLI), a performance goal, and a period +// over which the objective is to be evaluated against that goal. The SLO can +// use SLIs defined in a number of different manners. Typical SLOs might include +// "99% of requests in each rolling week have latency below 200 milliseconds" or +// "99.5% of requests in each calendar month return successfully." +message ServiceLevelObjective { + // `ServiceLevelObjective.View` determines what form of + // `ServiceLevelObjective` is returned from `GetServiceLevelObjective`, + // `ListServiceLevelObjectives`, and `ListServiceLevelObjectiveVersions` RPCs. + enum View { + // Same as FULL. + VIEW_UNSPECIFIED = 0; + + // Return the embedded `ServiceLevelIndicator` in the form in which it was + // defined. If it was defined using a `BasicSli`, return that `BasicSli`. + FULL = 2; + + // For `ServiceLevelIndicator`s using `BasicSli` articulation, instead + // return the `ServiceLevelIndicator` with its mode of computation fully + // spelled out as a `RequestBasedSli`. For `ServiceLevelIndicator`s using + // `RequestBasedSli` or `WindowsBasedSli`, return the + // `ServiceLevelIndicator` as it was provided. + EXPLICIT = 1; + } + + // Resource name for this `ServiceLevelObjective`. + // Of the form + // `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. + string name = 1; + + // Name used for UI elements listing this SLO. + string display_name = 11; + + // The definition of good service, used to measure and calculate the quality + // of the `Service`'s performance with respect to a single aspect of service + // quality. + ServiceLevelIndicator service_level_indicator = 3; + + // The fraction of service that must be good in order for this objective to be + // met. `0 < goal <= 1`. + double goal = 4; + + // The time period over which the objective will be evaluated. + oneof period { + // A rolling time period, semantically "in the past ``". + // Must be an integer multiple of 1 day no larger than 30 days. + google.protobuf.Duration rolling_period = 5; + + // A calendar period, semantically "since the start of the current + // ``". At this time, only `DAY`, `WEEK`, `FORTNIGHT`, and + // `MONTH` are supported. + google.type.CalendarPeriod calendar_period = 6; + } +} + +// A Service-Level Indicator (SLI) describes the "performance" of a service. For +// some services, the SLI is well-defined. In such cases, the SLI can be +// described easily by referencing the well-known SLI and providing the needed +// parameters. Alternatively, a "custom" SLI can be defined with a query to the +// underlying metric store. An SLI is defined to be `good_service / +// total_service` over any queried time interval. The value of performance +// always falls into the range `0 <= performance <= 1`. A custom SLI describes +// how to compute this ratio, whether this is by dividing values from a pair of +// time series, cutting a `Distribution` into good and bad counts, or counting +// time windows in which the service complies with a criterion. For separation +// of concerns, a single Service-Level Indicator measures performance for only +// one aspect of service quality, such as fraction of successful queries or +// fast-enough queries. +message ServiceLevelIndicator { + // Service level indicators can be grouped by whether the "unit" of service + // being measured is based on counts of good requests or on counts of good + // time windows + oneof type { + // Basic SLI on a well-known service type. + BasicSli basic_sli = 4; + + // Request-based SLIs + RequestBasedSli request_based = 1; + + // Windows-based SLIs + WindowsBasedSli windows_based = 2; + } +} + +// An SLI measuring performance on a well-known service type. Performance will +// be computed on the basis of pre-defined metrics. The type of the +// `service_resource` determines the metrics to use and the +// `service_resource.labels` and `metric_labels` are used to construct a +// monitoring filter to filter that metric down to just the data relevant to +// this service. +message BasicSli { + // Future parameters for the availability SLI. + message AvailabilityCriteria { + + } + + // Parameters for a latency threshold SLI. + message LatencyCriteria { + // Good service is defined to be the count of requests made to this service + // that return in no more than `threshold`. + google.protobuf.Duration threshold = 3; + } + + // OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from + // other methods will not be used to calculate performance for this SLI. If + // omitted, this SLI applies to all the Service's methods. For service types + // that don't support breaking down by method, setting this field will result + // in an error. + repeated string method = 7; + + // OPTIONAL: The set of locations to which this SLI is relevant. Telemetry + // from other locations will not be used to calculate performance for this + // SLI. If omitted, this SLI applies to all locations in which the Service has + // activity. For service types that don't support breaking down by location, + // setting this field will result in an error. + repeated string location = 8; + + // OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry + // from other API versions will not be used to calculate performance for this + // SLI. If omitted, this SLI applies to all API versions. For service types + // that don't support breaking down by version, setting this field will result + // in an error. + repeated string version = 9; + + // This SLI can be evaluated on the basis of availability or latency. + oneof sli_criteria { + // Good service is defined to be the count of requests made to this service + // that return successfully. + AvailabilityCriteria availability = 2; + + // Good service is defined to be the count of requests made to this service + // that are fast enough with respect to `latency.threshold`. + LatencyCriteria latency = 3; + } +} + +// Range of numerical values, inclusive of `min` and exclusive of `max`. If the +// open range "< range.max" is desired, set `range.min = -infinity`. If the open +// range ">= range.min" is desired, set `range.max = infinity`. +message Range { + // Range minimum. + double min = 1; + + // Range maximum. + double max = 2; +} + +// Service Level Indicators for which atomic units of service are counted +// directly. +message RequestBasedSli { + // The means to compute a ratio of `good_service` to `total_service`. + oneof method { + // `good_total_ratio` is used when the ratio of `good_service` to + // `total_service` is computed from two `TimeSeries`. + TimeSeriesRatio good_total_ratio = 1; + + // `distribution_cut` is used when `good_service` is a count of values + // aggregated in a `Distribution` that fall into a good range. The + // `total_service` is the total count of all values aggregated in the + // `Distribution`. + DistributionCut distribution_cut = 3; + } +} + +// A `TimeSeriesRatio` specifies two `TimeSeries` to use for computing the +// `good_service / total_service` ratio. The specified `TimeSeries` must have +// `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = +// DELTA` or `MetricKind = CUMULATIVE`. The `TimeSeriesRatio` must specify +// exactly two of good, bad, and total, and the relationship `good_service + +// bad_service = total_service` will be assumed. +message TimeSeriesRatio { + // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + // specifying a `TimeSeries` quantifying good service provided. Must have + // `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = + // DELTA` or `MetricKind = CUMULATIVE`. + string good_service_filter = 4; + + // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + // specifying a `TimeSeries` quantifying bad service, either demanded service + // that was not provided or demanded service that was of inadequate quality. + // Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have + // `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. + string bad_service_filter = 5; + + // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + // specifying a `TimeSeries` quantifying total demanded service. Must have + // `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = + // DELTA` or `MetricKind = CUMULATIVE`. + string total_service_filter = 6; +} + +// A `DistributionCut` defines a `TimeSeries` and thresholds used for measuring +// good service and total service. The `TimeSeries` must have `ValueType = +// DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. The +// computed `good_service` will be the count of values x in the `Distribution` +// such that `range.min <= x < range.max`. +message DistributionCut { + // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + // specifying a `TimeSeries` aggregating values. Must have `ValueType = + // DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. + string distribution_filter = 4; + + // Range of values considered "good." For a one-sided range, set one bound to + // an infinite value. + Range range = 5; +} + +// A `WindowsBasedSli` defines `good_service` as the count of time windows for +// which the provided service was of good quality. Criteria for determining +// if service was good are embedded in the `window_criterion`. +message WindowsBasedSli { + // A `PerformanceThreshold` is used when each window is good when that window + // has a sufficiently high `performance`. + message PerformanceThreshold { + // The means, either a request-based SLI or a basic SLI, by which to compute + // performance over a window. + oneof type { + // `RequestBasedSli` to evaluate to judge window quality. + RequestBasedSli performance = 1; + + // `BasicSli` to evaluate to judge window quality. + BasicSli basic_sli_performance = 3; + } + + // If window `performance >= threshold`, the window is counted as good. + double threshold = 2; + } + + // A `MetricRange` is used when each window is good when the value x of a + // single `TimeSeries` satisfies `range.min <= x < range.max`. The provided + // `TimeSeries` must have `ValueType = INT64` or `ValueType = DOUBLE` and + // `MetricKind = GAUGE`. + message MetricRange { + // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + // specifying the `TimeSeries` to use for evaluating window quality. + string time_series = 1; + + // Range of values considered "good." For a one-sided range, set one bound + // to an infinite value. + Range range = 4; + } + + // The criterion to use for evaluating window goodness. + oneof window_criterion { + // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + // specifying a `TimeSeries` with `ValueType = BOOL`. The window is good if + // any `true` values appear in the window. + string good_bad_metric_filter = 5; + + // A window is good if its `performance` is high enough. + PerformanceThreshold good_total_ratio_threshold = 2; + + // A window is good if the metric's value is in a good range, averaged + // across returned streams. + MetricRange metric_mean_in_range = 6; + + // A window is good if the metric's value is in a good range, summed across + // returned streams. + MetricRange metric_sum_in_range = 7; + } + + // Duration over which window quality is evaluated. Must be an integer + // fraction of a day and at least `60s`. + google.protobuf.Duration window_period = 4; +} diff --git a/packages/google-cloud-monitoring/protos/google/monitoring/v3/service_service.proto b/packages/google-cloud-monitoring/protos/google/monitoring/v3/service_service.proto new file mode 100644 index 00000000000..85cefa10d23 --- /dev/null +++ b/packages/google-cloud-monitoring/protos/google/monitoring/v3/service_service.proto @@ -0,0 +1,283 @@ +// 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. +// + +syntax = "proto3"; + +package google.monitoring.v3; + +import "google/api/annotations.proto"; +import "google/api/monitored_resource.proto"; +import "google/monitoring/v3/service.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/api/client.proto"; + +option go_package = "google.golang.org/genproto/googleapis/monitoring/v3;monitoring"; +option java_multiple_files = true; +option java_outer_classname = "ServiceMonitoringServiceProto"; +option java_package = "com.google.monitoring.v3"; + +// The Stackdriver Monitoring Service-Oriented Monitoring API has endpoints for +// managing and querying aspects of a workspace's services. These include the +// `Service`'s monitored resources, its Service-Level Objectives, and a taxonomy +// of categorized Health Metrics. +service ServiceMonitoringService { + option (google.api.default_host) = "monitoring.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/monitoring," + "https://www.googleapis.com/auth/monitoring.read"; + + // Create a `Service`. + rpc CreateService(CreateServiceRequest) returns (Service) { + option (google.api.http) = { + post: "/v3/{parent=*/*}/services" + body: "service" + }; + } + + // Get the named `Service`. + rpc GetService(GetServiceRequest) returns (Service) { + option (google.api.http) = { + get: "/v3/{name=*/*/services/*}" + }; + } + + // List `Service`s for this workspace. + rpc ListServices(ListServicesRequest) returns (ListServicesResponse) { + option (google.api.http) = { + get: "/v3/{parent=*/*}/services" + }; + } + + // Update this `Service`. + rpc UpdateService(UpdateServiceRequest) returns (Service) { + option (google.api.http) = { + patch: "/v3/{service.name=*/*/services/*}" + body: "service" + }; + } + + // Soft delete this `Service`. + rpc DeleteService(DeleteServiceRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=*/*/services/*}" + }; + } + + // Create a `ServiceLevelObjective` for the given `Service`. + rpc CreateServiceLevelObjective(CreateServiceLevelObjectiveRequest) returns (ServiceLevelObjective) { + option (google.api.http) = { + post: "/v3/{parent=*/*/services/*}/serviceLevelObjectives" + body: "service_level_objective" + }; + } + + // Get a `ServiceLevelObjective` by name. + rpc GetServiceLevelObjective(GetServiceLevelObjectiveRequest) returns (ServiceLevelObjective) { + option (google.api.http) = { + get: "/v3/{name=*/*/services/*/serviceLevelObjectives/*}" + }; + } + + // List the `ServiceLevelObjective`s for the given `Service`. + rpc ListServiceLevelObjectives(ListServiceLevelObjectivesRequest) returns (ListServiceLevelObjectivesResponse) { + option (google.api.http) = { + get: "/v3/{parent=*/*/services/*}/serviceLevelObjectives" + }; + } + + // Update the given `ServiceLevelObjective`. + rpc UpdateServiceLevelObjective(UpdateServiceLevelObjectiveRequest) returns (ServiceLevelObjective) { + option (google.api.http) = { + patch: "/v3/{service_level_objective.name=*/*/services/*/serviceLevelObjectives/*}" + body: "service_level_objective" + }; + } + + // Delete the given `ServiceLevelObjective`. + rpc DeleteServiceLevelObjective(DeleteServiceLevelObjectiveRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3/{name=*/*/services/*/serviceLevelObjectives/*}" + }; + } +} + +// The `CreateService` request. +message CreateServiceRequest { + // Resource name of the parent workspace. + // Of the form `projects/{project_id}`. + string parent = 1; + + // Optional. The Service id to use for this Service. If omitted, an id will be + // generated instead. Must match the pattern [a-z0-9\-]+ + string service_id = 3; + + // The `Service` to create. + Service service = 2; +} + +// The `GetService` request. +message GetServiceRequest { + // Resource name of the `Service`. + // Of the form `projects/{project_id}/services/{service_id}`. + string name = 1; +} + +// The `ListServices` request. +message ListServicesRequest { + // Resource name of the parent `Workspace`. + // Of the form `projects/{project_id}`. + string parent = 1; + + // A filter specifying what `Service`s to return. The filter currently + // supports the following fields: + // + // - `identifier_case` + // - `app_engine.module_id` + // - `cloud_endpoints.service` + // - `cluster_istio.location` + // - `cluster_istio.cluster_name` + // - `cluster_istio.service_namespace` + // - `cluster_istio.service_name` + // + // `identifier_case` refers to which option in the identifier oneof is + // populated. For example, the filter `identifier_case = "CUSTOM"` would match + // all services with a value for the `custom` field. Valid options are + // "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". + string filter = 2; + + // A non-negative number that is the maximum number of results to return. + // When 0, use default page size. + int32 page_size = 3; + + // If this field is not empty then it must contain the `nextPageToken` value + // returned by a previous call to this method. Using this field causes the + // method to return additional results from the previous method call. + string page_token = 4; +} + +// The `ListServices` response. +message ListServicesResponse { + // The `Service`s matching the specified filter. + repeated Service services = 1; + + // If there are more results than have been returned, then this field is set + // to a non-empty value. To see the additional results, + // use that value as `pageToken` in the next call to this method. + string next_page_token = 2; +} + +// The `UpdateService` request. +message UpdateServiceRequest { + // The `Service` to draw updates from. + // The given `name` specifies the resource to update. + Service service = 1; + + // A set of field paths defining which fields to use for the update. + google.protobuf.FieldMask update_mask = 2; +} + +// The `DeleteService` request. +message DeleteServiceRequest { + // Resource name of the `Service` to delete. + // Of the form `projects/{project_id}/service/{service_id}`. + string name = 1; +} + +// The `CreateServiceLevelObjective` request. +message CreateServiceLevelObjectiveRequest { + // Resource name of the parent `Service`. + // Of the form `projects/{project_id}/services/{service_id}`. + string parent = 1; + + // Optional. The ServiceLevelObjective id to use for this + // ServiceLevelObjective. If omitted, an id will be generated instead. Must + // match the pattern [a-z0-9\-]+ + string service_level_objective_id = 3; + + // The `ServiceLevelObjective` to create. + // The provided `name` will be respected if no `ServiceLevelObjective` exists + // with this name. + ServiceLevelObjective service_level_objective = 2; +} + +// The `GetServiceLevelObjective` request. +message GetServiceLevelObjectiveRequest { + // Resource name of the `ServiceLevelObjective` to get. + // Of the form + // `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. + string name = 1; + + // View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the + // `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + // `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + // `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + ServiceLevelObjective.View view = 2; +} + +// The `ListServiceLevelObjectives` request. +message ListServiceLevelObjectivesRequest { + // Resource name of the parent `Service`. + // Of the form `projects/{project_id}/services/{service_id}`. + string parent = 1; + + // A filter specifying what `ServiceLevelObjective`s to return. + string filter = 2; + + // A non-negative number that is the maximum number of results to return. + // When 0, use default page size. + int32 page_size = 3; + + // If this field is not empty then it must contain the `nextPageToken` value + // returned by a previous call to this method. Using this field causes the + // method to return additional results from the previous method call. + string page_token = 4; + + // View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each + // `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + // `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + // `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + ServiceLevelObjective.View view = 5; +} + +// The `ListServiceLevelObjectives` response. +message ListServiceLevelObjectivesResponse { + // The `ServiceLevelObjective`s matching the specified filter. + repeated ServiceLevelObjective service_level_objectives = 1; + + // If there are more results than have been returned, then this field is set + // to a non-empty value. To see the additional results, + // use that value as `pageToken` in the next call to this method. + string next_page_token = 2; +} + +// The `UpdateServiceLevelObjective` request. +message UpdateServiceLevelObjectiveRequest { + // The `ServiceLevelObjective` to draw updates from. + // The given `name` specifies the resource to update. + ServiceLevelObjective service_level_objective = 1; + + // A set of field paths defining which fields to use for the update. + google.protobuf.FieldMask update_mask = 2; +} + +// The `DeleteServiceLevelObjective` request. +message DeleteServiceLevelObjectiveRequest { + // Resource name of the `ServiceLevelObjective` to delete. + // Of the form + // `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. + string name = 1; +} diff --git a/packages/google-cloud-monitoring/protos/protos.d.ts b/packages/google-cloud-monitoring/protos/protos.d.ts index adee550a3d2..97b950a9f07 100644 --- a/packages/google-cloud-monitoring/protos/protos.d.ts +++ b/packages/google-cloud-monitoring/protos/protos.d.ts @@ -6352,6 +6352,3256 @@ export namespace google { } } + /** Represents a ServiceMonitoringService */ + class ServiceMonitoringService extends $protobuf.rpc.Service { + + /** + * Constructs a new ServiceMonitoringService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new ServiceMonitoringService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): ServiceMonitoringService; + + /** + * Calls CreateService. + * @param request CreateServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Service + */ + public createService(request: google.monitoring.v3.ICreateServiceRequest, callback: google.monitoring.v3.ServiceMonitoringService.CreateServiceCallback): void; + + /** + * Calls CreateService. + * @param request CreateServiceRequest message or plain object + * @returns Promise + */ + public createService(request: google.monitoring.v3.ICreateServiceRequest): Promise; + + /** + * Calls GetService. + * @param request GetServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Service + */ + public getService(request: google.monitoring.v3.IGetServiceRequest, callback: google.monitoring.v3.ServiceMonitoringService.GetServiceCallback): void; + + /** + * Calls GetService. + * @param request GetServiceRequest message or plain object + * @returns Promise + */ + public getService(request: google.monitoring.v3.IGetServiceRequest): Promise; + + /** + * Calls ListServices. + * @param request ListServicesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListServicesResponse + */ + public listServices(request: google.monitoring.v3.IListServicesRequest, callback: google.monitoring.v3.ServiceMonitoringService.ListServicesCallback): void; + + /** + * Calls ListServices. + * @param request ListServicesRequest message or plain object + * @returns Promise + */ + public listServices(request: google.monitoring.v3.IListServicesRequest): Promise; + + /** + * Calls UpdateService. + * @param request UpdateServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Service + */ + public updateService(request: google.monitoring.v3.IUpdateServiceRequest, callback: google.monitoring.v3.ServiceMonitoringService.UpdateServiceCallback): void; + + /** + * Calls UpdateService. + * @param request UpdateServiceRequest message or plain object + * @returns Promise + */ + public updateService(request: google.monitoring.v3.IUpdateServiceRequest): Promise; + + /** + * Calls DeleteService. + * @param request DeleteServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteService(request: google.monitoring.v3.IDeleteServiceRequest, callback: google.monitoring.v3.ServiceMonitoringService.DeleteServiceCallback): void; + + /** + * Calls DeleteService. + * @param request DeleteServiceRequest message or plain object + * @returns Promise + */ + public deleteService(request: google.monitoring.v3.IDeleteServiceRequest): Promise; + + /** + * Calls CreateServiceLevelObjective. + * @param request CreateServiceLevelObjectiveRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ServiceLevelObjective + */ + public createServiceLevelObjective(request: google.monitoring.v3.ICreateServiceLevelObjectiveRequest, callback: google.monitoring.v3.ServiceMonitoringService.CreateServiceLevelObjectiveCallback): void; + + /** + * Calls CreateServiceLevelObjective. + * @param request CreateServiceLevelObjectiveRequest message or plain object + * @returns Promise + */ + public createServiceLevelObjective(request: google.monitoring.v3.ICreateServiceLevelObjectiveRequest): Promise; + + /** + * Calls GetServiceLevelObjective. + * @param request GetServiceLevelObjectiveRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ServiceLevelObjective + */ + public getServiceLevelObjective(request: google.monitoring.v3.IGetServiceLevelObjectiveRequest, callback: google.monitoring.v3.ServiceMonitoringService.GetServiceLevelObjectiveCallback): void; + + /** + * Calls GetServiceLevelObjective. + * @param request GetServiceLevelObjectiveRequest message or plain object + * @returns Promise + */ + public getServiceLevelObjective(request: google.monitoring.v3.IGetServiceLevelObjectiveRequest): Promise; + + /** + * Calls ListServiceLevelObjectives. + * @param request ListServiceLevelObjectivesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListServiceLevelObjectivesResponse + */ + public listServiceLevelObjectives(request: google.monitoring.v3.IListServiceLevelObjectivesRequest, callback: google.monitoring.v3.ServiceMonitoringService.ListServiceLevelObjectivesCallback): void; + + /** + * Calls ListServiceLevelObjectives. + * @param request ListServiceLevelObjectivesRequest message or plain object + * @returns Promise + */ + public listServiceLevelObjectives(request: google.monitoring.v3.IListServiceLevelObjectivesRequest): Promise; + + /** + * Calls UpdateServiceLevelObjective. + * @param request UpdateServiceLevelObjectiveRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ServiceLevelObjective + */ + public updateServiceLevelObjective(request: google.monitoring.v3.IUpdateServiceLevelObjectiveRequest, callback: google.monitoring.v3.ServiceMonitoringService.UpdateServiceLevelObjectiveCallback): void; + + /** + * Calls UpdateServiceLevelObjective. + * @param request UpdateServiceLevelObjectiveRequest message or plain object + * @returns Promise + */ + public updateServiceLevelObjective(request: google.monitoring.v3.IUpdateServiceLevelObjectiveRequest): Promise; + + /** + * Calls DeleteServiceLevelObjective. + * @param request DeleteServiceLevelObjectiveRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteServiceLevelObjective(request: google.monitoring.v3.IDeleteServiceLevelObjectiveRequest, callback: google.monitoring.v3.ServiceMonitoringService.DeleteServiceLevelObjectiveCallback): void; + + /** + * Calls DeleteServiceLevelObjective. + * @param request DeleteServiceLevelObjectiveRequest message or plain object + * @returns Promise + */ + public deleteServiceLevelObjective(request: google.monitoring.v3.IDeleteServiceLevelObjectiveRequest): Promise; + } + + namespace ServiceMonitoringService { + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#createService}. + * @param error Error, if any + * @param [response] Service + */ + type CreateServiceCallback = (error: (Error|null), response?: google.monitoring.v3.Service) => void; + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#getService}. + * @param error Error, if any + * @param [response] Service + */ + type GetServiceCallback = (error: (Error|null), response?: google.monitoring.v3.Service) => void; + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#listServices}. + * @param error Error, if any + * @param [response] ListServicesResponse + */ + type ListServicesCallback = (error: (Error|null), response?: google.monitoring.v3.ListServicesResponse) => void; + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#updateService}. + * @param error Error, if any + * @param [response] Service + */ + type UpdateServiceCallback = (error: (Error|null), response?: google.monitoring.v3.Service) => void; + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#deleteService}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteServiceCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#createServiceLevelObjective}. + * @param error Error, if any + * @param [response] ServiceLevelObjective + */ + type CreateServiceLevelObjectiveCallback = (error: (Error|null), response?: google.monitoring.v3.ServiceLevelObjective) => void; + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#getServiceLevelObjective}. + * @param error Error, if any + * @param [response] ServiceLevelObjective + */ + type GetServiceLevelObjectiveCallback = (error: (Error|null), response?: google.monitoring.v3.ServiceLevelObjective) => void; + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#listServiceLevelObjectives}. + * @param error Error, if any + * @param [response] ListServiceLevelObjectivesResponse + */ + type ListServiceLevelObjectivesCallback = (error: (Error|null), response?: google.monitoring.v3.ListServiceLevelObjectivesResponse) => void; + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#updateServiceLevelObjective}. + * @param error Error, if any + * @param [response] ServiceLevelObjective + */ + type UpdateServiceLevelObjectiveCallback = (error: (Error|null), response?: google.monitoring.v3.ServiceLevelObjective) => void; + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#deleteServiceLevelObjective}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteServiceLevelObjectiveCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a CreateServiceRequest. */ + interface ICreateServiceRequest { + + /** CreateServiceRequest parent */ + parent?: (string|null); + + /** CreateServiceRequest serviceId */ + serviceId?: (string|null); + + /** CreateServiceRequest service */ + service?: (google.monitoring.v3.IService|null); + } + + /** Represents a CreateServiceRequest. */ + class CreateServiceRequest implements ICreateServiceRequest { + + /** + * Constructs a new CreateServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.ICreateServiceRequest); + + /** CreateServiceRequest parent. */ + public parent: string; + + /** CreateServiceRequest serviceId. */ + public serviceId: string; + + /** CreateServiceRequest service. */ + public service?: (google.monitoring.v3.IService|null); + + /** + * Creates a new CreateServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateServiceRequest instance + */ + public static create(properties?: google.monitoring.v3.ICreateServiceRequest): google.monitoring.v3.CreateServiceRequest; + + /** + * Encodes the specified CreateServiceRequest message. Does not implicitly {@link google.monitoring.v3.CreateServiceRequest.verify|verify} messages. + * @param message CreateServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.ICreateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateServiceRequest.verify|verify} messages. + * @param message CreateServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.ICreateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.CreateServiceRequest; + + /** + * Decodes a CreateServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.CreateServiceRequest; + + /** + * Verifies a CreateServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateServiceRequest; + + /** + * Creates a plain object from a CreateServiceRequest message. Also converts values to other types if specified. + * @param message CreateServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.CreateServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetServiceRequest. */ + interface IGetServiceRequest { + + /** GetServiceRequest name */ + name?: (string|null); + } + + /** Represents a GetServiceRequest. */ + class GetServiceRequest implements IGetServiceRequest { + + /** + * Constructs a new GetServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IGetServiceRequest); + + /** GetServiceRequest name. */ + public name: string; + + /** + * Creates a new GetServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetServiceRequest instance + */ + public static create(properties?: google.monitoring.v3.IGetServiceRequest): google.monitoring.v3.GetServiceRequest; + + /** + * Encodes the specified GetServiceRequest message. Does not implicitly {@link google.monitoring.v3.GetServiceRequest.verify|verify} messages. + * @param message GetServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IGetServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetServiceRequest.verify|verify} messages. + * @param message GetServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IGetServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.GetServiceRequest; + + /** + * Decodes a GetServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.GetServiceRequest; + + /** + * Verifies a GetServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetServiceRequest; + + /** + * Creates a plain object from a GetServiceRequest message. Also converts values to other types if specified. + * @param message GetServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.GetServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListServicesRequest. */ + interface IListServicesRequest { + + /** ListServicesRequest parent */ + parent?: (string|null); + + /** ListServicesRequest filter */ + filter?: (string|null); + + /** ListServicesRequest pageSize */ + pageSize?: (number|null); + + /** ListServicesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListServicesRequest. */ + class ListServicesRequest implements IListServicesRequest { + + /** + * Constructs a new ListServicesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IListServicesRequest); + + /** ListServicesRequest parent. */ + public parent: string; + + /** ListServicesRequest filter. */ + public filter: string; + + /** ListServicesRequest pageSize. */ + public pageSize: number; + + /** ListServicesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListServicesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListServicesRequest instance + */ + public static create(properties?: google.monitoring.v3.IListServicesRequest): google.monitoring.v3.ListServicesRequest; + + /** + * Encodes the specified ListServicesRequest message. Does not implicitly {@link google.monitoring.v3.ListServicesRequest.verify|verify} messages. + * @param message ListServicesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IListServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListServicesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServicesRequest.verify|verify} messages. + * @param message ListServicesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IListServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListServicesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListServicesRequest; + + /** + * Decodes a ListServicesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListServicesRequest; + + /** + * Verifies a ListServicesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListServicesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListServicesRequest + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListServicesRequest; + + /** + * Creates a plain object from a ListServicesRequest message. Also converts values to other types if specified. + * @param message ListServicesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.ListServicesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListServicesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListServicesResponse. */ + interface IListServicesResponse { + + /** ListServicesResponse services */ + services?: (google.monitoring.v3.IService[]|null); + + /** ListServicesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListServicesResponse. */ + class ListServicesResponse implements IListServicesResponse { + + /** + * Constructs a new ListServicesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IListServicesResponse); + + /** ListServicesResponse services. */ + public services: google.monitoring.v3.IService[]; + + /** ListServicesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListServicesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListServicesResponse instance + */ + public static create(properties?: google.monitoring.v3.IListServicesResponse): google.monitoring.v3.ListServicesResponse; + + /** + * Encodes the specified ListServicesResponse message. Does not implicitly {@link google.monitoring.v3.ListServicesResponse.verify|verify} messages. + * @param message ListServicesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IListServicesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListServicesResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServicesResponse.verify|verify} messages. + * @param message ListServicesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IListServicesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListServicesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListServicesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListServicesResponse; + + /** + * Decodes a ListServicesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListServicesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListServicesResponse; + + /** + * Verifies a ListServicesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListServicesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListServicesResponse + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListServicesResponse; + + /** + * Creates a plain object from a ListServicesResponse message. Also converts values to other types if specified. + * @param message ListServicesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.ListServicesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListServicesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateServiceRequest. */ + interface IUpdateServiceRequest { + + /** UpdateServiceRequest service */ + service?: (google.monitoring.v3.IService|null); + + /** UpdateServiceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateServiceRequest. */ + class UpdateServiceRequest implements IUpdateServiceRequest { + + /** + * Constructs a new UpdateServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IUpdateServiceRequest); + + /** UpdateServiceRequest service. */ + public service?: (google.monitoring.v3.IService|null); + + /** UpdateServiceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateServiceRequest instance + */ + public static create(properties?: google.monitoring.v3.IUpdateServiceRequest): google.monitoring.v3.UpdateServiceRequest; + + /** + * Encodes the specified UpdateServiceRequest message. Does not implicitly {@link google.monitoring.v3.UpdateServiceRequest.verify|verify} messages. + * @param message UpdateServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IUpdateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateServiceRequest.verify|verify} messages. + * @param message UpdateServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IUpdateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.UpdateServiceRequest; + + /** + * Decodes an UpdateServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.UpdateServiceRequest; + + /** + * Verifies an UpdateServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UpdateServiceRequest; + + /** + * Creates a plain object from an UpdateServiceRequest message. Also converts values to other types if specified. + * @param message UpdateServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.UpdateServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteServiceRequest. */ + interface IDeleteServiceRequest { + + /** DeleteServiceRequest name */ + name?: (string|null); + } + + /** Represents a DeleteServiceRequest. */ + class DeleteServiceRequest implements IDeleteServiceRequest { + + /** + * Constructs a new DeleteServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IDeleteServiceRequest); + + /** DeleteServiceRequest name. */ + public name: string; + + /** + * Creates a new DeleteServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteServiceRequest instance + */ + public static create(properties?: google.monitoring.v3.IDeleteServiceRequest): google.monitoring.v3.DeleteServiceRequest; + + /** + * Encodes the specified DeleteServiceRequest message. Does not implicitly {@link google.monitoring.v3.DeleteServiceRequest.verify|verify} messages. + * @param message DeleteServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IDeleteServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteServiceRequest.verify|verify} messages. + * @param message DeleteServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IDeleteServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.DeleteServiceRequest; + + /** + * Decodes a DeleteServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.DeleteServiceRequest; + + /** + * Verifies a DeleteServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.DeleteServiceRequest; + + /** + * Creates a plain object from a DeleteServiceRequest message. Also converts values to other types if specified. + * @param message DeleteServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.DeleteServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateServiceLevelObjectiveRequest. */ + interface ICreateServiceLevelObjectiveRequest { + + /** CreateServiceLevelObjectiveRequest parent */ + parent?: (string|null); + + /** CreateServiceLevelObjectiveRequest serviceLevelObjectiveId */ + serviceLevelObjectiveId?: (string|null); + + /** CreateServiceLevelObjectiveRequest serviceLevelObjective */ + serviceLevelObjective?: (google.monitoring.v3.IServiceLevelObjective|null); + } + + /** Represents a CreateServiceLevelObjectiveRequest. */ + class CreateServiceLevelObjectiveRequest implements ICreateServiceLevelObjectiveRequest { + + /** + * Constructs a new CreateServiceLevelObjectiveRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.ICreateServiceLevelObjectiveRequest); + + /** CreateServiceLevelObjectiveRequest parent. */ + public parent: string; + + /** CreateServiceLevelObjectiveRequest serviceLevelObjectiveId. */ + public serviceLevelObjectiveId: string; + + /** CreateServiceLevelObjectiveRequest serviceLevelObjective. */ + public serviceLevelObjective?: (google.monitoring.v3.IServiceLevelObjective|null); + + /** + * Creates a new CreateServiceLevelObjectiveRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateServiceLevelObjectiveRequest instance + */ + public static create(properties?: google.monitoring.v3.ICreateServiceLevelObjectiveRequest): google.monitoring.v3.CreateServiceLevelObjectiveRequest; + + /** + * Encodes the specified CreateServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.CreateServiceLevelObjectiveRequest.verify|verify} messages. + * @param message CreateServiceLevelObjectiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.ICreateServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateServiceLevelObjectiveRequest.verify|verify} messages. + * @param message CreateServiceLevelObjectiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.ICreateServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateServiceLevelObjectiveRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateServiceLevelObjectiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.CreateServiceLevelObjectiveRequest; + + /** + * Decodes a CreateServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateServiceLevelObjectiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.CreateServiceLevelObjectiveRequest; + + /** + * Verifies a CreateServiceLevelObjectiveRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateServiceLevelObjectiveRequest + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateServiceLevelObjectiveRequest; + + /** + * Creates a plain object from a CreateServiceLevelObjectiveRequest message. Also converts values to other types if specified. + * @param message CreateServiceLevelObjectiveRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.CreateServiceLevelObjectiveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateServiceLevelObjectiveRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetServiceLevelObjectiveRequest. */ + interface IGetServiceLevelObjectiveRequest { + + /** GetServiceLevelObjectiveRequest name */ + name?: (string|null); + + /** GetServiceLevelObjectiveRequest view */ + view?: (google.monitoring.v3.ServiceLevelObjective.View|null); + } + + /** Represents a GetServiceLevelObjectiveRequest. */ + class GetServiceLevelObjectiveRequest implements IGetServiceLevelObjectiveRequest { + + /** + * Constructs a new GetServiceLevelObjectiveRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IGetServiceLevelObjectiveRequest); + + /** GetServiceLevelObjectiveRequest name. */ + public name: string; + + /** GetServiceLevelObjectiveRequest view. */ + public view: google.monitoring.v3.ServiceLevelObjective.View; + + /** + * Creates a new GetServiceLevelObjectiveRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetServiceLevelObjectiveRequest instance + */ + public static create(properties?: google.monitoring.v3.IGetServiceLevelObjectiveRequest): google.monitoring.v3.GetServiceLevelObjectiveRequest; + + /** + * Encodes the specified GetServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.GetServiceLevelObjectiveRequest.verify|verify} messages. + * @param message GetServiceLevelObjectiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IGetServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetServiceLevelObjectiveRequest.verify|verify} messages. + * @param message GetServiceLevelObjectiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IGetServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetServiceLevelObjectiveRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetServiceLevelObjectiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.GetServiceLevelObjectiveRequest; + + /** + * Decodes a GetServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetServiceLevelObjectiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.GetServiceLevelObjectiveRequest; + + /** + * Verifies a GetServiceLevelObjectiveRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetServiceLevelObjectiveRequest + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetServiceLevelObjectiveRequest; + + /** + * Creates a plain object from a GetServiceLevelObjectiveRequest message. Also converts values to other types if specified. + * @param message GetServiceLevelObjectiveRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.GetServiceLevelObjectiveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetServiceLevelObjectiveRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListServiceLevelObjectivesRequest. */ + interface IListServiceLevelObjectivesRequest { + + /** ListServiceLevelObjectivesRequest parent */ + parent?: (string|null); + + /** ListServiceLevelObjectivesRequest filter */ + filter?: (string|null); + + /** ListServiceLevelObjectivesRequest pageSize */ + pageSize?: (number|null); + + /** ListServiceLevelObjectivesRequest pageToken */ + pageToken?: (string|null); + + /** ListServiceLevelObjectivesRequest view */ + view?: (google.monitoring.v3.ServiceLevelObjective.View|null); + } + + /** Represents a ListServiceLevelObjectivesRequest. */ + class ListServiceLevelObjectivesRequest implements IListServiceLevelObjectivesRequest { + + /** + * Constructs a new ListServiceLevelObjectivesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IListServiceLevelObjectivesRequest); + + /** ListServiceLevelObjectivesRequest parent. */ + public parent: string; + + /** ListServiceLevelObjectivesRequest filter. */ + public filter: string; + + /** ListServiceLevelObjectivesRequest pageSize. */ + public pageSize: number; + + /** ListServiceLevelObjectivesRequest pageToken. */ + public pageToken: string; + + /** ListServiceLevelObjectivesRequest view. */ + public view: google.monitoring.v3.ServiceLevelObjective.View; + + /** + * Creates a new ListServiceLevelObjectivesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListServiceLevelObjectivesRequest instance + */ + public static create(properties?: google.monitoring.v3.IListServiceLevelObjectivesRequest): google.monitoring.v3.ListServiceLevelObjectivesRequest; + + /** + * Encodes the specified ListServiceLevelObjectivesRequest message. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesRequest.verify|verify} messages. + * @param message ListServiceLevelObjectivesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IListServiceLevelObjectivesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListServiceLevelObjectivesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesRequest.verify|verify} messages. + * @param message ListServiceLevelObjectivesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IListServiceLevelObjectivesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListServiceLevelObjectivesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListServiceLevelObjectivesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListServiceLevelObjectivesRequest; + + /** + * Decodes a ListServiceLevelObjectivesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListServiceLevelObjectivesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListServiceLevelObjectivesRequest; + + /** + * Verifies a ListServiceLevelObjectivesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListServiceLevelObjectivesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListServiceLevelObjectivesRequest + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListServiceLevelObjectivesRequest; + + /** + * Creates a plain object from a ListServiceLevelObjectivesRequest message. Also converts values to other types if specified. + * @param message ListServiceLevelObjectivesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.ListServiceLevelObjectivesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListServiceLevelObjectivesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListServiceLevelObjectivesResponse. */ + interface IListServiceLevelObjectivesResponse { + + /** ListServiceLevelObjectivesResponse serviceLevelObjectives */ + serviceLevelObjectives?: (google.monitoring.v3.IServiceLevelObjective[]|null); + + /** ListServiceLevelObjectivesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListServiceLevelObjectivesResponse. */ + class ListServiceLevelObjectivesResponse implements IListServiceLevelObjectivesResponse { + + /** + * Constructs a new ListServiceLevelObjectivesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IListServiceLevelObjectivesResponse); + + /** ListServiceLevelObjectivesResponse serviceLevelObjectives. */ + public serviceLevelObjectives: google.monitoring.v3.IServiceLevelObjective[]; + + /** ListServiceLevelObjectivesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListServiceLevelObjectivesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListServiceLevelObjectivesResponse instance + */ + public static create(properties?: google.monitoring.v3.IListServiceLevelObjectivesResponse): google.monitoring.v3.ListServiceLevelObjectivesResponse; + + /** + * Encodes the specified ListServiceLevelObjectivesResponse message. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesResponse.verify|verify} messages. + * @param message ListServiceLevelObjectivesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IListServiceLevelObjectivesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListServiceLevelObjectivesResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesResponse.verify|verify} messages. + * @param message ListServiceLevelObjectivesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IListServiceLevelObjectivesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListServiceLevelObjectivesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListServiceLevelObjectivesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListServiceLevelObjectivesResponse; + + /** + * Decodes a ListServiceLevelObjectivesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListServiceLevelObjectivesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListServiceLevelObjectivesResponse; + + /** + * Verifies a ListServiceLevelObjectivesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListServiceLevelObjectivesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListServiceLevelObjectivesResponse + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListServiceLevelObjectivesResponse; + + /** + * Creates a plain object from a ListServiceLevelObjectivesResponse message. Also converts values to other types if specified. + * @param message ListServiceLevelObjectivesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.ListServiceLevelObjectivesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListServiceLevelObjectivesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateServiceLevelObjectiveRequest. */ + interface IUpdateServiceLevelObjectiveRequest { + + /** UpdateServiceLevelObjectiveRequest serviceLevelObjective */ + serviceLevelObjective?: (google.monitoring.v3.IServiceLevelObjective|null); + + /** UpdateServiceLevelObjectiveRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateServiceLevelObjectiveRequest. */ + class UpdateServiceLevelObjectiveRequest implements IUpdateServiceLevelObjectiveRequest { + + /** + * Constructs a new UpdateServiceLevelObjectiveRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IUpdateServiceLevelObjectiveRequest); + + /** UpdateServiceLevelObjectiveRequest serviceLevelObjective. */ + public serviceLevelObjective?: (google.monitoring.v3.IServiceLevelObjective|null); + + /** UpdateServiceLevelObjectiveRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateServiceLevelObjectiveRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateServiceLevelObjectiveRequest instance + */ + public static create(properties?: google.monitoring.v3.IUpdateServiceLevelObjectiveRequest): google.monitoring.v3.UpdateServiceLevelObjectiveRequest; + + /** + * Encodes the specified UpdateServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.UpdateServiceLevelObjectiveRequest.verify|verify} messages. + * @param message UpdateServiceLevelObjectiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IUpdateServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateServiceLevelObjectiveRequest.verify|verify} messages. + * @param message UpdateServiceLevelObjectiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IUpdateServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateServiceLevelObjectiveRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateServiceLevelObjectiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.UpdateServiceLevelObjectiveRequest; + + /** + * Decodes an UpdateServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateServiceLevelObjectiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.UpdateServiceLevelObjectiveRequest; + + /** + * Verifies an UpdateServiceLevelObjectiveRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateServiceLevelObjectiveRequest + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UpdateServiceLevelObjectiveRequest; + + /** + * Creates a plain object from an UpdateServiceLevelObjectiveRequest message. Also converts values to other types if specified. + * @param message UpdateServiceLevelObjectiveRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.UpdateServiceLevelObjectiveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateServiceLevelObjectiveRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteServiceLevelObjectiveRequest. */ + interface IDeleteServiceLevelObjectiveRequest { + + /** DeleteServiceLevelObjectiveRequest name */ + name?: (string|null); + } + + /** Represents a DeleteServiceLevelObjectiveRequest. */ + class DeleteServiceLevelObjectiveRequest implements IDeleteServiceLevelObjectiveRequest { + + /** + * Constructs a new DeleteServiceLevelObjectiveRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IDeleteServiceLevelObjectiveRequest); + + /** DeleteServiceLevelObjectiveRequest name. */ + public name: string; + + /** + * Creates a new DeleteServiceLevelObjectiveRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteServiceLevelObjectiveRequest instance + */ + public static create(properties?: google.monitoring.v3.IDeleteServiceLevelObjectiveRequest): google.monitoring.v3.DeleteServiceLevelObjectiveRequest; + + /** + * Encodes the specified DeleteServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.DeleteServiceLevelObjectiveRequest.verify|verify} messages. + * @param message DeleteServiceLevelObjectiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IDeleteServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteServiceLevelObjectiveRequest.verify|verify} messages. + * @param message DeleteServiceLevelObjectiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IDeleteServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteServiceLevelObjectiveRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteServiceLevelObjectiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.DeleteServiceLevelObjectiveRequest; + + /** + * Decodes a DeleteServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteServiceLevelObjectiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.DeleteServiceLevelObjectiveRequest; + + /** + * Verifies a DeleteServiceLevelObjectiveRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteServiceLevelObjectiveRequest + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.DeleteServiceLevelObjectiveRequest; + + /** + * Creates a plain object from a DeleteServiceLevelObjectiveRequest message. Also converts values to other types if specified. + * @param message DeleteServiceLevelObjectiveRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.DeleteServiceLevelObjectiveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteServiceLevelObjectiveRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Service. */ + interface IService { + + /** Service name */ + name?: (string|null); + + /** Service displayName */ + displayName?: (string|null); + + /** Service custom */ + custom?: (google.monitoring.v3.Service.ICustom|null); + + /** Service appEngine */ + appEngine?: (google.monitoring.v3.Service.IAppEngine|null); + + /** Service cloudEndpoints */ + cloudEndpoints?: (google.monitoring.v3.Service.ICloudEndpoints|null); + + /** Service clusterIstio */ + clusterIstio?: (google.monitoring.v3.Service.IClusterIstio|null); + + /** Service telemetry */ + telemetry?: (google.monitoring.v3.Service.ITelemetry|null); + } + + /** Represents a Service. */ + class Service implements IService { + + /** + * Constructs a new Service. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IService); + + /** Service name. */ + public name: string; + + /** Service displayName. */ + public displayName: string; + + /** Service custom. */ + public custom?: (google.monitoring.v3.Service.ICustom|null); + + /** Service appEngine. */ + public appEngine?: (google.monitoring.v3.Service.IAppEngine|null); + + /** Service cloudEndpoints. */ + public cloudEndpoints?: (google.monitoring.v3.Service.ICloudEndpoints|null); + + /** Service clusterIstio. */ + public clusterIstio?: (google.monitoring.v3.Service.IClusterIstio|null); + + /** Service telemetry. */ + public telemetry?: (google.monitoring.v3.Service.ITelemetry|null); + + /** Service identifier. */ + public identifier?: ("custom"|"appEngine"|"cloudEndpoints"|"clusterIstio"); + + /** + * Creates a new Service instance using the specified properties. + * @param [properties] Properties to set + * @returns Service instance + */ + public static create(properties?: google.monitoring.v3.IService): google.monitoring.v3.Service; + + /** + * Encodes the specified Service message. Does not implicitly {@link google.monitoring.v3.Service.verify|verify} messages. + * @param message Service message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Service message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.verify|verify} messages. + * @param message Service message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Service message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Service + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.Service; + + /** + * Decodes a Service message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Service + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.Service; + + /** + * Verifies a Service message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Service message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Service + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Service; + + /** + * Creates a plain object from a Service message. Also converts values to other types if specified. + * @param message Service + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.Service, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Service to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Service { + + /** Properties of a Custom. */ + interface ICustom { + } + + /** Represents a Custom. */ + class Custom implements ICustom { + + /** + * Constructs a new Custom. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.Service.ICustom); + + /** + * Creates a new Custom instance using the specified properties. + * @param [properties] Properties to set + * @returns Custom instance + */ + public static create(properties?: google.monitoring.v3.Service.ICustom): google.monitoring.v3.Service.Custom; + + /** + * Encodes the specified Custom message. Does not implicitly {@link google.monitoring.v3.Service.Custom.verify|verify} messages. + * @param message Custom message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.Service.ICustom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Custom message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.Custom.verify|verify} messages. + * @param message Custom message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.Service.ICustom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Custom message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Custom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.Service.Custom; + + /** + * Decodes a Custom message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Custom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.Service.Custom; + + /** + * Verifies a Custom message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Custom message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Custom + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Service.Custom; + + /** + * Creates a plain object from a Custom message. Also converts values to other types if specified. + * @param message Custom + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.Service.Custom, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Custom to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AppEngine. */ + interface IAppEngine { + + /** AppEngine moduleId */ + moduleId?: (string|null); + } + + /** Represents an AppEngine. */ + class AppEngine implements IAppEngine { + + /** + * Constructs a new AppEngine. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.Service.IAppEngine); + + /** AppEngine moduleId. */ + public moduleId: string; + + /** + * Creates a new AppEngine instance using the specified properties. + * @param [properties] Properties to set + * @returns AppEngine instance + */ + public static create(properties?: google.monitoring.v3.Service.IAppEngine): google.monitoring.v3.Service.AppEngine; + + /** + * Encodes the specified AppEngine message. Does not implicitly {@link google.monitoring.v3.Service.AppEngine.verify|verify} messages. + * @param message AppEngine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.Service.IAppEngine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AppEngine message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.AppEngine.verify|verify} messages. + * @param message AppEngine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.Service.IAppEngine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AppEngine message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AppEngine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.Service.AppEngine; + + /** + * Decodes an AppEngine message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AppEngine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.Service.AppEngine; + + /** + * Verifies an AppEngine message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AppEngine message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AppEngine + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Service.AppEngine; + + /** + * Creates a plain object from an AppEngine message. Also converts values to other types if specified. + * @param message AppEngine + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.Service.AppEngine, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AppEngine to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CloudEndpoints. */ + interface ICloudEndpoints { + + /** CloudEndpoints service */ + service?: (string|null); + } + + /** Represents a CloudEndpoints. */ + class CloudEndpoints implements ICloudEndpoints { + + /** + * Constructs a new CloudEndpoints. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.Service.ICloudEndpoints); + + /** CloudEndpoints service. */ + public service: string; + + /** + * Creates a new CloudEndpoints instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudEndpoints instance + */ + public static create(properties?: google.monitoring.v3.Service.ICloudEndpoints): google.monitoring.v3.Service.CloudEndpoints; + + /** + * Encodes the specified CloudEndpoints message. Does not implicitly {@link google.monitoring.v3.Service.CloudEndpoints.verify|verify} messages. + * @param message CloudEndpoints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.Service.ICloudEndpoints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudEndpoints message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.CloudEndpoints.verify|verify} messages. + * @param message CloudEndpoints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.Service.ICloudEndpoints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudEndpoints message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudEndpoints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.Service.CloudEndpoints; + + /** + * Decodes a CloudEndpoints message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudEndpoints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.Service.CloudEndpoints; + + /** + * Verifies a CloudEndpoints message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudEndpoints message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudEndpoints + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Service.CloudEndpoints; + + /** + * Creates a plain object from a CloudEndpoints message. Also converts values to other types if specified. + * @param message CloudEndpoints + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.Service.CloudEndpoints, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudEndpoints to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ClusterIstio. */ + interface IClusterIstio { + + /** ClusterIstio location */ + location?: (string|null); + + /** ClusterIstio clusterName */ + clusterName?: (string|null); + + /** ClusterIstio serviceNamespace */ + serviceNamespace?: (string|null); + + /** ClusterIstio serviceName */ + serviceName?: (string|null); + } + + /** Represents a ClusterIstio. */ + class ClusterIstio implements IClusterIstio { + + /** + * Constructs a new ClusterIstio. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.Service.IClusterIstio); + + /** ClusterIstio location. */ + public location: string; + + /** ClusterIstio clusterName. */ + public clusterName: string; + + /** ClusterIstio serviceNamespace. */ + public serviceNamespace: string; + + /** ClusterIstio serviceName. */ + public serviceName: string; + + /** + * Creates a new ClusterIstio instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterIstio instance + */ + public static create(properties?: google.monitoring.v3.Service.IClusterIstio): google.monitoring.v3.Service.ClusterIstio; + + /** + * Encodes the specified ClusterIstio message. Does not implicitly {@link google.monitoring.v3.Service.ClusterIstio.verify|verify} messages. + * @param message ClusterIstio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.Service.IClusterIstio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusterIstio message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.ClusterIstio.verify|verify} messages. + * @param message ClusterIstio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.Service.IClusterIstio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusterIstio message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterIstio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.Service.ClusterIstio; + + /** + * Decodes a ClusterIstio message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterIstio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.Service.ClusterIstio; + + /** + * Verifies a ClusterIstio message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusterIstio message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterIstio + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Service.ClusterIstio; + + /** + * Creates a plain object from a ClusterIstio message. Also converts values to other types if specified. + * @param message ClusterIstio + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.Service.ClusterIstio, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterIstio to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Telemetry. */ + interface ITelemetry { + + /** Telemetry resourceName */ + resourceName?: (string|null); + } + + /** Represents a Telemetry. */ + class Telemetry implements ITelemetry { + + /** + * Constructs a new Telemetry. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.Service.ITelemetry); + + /** Telemetry resourceName. */ + public resourceName: string; + + /** + * Creates a new Telemetry instance using the specified properties. + * @param [properties] Properties to set + * @returns Telemetry instance + */ + public static create(properties?: google.monitoring.v3.Service.ITelemetry): google.monitoring.v3.Service.Telemetry; + + /** + * Encodes the specified Telemetry message. Does not implicitly {@link google.monitoring.v3.Service.Telemetry.verify|verify} messages. + * @param message Telemetry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.Service.ITelemetry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Telemetry message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.Telemetry.verify|verify} messages. + * @param message Telemetry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.Service.ITelemetry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Telemetry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Telemetry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.Service.Telemetry; + + /** + * Decodes a Telemetry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Telemetry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.Service.Telemetry; + + /** + * Verifies a Telemetry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Telemetry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Telemetry + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Service.Telemetry; + + /** + * Creates a plain object from a Telemetry message. Also converts values to other types if specified. + * @param message Telemetry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.Service.Telemetry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Telemetry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a ServiceLevelObjective. */ + interface IServiceLevelObjective { + + /** ServiceLevelObjective name */ + name?: (string|null); + + /** ServiceLevelObjective displayName */ + displayName?: (string|null); + + /** ServiceLevelObjective serviceLevelIndicator */ + serviceLevelIndicator?: (google.monitoring.v3.IServiceLevelIndicator|null); + + /** ServiceLevelObjective goal */ + goal?: (number|null); + + /** ServiceLevelObjective rollingPeriod */ + rollingPeriod?: (google.protobuf.IDuration|null); + + /** ServiceLevelObjective calendarPeriod */ + calendarPeriod?: (google.type.CalendarPeriod|null); + } + + /** Represents a ServiceLevelObjective. */ + class ServiceLevelObjective implements IServiceLevelObjective { + + /** + * Constructs a new ServiceLevelObjective. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IServiceLevelObjective); + + /** ServiceLevelObjective name. */ + public name: string; + + /** ServiceLevelObjective displayName. */ + public displayName: string; + + /** ServiceLevelObjective serviceLevelIndicator. */ + public serviceLevelIndicator?: (google.monitoring.v3.IServiceLevelIndicator|null); + + /** ServiceLevelObjective goal. */ + public goal: number; + + /** ServiceLevelObjective rollingPeriod. */ + public rollingPeriod?: (google.protobuf.IDuration|null); + + /** ServiceLevelObjective calendarPeriod. */ + public calendarPeriod: google.type.CalendarPeriod; + + /** ServiceLevelObjective period. */ + public period?: ("rollingPeriod"|"calendarPeriod"); + + /** + * Creates a new ServiceLevelObjective instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceLevelObjective instance + */ + public static create(properties?: google.monitoring.v3.IServiceLevelObjective): google.monitoring.v3.ServiceLevelObjective; + + /** + * Encodes the specified ServiceLevelObjective message. Does not implicitly {@link google.monitoring.v3.ServiceLevelObjective.verify|verify} messages. + * @param message ServiceLevelObjective message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IServiceLevelObjective, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceLevelObjective message, length delimited. Does not implicitly {@link google.monitoring.v3.ServiceLevelObjective.verify|verify} messages. + * @param message ServiceLevelObjective message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IServiceLevelObjective, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceLevelObjective message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceLevelObjective + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ServiceLevelObjective; + + /** + * Decodes a ServiceLevelObjective message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceLevelObjective + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ServiceLevelObjective; + + /** + * Verifies a ServiceLevelObjective message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceLevelObjective message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceLevelObjective + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ServiceLevelObjective; + + /** + * Creates a plain object from a ServiceLevelObjective message. Also converts values to other types if specified. + * @param message ServiceLevelObjective + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.ServiceLevelObjective, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceLevelObjective to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ServiceLevelObjective { + + /** View enum. */ + enum View { + VIEW_UNSPECIFIED = 0, + FULL = 2, + EXPLICIT = 1 + } + } + + /** Properties of a ServiceLevelIndicator. */ + interface IServiceLevelIndicator { + + /** ServiceLevelIndicator basicSli */ + basicSli?: (google.monitoring.v3.IBasicSli|null); + + /** ServiceLevelIndicator requestBased */ + requestBased?: (google.monitoring.v3.IRequestBasedSli|null); + + /** ServiceLevelIndicator windowsBased */ + windowsBased?: (google.monitoring.v3.IWindowsBasedSli|null); + } + + /** Represents a ServiceLevelIndicator. */ + class ServiceLevelIndicator implements IServiceLevelIndicator { + + /** + * Constructs a new ServiceLevelIndicator. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IServiceLevelIndicator); + + /** ServiceLevelIndicator basicSli. */ + public basicSli?: (google.monitoring.v3.IBasicSli|null); + + /** ServiceLevelIndicator requestBased. */ + public requestBased?: (google.monitoring.v3.IRequestBasedSli|null); + + /** ServiceLevelIndicator windowsBased. */ + public windowsBased?: (google.monitoring.v3.IWindowsBasedSli|null); + + /** ServiceLevelIndicator type. */ + public type?: ("basicSli"|"requestBased"|"windowsBased"); + + /** + * Creates a new ServiceLevelIndicator instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceLevelIndicator instance + */ + public static create(properties?: google.monitoring.v3.IServiceLevelIndicator): google.monitoring.v3.ServiceLevelIndicator; + + /** + * Encodes the specified ServiceLevelIndicator message. Does not implicitly {@link google.monitoring.v3.ServiceLevelIndicator.verify|verify} messages. + * @param message ServiceLevelIndicator message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IServiceLevelIndicator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceLevelIndicator message, length delimited. Does not implicitly {@link google.monitoring.v3.ServiceLevelIndicator.verify|verify} messages. + * @param message ServiceLevelIndicator message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IServiceLevelIndicator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceLevelIndicator message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceLevelIndicator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ServiceLevelIndicator; + + /** + * Decodes a ServiceLevelIndicator message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceLevelIndicator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ServiceLevelIndicator; + + /** + * Verifies a ServiceLevelIndicator message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceLevelIndicator message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceLevelIndicator + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ServiceLevelIndicator; + + /** + * Creates a plain object from a ServiceLevelIndicator message. Also converts values to other types if specified. + * @param message ServiceLevelIndicator + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.ServiceLevelIndicator, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceLevelIndicator to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BasicSli. */ + interface IBasicSli { + + /** BasicSli method */ + method?: (string[]|null); + + /** BasicSli location */ + location?: (string[]|null); + + /** BasicSli version */ + version?: (string[]|null); + + /** BasicSli availability */ + availability?: (google.monitoring.v3.BasicSli.IAvailabilityCriteria|null); + + /** BasicSli latency */ + latency?: (google.monitoring.v3.BasicSli.ILatencyCriteria|null); + } + + /** Represents a BasicSli. */ + class BasicSli implements IBasicSli { + + /** + * Constructs a new BasicSli. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IBasicSli); + + /** BasicSli method. */ + public method: string[]; + + /** BasicSli location. */ + public location: string[]; + + /** BasicSli version. */ + public version: string[]; + + /** BasicSli availability. */ + public availability?: (google.monitoring.v3.BasicSli.IAvailabilityCriteria|null); + + /** BasicSli latency. */ + public latency?: (google.monitoring.v3.BasicSli.ILatencyCriteria|null); + + /** BasicSli sliCriteria. */ + public sliCriteria?: ("availability"|"latency"); + + /** + * Creates a new BasicSli instance using the specified properties. + * @param [properties] Properties to set + * @returns BasicSli instance + */ + public static create(properties?: google.monitoring.v3.IBasicSli): google.monitoring.v3.BasicSli; + + /** + * Encodes the specified BasicSli message. Does not implicitly {@link google.monitoring.v3.BasicSli.verify|verify} messages. + * @param message BasicSli message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IBasicSli, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BasicSli message, length delimited. Does not implicitly {@link google.monitoring.v3.BasicSli.verify|verify} messages. + * @param message BasicSli message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IBasicSli, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BasicSli message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BasicSli + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.BasicSli; + + /** + * Decodes a BasicSli message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BasicSli + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.BasicSli; + + /** + * Verifies a BasicSli message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BasicSli message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BasicSli + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.BasicSli; + + /** + * Creates a plain object from a BasicSli message. Also converts values to other types if specified. + * @param message BasicSli + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.BasicSli, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BasicSli to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BasicSli { + + /** Properties of an AvailabilityCriteria. */ + interface IAvailabilityCriteria { + } + + /** Represents an AvailabilityCriteria. */ + class AvailabilityCriteria implements IAvailabilityCriteria { + + /** + * Constructs a new AvailabilityCriteria. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.BasicSli.IAvailabilityCriteria); + + /** + * Creates a new AvailabilityCriteria instance using the specified properties. + * @param [properties] Properties to set + * @returns AvailabilityCriteria instance + */ + public static create(properties?: google.monitoring.v3.BasicSli.IAvailabilityCriteria): google.monitoring.v3.BasicSli.AvailabilityCriteria; + + /** + * Encodes the specified AvailabilityCriteria message. Does not implicitly {@link google.monitoring.v3.BasicSli.AvailabilityCriteria.verify|verify} messages. + * @param message AvailabilityCriteria message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.BasicSli.IAvailabilityCriteria, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AvailabilityCriteria message, length delimited. Does not implicitly {@link google.monitoring.v3.BasicSli.AvailabilityCriteria.verify|verify} messages. + * @param message AvailabilityCriteria message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.BasicSli.IAvailabilityCriteria, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AvailabilityCriteria message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AvailabilityCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.BasicSli.AvailabilityCriteria; + + /** + * Decodes an AvailabilityCriteria message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AvailabilityCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.BasicSli.AvailabilityCriteria; + + /** + * Verifies an AvailabilityCriteria message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AvailabilityCriteria message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AvailabilityCriteria + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.BasicSli.AvailabilityCriteria; + + /** + * Creates a plain object from an AvailabilityCriteria message. Also converts values to other types if specified. + * @param message AvailabilityCriteria + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.BasicSli.AvailabilityCriteria, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AvailabilityCriteria to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LatencyCriteria. */ + interface ILatencyCriteria { + + /** LatencyCriteria threshold */ + threshold?: (google.protobuf.IDuration|null); + } + + /** Represents a LatencyCriteria. */ + class LatencyCriteria implements ILatencyCriteria { + + /** + * Constructs a new LatencyCriteria. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.BasicSli.ILatencyCriteria); + + /** LatencyCriteria threshold. */ + public threshold?: (google.protobuf.IDuration|null); + + /** + * Creates a new LatencyCriteria instance using the specified properties. + * @param [properties] Properties to set + * @returns LatencyCriteria instance + */ + public static create(properties?: google.monitoring.v3.BasicSli.ILatencyCriteria): google.monitoring.v3.BasicSli.LatencyCriteria; + + /** + * Encodes the specified LatencyCriteria message. Does not implicitly {@link google.monitoring.v3.BasicSli.LatencyCriteria.verify|verify} messages. + * @param message LatencyCriteria message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.BasicSli.ILatencyCriteria, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LatencyCriteria message, length delimited. Does not implicitly {@link google.monitoring.v3.BasicSli.LatencyCriteria.verify|verify} messages. + * @param message LatencyCriteria message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.BasicSli.ILatencyCriteria, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LatencyCriteria message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LatencyCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.BasicSli.LatencyCriteria; + + /** + * Decodes a LatencyCriteria message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LatencyCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.BasicSli.LatencyCriteria; + + /** + * Verifies a LatencyCriteria message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LatencyCriteria message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LatencyCriteria + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.BasicSli.LatencyCriteria; + + /** + * Creates a plain object from a LatencyCriteria message. Also converts values to other types if specified. + * @param message LatencyCriteria + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.BasicSli.LatencyCriteria, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LatencyCriteria to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a Range. */ + interface IRange { + + /** Range min */ + min?: (number|null); + + /** Range max */ + max?: (number|null); + } + + /** Represents a Range. */ + class Range implements IRange { + + /** + * Constructs a new Range. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IRange); + + /** Range min. */ + public min: number; + + /** Range max. */ + public max: number; + + /** + * Creates a new Range instance using the specified properties. + * @param [properties] Properties to set + * @returns Range instance + */ + public static create(properties?: google.monitoring.v3.IRange): google.monitoring.v3.Range; + + /** + * Encodes the specified Range message. Does not implicitly {@link google.monitoring.v3.Range.verify|verify} messages. + * @param message Range message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Range message, length delimited. Does not implicitly {@link google.monitoring.v3.Range.verify|verify} messages. + * @param message Range message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Range message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.Range; + + /** + * Decodes a Range message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.Range; + + /** + * Verifies a Range message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Range message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Range + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Range; + + /** + * Creates a plain object from a Range message. Also converts values to other types if specified. + * @param message Range + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.Range, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Range to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RequestBasedSli. */ + interface IRequestBasedSli { + + /** RequestBasedSli goodTotalRatio */ + goodTotalRatio?: (google.monitoring.v3.ITimeSeriesRatio|null); + + /** RequestBasedSli distributionCut */ + distributionCut?: (google.monitoring.v3.IDistributionCut|null); + } + + /** Represents a RequestBasedSli. */ + class RequestBasedSli implements IRequestBasedSli { + + /** + * Constructs a new RequestBasedSli. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IRequestBasedSli); + + /** RequestBasedSli goodTotalRatio. */ + public goodTotalRatio?: (google.monitoring.v3.ITimeSeriesRatio|null); + + /** RequestBasedSli distributionCut. */ + public distributionCut?: (google.monitoring.v3.IDistributionCut|null); + + /** RequestBasedSli method. */ + public method?: ("goodTotalRatio"|"distributionCut"); + + /** + * Creates a new RequestBasedSli instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestBasedSli instance + */ + public static create(properties?: google.monitoring.v3.IRequestBasedSli): google.monitoring.v3.RequestBasedSli; + + /** + * Encodes the specified RequestBasedSli message. Does not implicitly {@link google.monitoring.v3.RequestBasedSli.verify|verify} messages. + * @param message RequestBasedSli message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IRequestBasedSli, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RequestBasedSli message, length delimited. Does not implicitly {@link google.monitoring.v3.RequestBasedSli.verify|verify} messages. + * @param message RequestBasedSli message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IRequestBasedSli, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RequestBasedSli message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestBasedSli + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.RequestBasedSli; + + /** + * Decodes a RequestBasedSli message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestBasedSli + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.RequestBasedSli; + + /** + * Verifies a RequestBasedSli message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RequestBasedSli message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestBasedSli + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.RequestBasedSli; + + /** + * Creates a plain object from a RequestBasedSli message. Also converts values to other types if specified. + * @param message RequestBasedSli + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.RequestBasedSli, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RequestBasedSli to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TimeSeriesRatio. */ + interface ITimeSeriesRatio { + + /** TimeSeriesRatio goodServiceFilter */ + goodServiceFilter?: (string|null); + + /** TimeSeriesRatio badServiceFilter */ + badServiceFilter?: (string|null); + + /** TimeSeriesRatio totalServiceFilter */ + totalServiceFilter?: (string|null); + } + + /** Represents a TimeSeriesRatio. */ + class TimeSeriesRatio implements ITimeSeriesRatio { + + /** + * Constructs a new TimeSeriesRatio. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.ITimeSeriesRatio); + + /** TimeSeriesRatio goodServiceFilter. */ + public goodServiceFilter: string; + + /** TimeSeriesRatio badServiceFilter. */ + public badServiceFilter: string; + + /** TimeSeriesRatio totalServiceFilter. */ + public totalServiceFilter: string; + + /** + * Creates a new TimeSeriesRatio instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeSeriesRatio instance + */ + public static create(properties?: google.monitoring.v3.ITimeSeriesRatio): google.monitoring.v3.TimeSeriesRatio; + + /** + * Encodes the specified TimeSeriesRatio message. Does not implicitly {@link google.monitoring.v3.TimeSeriesRatio.verify|verify} messages. + * @param message TimeSeriesRatio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.ITimeSeriesRatio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeSeriesRatio message, length delimited. Does not implicitly {@link google.monitoring.v3.TimeSeriesRatio.verify|verify} messages. + * @param message TimeSeriesRatio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.ITimeSeriesRatio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeSeriesRatio message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeSeriesRatio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.TimeSeriesRatio; + + /** + * Decodes a TimeSeriesRatio message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeSeriesRatio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.TimeSeriesRatio; + + /** + * Verifies a TimeSeriesRatio message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeSeriesRatio message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeSeriesRatio + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.TimeSeriesRatio; + + /** + * Creates a plain object from a TimeSeriesRatio message. Also converts values to other types if specified. + * @param message TimeSeriesRatio + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.TimeSeriesRatio, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeSeriesRatio to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DistributionCut. */ + interface IDistributionCut { + + /** DistributionCut distributionFilter */ + distributionFilter?: (string|null); + + /** DistributionCut range */ + range?: (google.monitoring.v3.IRange|null); + } + + /** Represents a DistributionCut. */ + class DistributionCut implements IDistributionCut { + + /** + * Constructs a new DistributionCut. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IDistributionCut); + + /** DistributionCut distributionFilter. */ + public distributionFilter: string; + + /** DistributionCut range. */ + public range?: (google.monitoring.v3.IRange|null); + + /** + * Creates a new DistributionCut instance using the specified properties. + * @param [properties] Properties to set + * @returns DistributionCut instance + */ + public static create(properties?: google.monitoring.v3.IDistributionCut): google.monitoring.v3.DistributionCut; + + /** + * Encodes the specified DistributionCut message. Does not implicitly {@link google.monitoring.v3.DistributionCut.verify|verify} messages. + * @param message DistributionCut message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IDistributionCut, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DistributionCut message, length delimited. Does not implicitly {@link google.monitoring.v3.DistributionCut.verify|verify} messages. + * @param message DistributionCut message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IDistributionCut, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DistributionCut message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DistributionCut + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.DistributionCut; + + /** + * Decodes a DistributionCut message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DistributionCut + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.DistributionCut; + + /** + * Verifies a DistributionCut message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DistributionCut message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DistributionCut + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.DistributionCut; + + /** + * Creates a plain object from a DistributionCut message. Also converts values to other types if specified. + * @param message DistributionCut + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.DistributionCut, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DistributionCut to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WindowsBasedSli. */ + interface IWindowsBasedSli { + + /** WindowsBasedSli goodBadMetricFilter */ + goodBadMetricFilter?: (string|null); + + /** WindowsBasedSli goodTotalRatioThreshold */ + goodTotalRatioThreshold?: (google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold|null); + + /** WindowsBasedSli metricMeanInRange */ + metricMeanInRange?: (google.monitoring.v3.WindowsBasedSli.IMetricRange|null); + + /** WindowsBasedSli metricSumInRange */ + metricSumInRange?: (google.monitoring.v3.WindowsBasedSli.IMetricRange|null); + + /** WindowsBasedSli windowPeriod */ + windowPeriod?: (google.protobuf.IDuration|null); + } + + /** Represents a WindowsBasedSli. */ + class WindowsBasedSli implements IWindowsBasedSli { + + /** + * Constructs a new WindowsBasedSli. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IWindowsBasedSli); + + /** WindowsBasedSli goodBadMetricFilter. */ + public goodBadMetricFilter: string; + + /** WindowsBasedSli goodTotalRatioThreshold. */ + public goodTotalRatioThreshold?: (google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold|null); + + /** WindowsBasedSli metricMeanInRange. */ + public metricMeanInRange?: (google.monitoring.v3.WindowsBasedSli.IMetricRange|null); + + /** WindowsBasedSli metricSumInRange. */ + public metricSumInRange?: (google.monitoring.v3.WindowsBasedSli.IMetricRange|null); + + /** WindowsBasedSli windowPeriod. */ + public windowPeriod?: (google.protobuf.IDuration|null); + + /** WindowsBasedSli windowCriterion. */ + public windowCriterion?: ("goodBadMetricFilter"|"goodTotalRatioThreshold"|"metricMeanInRange"|"metricSumInRange"); + + /** + * Creates a new WindowsBasedSli instance using the specified properties. + * @param [properties] Properties to set + * @returns WindowsBasedSli instance + */ + public static create(properties?: google.monitoring.v3.IWindowsBasedSli): google.monitoring.v3.WindowsBasedSli; + + /** + * Encodes the specified WindowsBasedSli message. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.verify|verify} messages. + * @param message WindowsBasedSli message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IWindowsBasedSli, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WindowsBasedSli message, length delimited. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.verify|verify} messages. + * @param message WindowsBasedSli message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IWindowsBasedSli, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WindowsBasedSli message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WindowsBasedSli + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.WindowsBasedSli; + + /** + * Decodes a WindowsBasedSli message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WindowsBasedSli + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.WindowsBasedSli; + + /** + * Verifies a WindowsBasedSli message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WindowsBasedSli message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WindowsBasedSli + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.WindowsBasedSli; + + /** + * Creates a plain object from a WindowsBasedSli message. Also converts values to other types if specified. + * @param message WindowsBasedSli + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.WindowsBasedSli, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WindowsBasedSli to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace WindowsBasedSli { + + /** Properties of a PerformanceThreshold. */ + interface IPerformanceThreshold { + + /** PerformanceThreshold performance */ + performance?: (google.monitoring.v3.IRequestBasedSli|null); + + /** PerformanceThreshold basicSliPerformance */ + basicSliPerformance?: (google.monitoring.v3.IBasicSli|null); + + /** PerformanceThreshold threshold */ + threshold?: (number|null); + } + + /** Represents a PerformanceThreshold. */ + class PerformanceThreshold implements IPerformanceThreshold { + + /** + * Constructs a new PerformanceThreshold. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold); + + /** PerformanceThreshold performance. */ + public performance?: (google.monitoring.v3.IRequestBasedSli|null); + + /** PerformanceThreshold basicSliPerformance. */ + public basicSliPerformance?: (google.monitoring.v3.IBasicSli|null); + + /** PerformanceThreshold threshold. */ + public threshold: number; + + /** PerformanceThreshold type. */ + public type?: ("performance"|"basicSliPerformance"); + + /** + * Creates a new PerformanceThreshold instance using the specified properties. + * @param [properties] Properties to set + * @returns PerformanceThreshold instance + */ + public static create(properties?: google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold): google.monitoring.v3.WindowsBasedSli.PerformanceThreshold; + + /** + * Encodes the specified PerformanceThreshold message. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.verify|verify} messages. + * @param message PerformanceThreshold message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PerformanceThreshold message, length delimited. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.verify|verify} messages. + * @param message PerformanceThreshold message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PerformanceThreshold message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PerformanceThreshold + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.WindowsBasedSli.PerformanceThreshold; + + /** + * Decodes a PerformanceThreshold message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PerformanceThreshold + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.WindowsBasedSli.PerformanceThreshold; + + /** + * Verifies a PerformanceThreshold message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PerformanceThreshold message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PerformanceThreshold + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.WindowsBasedSli.PerformanceThreshold; + + /** + * Creates a plain object from a PerformanceThreshold message. Also converts values to other types if specified. + * @param message PerformanceThreshold + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.WindowsBasedSli.PerformanceThreshold, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PerformanceThreshold to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MetricRange. */ + interface IMetricRange { + + /** MetricRange timeSeries */ + timeSeries?: (string|null); + + /** MetricRange range */ + range?: (google.monitoring.v3.IRange|null); + } + + /** Represents a MetricRange. */ + class MetricRange implements IMetricRange { + + /** + * Constructs a new MetricRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.WindowsBasedSli.IMetricRange); + + /** MetricRange timeSeries. */ + public timeSeries: string; + + /** MetricRange range. */ + public range?: (google.monitoring.v3.IRange|null); + + /** + * Creates a new MetricRange instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricRange instance + */ + public static create(properties?: google.monitoring.v3.WindowsBasedSli.IMetricRange): google.monitoring.v3.WindowsBasedSli.MetricRange; + + /** + * Encodes the specified MetricRange message. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.MetricRange.verify|verify} messages. + * @param message MetricRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.WindowsBasedSli.IMetricRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricRange message, length delimited. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.MetricRange.verify|verify} messages. + * @param message MetricRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.WindowsBasedSli.IMetricRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.WindowsBasedSli.MetricRange; + + /** + * Decodes a MetricRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.WindowsBasedSli.MetricRange; + + /** + * Verifies a MetricRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetricRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricRange + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.WindowsBasedSli.MetricRange; + + /** + * Creates a plain object from a MetricRange message. Also converts values to other types if specified. + * @param message MetricRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.WindowsBasedSli.MetricRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + /** Represents an UptimeCheckService */ class UptimeCheckService extends $protobuf.rpc.Service { @@ -14831,4 +18081,20 @@ export namespace google { public toJSON(): { [k: string]: any }; } } + + /** Namespace type. */ + namespace type { + + /** CalendarPeriod enum. */ + enum CalendarPeriod { + CALENDAR_PERIOD_UNSPECIFIED = 0, + DAY = 1, + WEEK = 2, + FORTNIGHT = 3, + MONTH = 4, + QUARTER = 5, + HALF = 6, + YEAR = 7 + } + } } diff --git a/packages/google-cloud-monitoring/protos/protos.js b/packages/google-cloud-monitoring/protos/protos.js index fba4a68cd2a..bfd444d1eec 100644 --- a/packages/google-cloud-monitoring/protos/protos.js +++ b/packages/google-cloud-monitoring/protos/protos.js @@ -15051,6 +15051,7550 @@ return NotificationChannel; })(); + v3.ServiceMonitoringService = (function() { + + /** + * Constructs a new ServiceMonitoringService service. + * @memberof google.monitoring.v3 + * @classdesc Represents a ServiceMonitoringService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function ServiceMonitoringService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ServiceMonitoringService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ServiceMonitoringService; + + /** + * Creates new ServiceMonitoringService service using the specified rpc implementation. + * @function create + * @memberof google.monitoring.v3.ServiceMonitoringService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {ServiceMonitoringService} RPC service. Useful where requests and/or responses are streamed. + */ + ServiceMonitoringService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#createService}. + * @memberof google.monitoring.v3.ServiceMonitoringService + * @typedef CreateServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.Service} [response] Service + */ + + /** + * Calls CreateService. + * @function createService + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.ICreateServiceRequest} request CreateServiceRequest message or plain object + * @param {google.monitoring.v3.ServiceMonitoringService.CreateServiceCallback} callback Node-style callback called with the error, if any, and Service + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceMonitoringService.prototype.createService = function createService(request, callback) { + return this.rpcCall(createService, $root.google.monitoring.v3.CreateServiceRequest, $root.google.monitoring.v3.Service, request, callback); + }, "name", { value: "CreateService" }); + + /** + * Calls CreateService. + * @function createService + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.ICreateServiceRequest} request CreateServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#getService}. + * @memberof google.monitoring.v3.ServiceMonitoringService + * @typedef GetServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.Service} [response] Service + */ + + /** + * Calls GetService. + * @function getService + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IGetServiceRequest} request GetServiceRequest message or plain object + * @param {google.monitoring.v3.ServiceMonitoringService.GetServiceCallback} callback Node-style callback called with the error, if any, and Service + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceMonitoringService.prototype.getService = function getService(request, callback) { + return this.rpcCall(getService, $root.google.monitoring.v3.GetServiceRequest, $root.google.monitoring.v3.Service, request, callback); + }, "name", { value: "GetService" }); + + /** + * Calls GetService. + * @function getService + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IGetServiceRequest} request GetServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#listServices}. + * @memberof google.monitoring.v3.ServiceMonitoringService + * @typedef ListServicesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.ListServicesResponse} [response] ListServicesResponse + */ + + /** + * Calls ListServices. + * @function listServices + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IListServicesRequest} request ListServicesRequest message or plain object + * @param {google.monitoring.v3.ServiceMonitoringService.ListServicesCallback} callback Node-style callback called with the error, if any, and ListServicesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceMonitoringService.prototype.listServices = function listServices(request, callback) { + return this.rpcCall(listServices, $root.google.monitoring.v3.ListServicesRequest, $root.google.monitoring.v3.ListServicesResponse, request, callback); + }, "name", { value: "ListServices" }); + + /** + * Calls ListServices. + * @function listServices + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IListServicesRequest} request ListServicesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#updateService}. + * @memberof google.monitoring.v3.ServiceMonitoringService + * @typedef UpdateServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.Service} [response] Service + */ + + /** + * Calls UpdateService. + * @function updateService + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IUpdateServiceRequest} request UpdateServiceRequest message or plain object + * @param {google.monitoring.v3.ServiceMonitoringService.UpdateServiceCallback} callback Node-style callback called with the error, if any, and Service + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceMonitoringService.prototype.updateService = function updateService(request, callback) { + return this.rpcCall(updateService, $root.google.monitoring.v3.UpdateServiceRequest, $root.google.monitoring.v3.Service, request, callback); + }, "name", { value: "UpdateService" }); + + /** + * Calls UpdateService. + * @function updateService + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IUpdateServiceRequest} request UpdateServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#deleteService}. + * @memberof google.monitoring.v3.ServiceMonitoringService + * @typedef DeleteServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteService. + * @function deleteService + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IDeleteServiceRequest} request DeleteServiceRequest message or plain object + * @param {google.monitoring.v3.ServiceMonitoringService.DeleteServiceCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceMonitoringService.prototype.deleteService = function deleteService(request, callback) { + return this.rpcCall(deleteService, $root.google.monitoring.v3.DeleteServiceRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteService" }); + + /** + * Calls DeleteService. + * @function deleteService + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IDeleteServiceRequest} request DeleteServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#createServiceLevelObjective}. + * @memberof google.monitoring.v3.ServiceMonitoringService + * @typedef CreateServiceLevelObjectiveCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.ServiceLevelObjective} [response] ServiceLevelObjective + */ + + /** + * Calls CreateServiceLevelObjective. + * @function createServiceLevelObjective + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.ICreateServiceLevelObjectiveRequest} request CreateServiceLevelObjectiveRequest message or plain object + * @param {google.monitoring.v3.ServiceMonitoringService.CreateServiceLevelObjectiveCallback} callback Node-style callback called with the error, if any, and ServiceLevelObjective + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceMonitoringService.prototype.createServiceLevelObjective = function createServiceLevelObjective(request, callback) { + return this.rpcCall(createServiceLevelObjective, $root.google.monitoring.v3.CreateServiceLevelObjectiveRequest, $root.google.monitoring.v3.ServiceLevelObjective, request, callback); + }, "name", { value: "CreateServiceLevelObjective" }); + + /** + * Calls CreateServiceLevelObjective. + * @function createServiceLevelObjective + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.ICreateServiceLevelObjectiveRequest} request CreateServiceLevelObjectiveRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#getServiceLevelObjective}. + * @memberof google.monitoring.v3.ServiceMonitoringService + * @typedef GetServiceLevelObjectiveCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.ServiceLevelObjective} [response] ServiceLevelObjective + */ + + /** + * Calls GetServiceLevelObjective. + * @function getServiceLevelObjective + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IGetServiceLevelObjectiveRequest} request GetServiceLevelObjectiveRequest message or plain object + * @param {google.monitoring.v3.ServiceMonitoringService.GetServiceLevelObjectiveCallback} callback Node-style callback called with the error, if any, and ServiceLevelObjective + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceMonitoringService.prototype.getServiceLevelObjective = function getServiceLevelObjective(request, callback) { + return this.rpcCall(getServiceLevelObjective, $root.google.monitoring.v3.GetServiceLevelObjectiveRequest, $root.google.monitoring.v3.ServiceLevelObjective, request, callback); + }, "name", { value: "GetServiceLevelObjective" }); + + /** + * Calls GetServiceLevelObjective. + * @function getServiceLevelObjective + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IGetServiceLevelObjectiveRequest} request GetServiceLevelObjectiveRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#listServiceLevelObjectives}. + * @memberof google.monitoring.v3.ServiceMonitoringService + * @typedef ListServiceLevelObjectivesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.ListServiceLevelObjectivesResponse} [response] ListServiceLevelObjectivesResponse + */ + + /** + * Calls ListServiceLevelObjectives. + * @function listServiceLevelObjectives + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IListServiceLevelObjectivesRequest} request ListServiceLevelObjectivesRequest message or plain object + * @param {google.monitoring.v3.ServiceMonitoringService.ListServiceLevelObjectivesCallback} callback Node-style callback called with the error, if any, and ListServiceLevelObjectivesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceMonitoringService.prototype.listServiceLevelObjectives = function listServiceLevelObjectives(request, callback) { + return this.rpcCall(listServiceLevelObjectives, $root.google.monitoring.v3.ListServiceLevelObjectivesRequest, $root.google.monitoring.v3.ListServiceLevelObjectivesResponse, request, callback); + }, "name", { value: "ListServiceLevelObjectives" }); + + /** + * Calls ListServiceLevelObjectives. + * @function listServiceLevelObjectives + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IListServiceLevelObjectivesRequest} request ListServiceLevelObjectivesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#updateServiceLevelObjective}. + * @memberof google.monitoring.v3.ServiceMonitoringService + * @typedef UpdateServiceLevelObjectiveCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.ServiceLevelObjective} [response] ServiceLevelObjective + */ + + /** + * Calls UpdateServiceLevelObjective. + * @function updateServiceLevelObjective + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IUpdateServiceLevelObjectiveRequest} request UpdateServiceLevelObjectiveRequest message or plain object + * @param {google.monitoring.v3.ServiceMonitoringService.UpdateServiceLevelObjectiveCallback} callback Node-style callback called with the error, if any, and ServiceLevelObjective + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceMonitoringService.prototype.updateServiceLevelObjective = function updateServiceLevelObjective(request, callback) { + return this.rpcCall(updateServiceLevelObjective, $root.google.monitoring.v3.UpdateServiceLevelObjectiveRequest, $root.google.monitoring.v3.ServiceLevelObjective, request, callback); + }, "name", { value: "UpdateServiceLevelObjective" }); + + /** + * Calls UpdateServiceLevelObjective. + * @function updateServiceLevelObjective + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IUpdateServiceLevelObjectiveRequest} request UpdateServiceLevelObjectiveRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#deleteServiceLevelObjective}. + * @memberof google.monitoring.v3.ServiceMonitoringService + * @typedef DeleteServiceLevelObjectiveCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteServiceLevelObjective. + * @function deleteServiceLevelObjective + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IDeleteServiceLevelObjectiveRequest} request DeleteServiceLevelObjectiveRequest message or plain object + * @param {google.monitoring.v3.ServiceMonitoringService.DeleteServiceLevelObjectiveCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceMonitoringService.prototype.deleteServiceLevelObjective = function deleteServiceLevelObjective(request, callback) { + return this.rpcCall(deleteServiceLevelObjective, $root.google.monitoring.v3.DeleteServiceLevelObjectiveRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteServiceLevelObjective" }); + + /** + * Calls DeleteServiceLevelObjective. + * @function deleteServiceLevelObjective + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IDeleteServiceLevelObjectiveRequest} request DeleteServiceLevelObjectiveRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ServiceMonitoringService; + })(); + + v3.CreateServiceRequest = (function() { + + /** + * Properties of a CreateServiceRequest. + * @memberof google.monitoring.v3 + * @interface ICreateServiceRequest + * @property {string|null} [parent] CreateServiceRequest parent + * @property {string|null} [serviceId] CreateServiceRequest serviceId + * @property {google.monitoring.v3.IService|null} [service] CreateServiceRequest service + */ + + /** + * Constructs a new CreateServiceRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents a CreateServiceRequest. + * @implements ICreateServiceRequest + * @constructor + * @param {google.monitoring.v3.ICreateServiceRequest=} [properties] Properties to set + */ + function CreateServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateServiceRequest parent. + * @member {string} parent + * @memberof google.monitoring.v3.CreateServiceRequest + * @instance + */ + CreateServiceRequest.prototype.parent = ""; + + /** + * CreateServiceRequest serviceId. + * @member {string} serviceId + * @memberof google.monitoring.v3.CreateServiceRequest + * @instance + */ + CreateServiceRequest.prototype.serviceId = ""; + + /** + * CreateServiceRequest service. + * @member {google.monitoring.v3.IService|null|undefined} service + * @memberof google.monitoring.v3.CreateServiceRequest + * @instance + */ + CreateServiceRequest.prototype.service = null; + + /** + * Creates a new CreateServiceRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.CreateServiceRequest + * @static + * @param {google.monitoring.v3.ICreateServiceRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.CreateServiceRequest} CreateServiceRequest instance + */ + CreateServiceRequest.create = function create(properties) { + return new CreateServiceRequest(properties); + }; + + /** + * Encodes the specified CreateServiceRequest message. Does not implicitly {@link google.monitoring.v3.CreateServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.CreateServiceRequest + * @static + * @param {google.monitoring.v3.ICreateServiceRequest} message CreateServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.service != null && message.hasOwnProperty("service")) + $root.google.monitoring.v3.Service.encode(message.service, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.serviceId != null && message.hasOwnProperty("serviceId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.serviceId); + return writer; + }; + + /** + * Encodes the specified CreateServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.CreateServiceRequest + * @static + * @param {google.monitoring.v3.ICreateServiceRequest} message CreateServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.CreateServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.CreateServiceRequest} CreateServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 3: + message.serviceId = reader.string(); + break; + case 2: + message.service = $root.google.monitoring.v3.Service.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.CreateServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.CreateServiceRequest} CreateServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateServiceRequest message. + * @function verify + * @memberof google.monitoring.v3.CreateServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.serviceId != null && message.hasOwnProperty("serviceId")) + if (!$util.isString(message.serviceId)) + return "serviceId: string expected"; + if (message.service != null && message.hasOwnProperty("service")) { + var error = $root.google.monitoring.v3.Service.verify(message.service); + if (error) + return "service." + error; + } + return null; + }; + + /** + * Creates a CreateServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.CreateServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.CreateServiceRequest} CreateServiceRequest + */ + CreateServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.CreateServiceRequest) + return object; + var message = new $root.google.monitoring.v3.CreateServiceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.serviceId != null) + message.serviceId = String(object.serviceId); + if (object.service != null) { + if (typeof object.service !== "object") + throw TypeError(".google.monitoring.v3.CreateServiceRequest.service: object expected"); + message.service = $root.google.monitoring.v3.Service.fromObject(object.service); + } + return message; + }; + + /** + * Creates a plain object from a CreateServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.CreateServiceRequest + * @static + * @param {google.monitoring.v3.CreateServiceRequest} message CreateServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.service = null; + object.serviceId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.service != null && message.hasOwnProperty("service")) + object.service = $root.google.monitoring.v3.Service.toObject(message.service, options); + if (message.serviceId != null && message.hasOwnProperty("serviceId")) + object.serviceId = message.serviceId; + return object; + }; + + /** + * Converts this CreateServiceRequest to JSON. + * @function toJSON + * @memberof google.monitoring.v3.CreateServiceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateServiceRequest; + })(); + + v3.GetServiceRequest = (function() { + + /** + * Properties of a GetServiceRequest. + * @memberof google.monitoring.v3 + * @interface IGetServiceRequest + * @property {string|null} [name] GetServiceRequest name + */ + + /** + * Constructs a new GetServiceRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents a GetServiceRequest. + * @implements IGetServiceRequest + * @constructor + * @param {google.monitoring.v3.IGetServiceRequest=} [properties] Properties to set + */ + function GetServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetServiceRequest name. + * @member {string} name + * @memberof google.monitoring.v3.GetServiceRequest + * @instance + */ + GetServiceRequest.prototype.name = ""; + + /** + * Creates a new GetServiceRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.GetServiceRequest + * @static + * @param {google.monitoring.v3.IGetServiceRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.GetServiceRequest} GetServiceRequest instance + */ + GetServiceRequest.create = function create(properties) { + return new GetServiceRequest(properties); + }; + + /** + * Encodes the specified GetServiceRequest message. Does not implicitly {@link google.monitoring.v3.GetServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.GetServiceRequest + * @static + * @param {google.monitoring.v3.IGetServiceRequest} message GetServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.GetServiceRequest + * @static + * @param {google.monitoring.v3.IGetServiceRequest} message GetServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.GetServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.GetServiceRequest} GetServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.GetServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.GetServiceRequest} GetServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetServiceRequest message. + * @function verify + * @memberof google.monitoring.v3.GetServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.GetServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.GetServiceRequest} GetServiceRequest + */ + GetServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.GetServiceRequest) + return object; + var message = new $root.google.monitoring.v3.GetServiceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.GetServiceRequest + * @static + * @param {google.monitoring.v3.GetServiceRequest} message GetServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetServiceRequest to JSON. + * @function toJSON + * @memberof google.monitoring.v3.GetServiceRequest + * @instance + * @returns {Object.} JSON object + */ + GetServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetServiceRequest; + })(); + + v3.ListServicesRequest = (function() { + + /** + * Properties of a ListServicesRequest. + * @memberof google.monitoring.v3 + * @interface IListServicesRequest + * @property {string|null} [parent] ListServicesRequest parent + * @property {string|null} [filter] ListServicesRequest filter + * @property {number|null} [pageSize] ListServicesRequest pageSize + * @property {string|null} [pageToken] ListServicesRequest pageToken + */ + + /** + * Constructs a new ListServicesRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents a ListServicesRequest. + * @implements IListServicesRequest + * @constructor + * @param {google.monitoring.v3.IListServicesRequest=} [properties] Properties to set + */ + function ListServicesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListServicesRequest parent. + * @member {string} parent + * @memberof google.monitoring.v3.ListServicesRequest + * @instance + */ + ListServicesRequest.prototype.parent = ""; + + /** + * ListServicesRequest filter. + * @member {string} filter + * @memberof google.monitoring.v3.ListServicesRequest + * @instance + */ + ListServicesRequest.prototype.filter = ""; + + /** + * ListServicesRequest pageSize. + * @member {number} pageSize + * @memberof google.monitoring.v3.ListServicesRequest + * @instance + */ + ListServicesRequest.prototype.pageSize = 0; + + /** + * ListServicesRequest pageToken. + * @member {string} pageToken + * @memberof google.monitoring.v3.ListServicesRequest + * @instance + */ + ListServicesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListServicesRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.ListServicesRequest + * @static + * @param {google.monitoring.v3.IListServicesRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.ListServicesRequest} ListServicesRequest instance + */ + ListServicesRequest.create = function create(properties) { + return new ListServicesRequest(properties); + }; + + /** + * Encodes the specified ListServicesRequest message. Does not implicitly {@link google.monitoring.v3.ListServicesRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.ListServicesRequest + * @static + * @param {google.monitoring.v3.IListServicesRequest} message ListServicesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServicesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListServicesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServicesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.ListServicesRequest + * @static + * @param {google.monitoring.v3.IListServicesRequest} message ListServicesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServicesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListServicesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.ListServicesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.ListServicesRequest} ListServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServicesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListServicesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.pageSize = reader.int32(); + break; + case 4: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListServicesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.ListServicesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.ListServicesRequest} ListServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServicesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListServicesRequest message. + * @function verify + * @memberof google.monitoring.v3.ListServicesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListServicesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListServicesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.ListServicesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.ListServicesRequest} ListServicesRequest + */ + ListServicesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListServicesRequest) + return object; + var message = new $root.google.monitoring.v3.ListServicesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListServicesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.ListServicesRequest + * @static + * @param {google.monitoring.v3.ListServicesRequest} message ListServicesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListServicesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListServicesRequest to JSON. + * @function toJSON + * @memberof google.monitoring.v3.ListServicesRequest + * @instance + * @returns {Object.} JSON object + */ + ListServicesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListServicesRequest; + })(); + + v3.ListServicesResponse = (function() { + + /** + * Properties of a ListServicesResponse. + * @memberof google.monitoring.v3 + * @interface IListServicesResponse + * @property {Array.|null} [services] ListServicesResponse services + * @property {string|null} [nextPageToken] ListServicesResponse nextPageToken + */ + + /** + * Constructs a new ListServicesResponse. + * @memberof google.monitoring.v3 + * @classdesc Represents a ListServicesResponse. + * @implements IListServicesResponse + * @constructor + * @param {google.monitoring.v3.IListServicesResponse=} [properties] Properties to set + */ + function ListServicesResponse(properties) { + this.services = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListServicesResponse services. + * @member {Array.} services + * @memberof google.monitoring.v3.ListServicesResponse + * @instance + */ + ListServicesResponse.prototype.services = $util.emptyArray; + + /** + * ListServicesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.monitoring.v3.ListServicesResponse + * @instance + */ + ListServicesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListServicesResponse instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.ListServicesResponse + * @static + * @param {google.monitoring.v3.IListServicesResponse=} [properties] Properties to set + * @returns {google.monitoring.v3.ListServicesResponse} ListServicesResponse instance + */ + ListServicesResponse.create = function create(properties) { + return new ListServicesResponse(properties); + }; + + /** + * Encodes the specified ListServicesResponse message. Does not implicitly {@link google.monitoring.v3.ListServicesResponse.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.ListServicesResponse + * @static + * @param {google.monitoring.v3.IListServicesResponse} message ListServicesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServicesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.services != null && message.services.length) + for (var i = 0; i < message.services.length; ++i) + $root.google.monitoring.v3.Service.encode(message.services[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListServicesResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServicesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.ListServicesResponse + * @static + * @param {google.monitoring.v3.IListServicesResponse} message ListServicesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServicesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListServicesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.ListServicesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.ListServicesResponse} ListServicesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServicesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListServicesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.services && message.services.length)) + message.services = []; + message.services.push($root.google.monitoring.v3.Service.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListServicesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.ListServicesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.ListServicesResponse} ListServicesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServicesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListServicesResponse message. + * @function verify + * @memberof google.monitoring.v3.ListServicesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListServicesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.services != null && message.hasOwnProperty("services")) { + if (!Array.isArray(message.services)) + return "services: array expected"; + for (var i = 0; i < message.services.length; ++i) { + var error = $root.google.monitoring.v3.Service.verify(message.services[i]); + if (error) + return "services." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListServicesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.ListServicesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.ListServicesResponse} ListServicesResponse + */ + ListServicesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListServicesResponse) + return object; + var message = new $root.google.monitoring.v3.ListServicesResponse(); + if (object.services) { + if (!Array.isArray(object.services)) + throw TypeError(".google.monitoring.v3.ListServicesResponse.services: array expected"); + message.services = []; + for (var i = 0; i < object.services.length; ++i) { + if (typeof object.services[i] !== "object") + throw TypeError(".google.monitoring.v3.ListServicesResponse.services: object expected"); + message.services[i] = $root.google.monitoring.v3.Service.fromObject(object.services[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListServicesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.ListServicesResponse + * @static + * @param {google.monitoring.v3.ListServicesResponse} message ListServicesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListServicesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.services = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.services && message.services.length) { + object.services = []; + for (var j = 0; j < message.services.length; ++j) + object.services[j] = $root.google.monitoring.v3.Service.toObject(message.services[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListServicesResponse to JSON. + * @function toJSON + * @memberof google.monitoring.v3.ListServicesResponse + * @instance + * @returns {Object.} JSON object + */ + ListServicesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListServicesResponse; + })(); + + v3.UpdateServiceRequest = (function() { + + /** + * Properties of an UpdateServiceRequest. + * @memberof google.monitoring.v3 + * @interface IUpdateServiceRequest + * @property {google.monitoring.v3.IService|null} [service] UpdateServiceRequest service + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateServiceRequest updateMask + */ + + /** + * Constructs a new UpdateServiceRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents an UpdateServiceRequest. + * @implements IUpdateServiceRequest + * @constructor + * @param {google.monitoring.v3.IUpdateServiceRequest=} [properties] Properties to set + */ + function UpdateServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateServiceRequest service. + * @member {google.monitoring.v3.IService|null|undefined} service + * @memberof google.monitoring.v3.UpdateServiceRequest + * @instance + */ + UpdateServiceRequest.prototype.service = null; + + /** + * UpdateServiceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.monitoring.v3.UpdateServiceRequest + * @instance + */ + UpdateServiceRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateServiceRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.UpdateServiceRequest + * @static + * @param {google.monitoring.v3.IUpdateServiceRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.UpdateServiceRequest} UpdateServiceRequest instance + */ + UpdateServiceRequest.create = function create(properties) { + return new UpdateServiceRequest(properties); + }; + + /** + * Encodes the specified UpdateServiceRequest message. Does not implicitly {@link google.monitoring.v3.UpdateServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.UpdateServiceRequest + * @static + * @param {google.monitoring.v3.IUpdateServiceRequest} message UpdateServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && message.hasOwnProperty("service")) + $root.google.monitoring.v3.Service.encode(message.service, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.UpdateServiceRequest + * @static + * @param {google.monitoring.v3.IUpdateServiceRequest} message UpdateServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.UpdateServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.UpdateServiceRequest} UpdateServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.UpdateServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.service = $root.google.monitoring.v3.Service.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.UpdateServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.UpdateServiceRequest} UpdateServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateServiceRequest message. + * @function verify + * @memberof google.monitoring.v3.UpdateServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) { + var error = $root.google.monitoring.v3.Service.verify(message.service); + if (error) + return "service." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.UpdateServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.UpdateServiceRequest} UpdateServiceRequest + */ + UpdateServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.UpdateServiceRequest) + return object; + var message = new $root.google.monitoring.v3.UpdateServiceRequest(); + if (object.service != null) { + if (typeof object.service !== "object") + throw TypeError(".google.monitoring.v3.UpdateServiceRequest.service: object expected"); + message.service = $root.google.monitoring.v3.Service.fromObject(object.service); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.monitoring.v3.UpdateServiceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.UpdateServiceRequest + * @static + * @param {google.monitoring.v3.UpdateServiceRequest} message UpdateServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.service = null; + object.updateMask = null; + } + if (message.service != null && message.hasOwnProperty("service")) + object.service = $root.google.monitoring.v3.Service.toObject(message.service, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateServiceRequest to JSON. + * @function toJSON + * @memberof google.monitoring.v3.UpdateServiceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateServiceRequest; + })(); + + v3.DeleteServiceRequest = (function() { + + /** + * Properties of a DeleteServiceRequest. + * @memberof google.monitoring.v3 + * @interface IDeleteServiceRequest + * @property {string|null} [name] DeleteServiceRequest name + */ + + /** + * Constructs a new DeleteServiceRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents a DeleteServiceRequest. + * @implements IDeleteServiceRequest + * @constructor + * @param {google.monitoring.v3.IDeleteServiceRequest=} [properties] Properties to set + */ + function DeleteServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteServiceRequest name. + * @member {string} name + * @memberof google.monitoring.v3.DeleteServiceRequest + * @instance + */ + DeleteServiceRequest.prototype.name = ""; + + /** + * Creates a new DeleteServiceRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.DeleteServiceRequest + * @static + * @param {google.monitoring.v3.IDeleteServiceRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.DeleteServiceRequest} DeleteServiceRequest instance + */ + DeleteServiceRequest.create = function create(properties) { + return new DeleteServiceRequest(properties); + }; + + /** + * Encodes the specified DeleteServiceRequest message. Does not implicitly {@link google.monitoring.v3.DeleteServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.DeleteServiceRequest + * @static + * @param {google.monitoring.v3.IDeleteServiceRequest} message DeleteServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.DeleteServiceRequest + * @static + * @param {google.monitoring.v3.IDeleteServiceRequest} message DeleteServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.DeleteServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.DeleteServiceRequest} DeleteServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.DeleteServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.DeleteServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.DeleteServiceRequest} DeleteServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteServiceRequest message. + * @function verify + * @memberof google.monitoring.v3.DeleteServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.DeleteServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.DeleteServiceRequest} DeleteServiceRequest + */ + DeleteServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.DeleteServiceRequest) + return object; + var message = new $root.google.monitoring.v3.DeleteServiceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.DeleteServiceRequest + * @static + * @param {google.monitoring.v3.DeleteServiceRequest} message DeleteServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteServiceRequest to JSON. + * @function toJSON + * @memberof google.monitoring.v3.DeleteServiceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteServiceRequest; + })(); + + v3.CreateServiceLevelObjectiveRequest = (function() { + + /** + * Properties of a CreateServiceLevelObjectiveRequest. + * @memberof google.monitoring.v3 + * @interface ICreateServiceLevelObjectiveRequest + * @property {string|null} [parent] CreateServiceLevelObjectiveRequest parent + * @property {string|null} [serviceLevelObjectiveId] CreateServiceLevelObjectiveRequest serviceLevelObjectiveId + * @property {google.monitoring.v3.IServiceLevelObjective|null} [serviceLevelObjective] CreateServiceLevelObjectiveRequest serviceLevelObjective + */ + + /** + * Constructs a new CreateServiceLevelObjectiveRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents a CreateServiceLevelObjectiveRequest. + * @implements ICreateServiceLevelObjectiveRequest + * @constructor + * @param {google.monitoring.v3.ICreateServiceLevelObjectiveRequest=} [properties] Properties to set + */ + function CreateServiceLevelObjectiveRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateServiceLevelObjectiveRequest parent. + * @member {string} parent + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @instance + */ + CreateServiceLevelObjectiveRequest.prototype.parent = ""; + + /** + * CreateServiceLevelObjectiveRequest serviceLevelObjectiveId. + * @member {string} serviceLevelObjectiveId + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @instance + */ + CreateServiceLevelObjectiveRequest.prototype.serviceLevelObjectiveId = ""; + + /** + * CreateServiceLevelObjectiveRequest serviceLevelObjective. + * @member {google.monitoring.v3.IServiceLevelObjective|null|undefined} serviceLevelObjective + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @instance + */ + CreateServiceLevelObjectiveRequest.prototype.serviceLevelObjective = null; + + /** + * Creates a new CreateServiceLevelObjectiveRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @static + * @param {google.monitoring.v3.ICreateServiceLevelObjectiveRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.CreateServiceLevelObjectiveRequest} CreateServiceLevelObjectiveRequest instance + */ + CreateServiceLevelObjectiveRequest.create = function create(properties) { + return new CreateServiceLevelObjectiveRequest(properties); + }; + + /** + * Encodes the specified CreateServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.CreateServiceLevelObjectiveRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @static + * @param {google.monitoring.v3.ICreateServiceLevelObjectiveRequest} message CreateServiceLevelObjectiveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateServiceLevelObjectiveRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.serviceLevelObjective != null && message.hasOwnProperty("serviceLevelObjective")) + $root.google.monitoring.v3.ServiceLevelObjective.encode(message.serviceLevelObjective, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.serviceLevelObjectiveId != null && message.hasOwnProperty("serviceLevelObjectiveId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.serviceLevelObjectiveId); + return writer; + }; + + /** + * Encodes the specified CreateServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateServiceLevelObjectiveRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @static + * @param {google.monitoring.v3.ICreateServiceLevelObjectiveRequest} message CreateServiceLevelObjectiveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateServiceLevelObjectiveRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateServiceLevelObjectiveRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.CreateServiceLevelObjectiveRequest} CreateServiceLevelObjectiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateServiceLevelObjectiveRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateServiceLevelObjectiveRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 3: + message.serviceLevelObjectiveId = reader.string(); + break; + case 2: + message.serviceLevelObjective = $root.google.monitoring.v3.ServiceLevelObjective.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.CreateServiceLevelObjectiveRequest} CreateServiceLevelObjectiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateServiceLevelObjectiveRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateServiceLevelObjectiveRequest message. + * @function verify + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateServiceLevelObjectiveRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.serviceLevelObjectiveId != null && message.hasOwnProperty("serviceLevelObjectiveId")) + if (!$util.isString(message.serviceLevelObjectiveId)) + return "serviceLevelObjectiveId: string expected"; + if (message.serviceLevelObjective != null && message.hasOwnProperty("serviceLevelObjective")) { + var error = $root.google.monitoring.v3.ServiceLevelObjective.verify(message.serviceLevelObjective); + if (error) + return "serviceLevelObjective." + error; + } + return null; + }; + + /** + * Creates a CreateServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.CreateServiceLevelObjectiveRequest} CreateServiceLevelObjectiveRequest + */ + CreateServiceLevelObjectiveRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.CreateServiceLevelObjectiveRequest) + return object; + var message = new $root.google.monitoring.v3.CreateServiceLevelObjectiveRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.serviceLevelObjectiveId != null) + message.serviceLevelObjectiveId = String(object.serviceLevelObjectiveId); + if (object.serviceLevelObjective != null) { + if (typeof object.serviceLevelObjective !== "object") + throw TypeError(".google.monitoring.v3.CreateServiceLevelObjectiveRequest.serviceLevelObjective: object expected"); + message.serviceLevelObjective = $root.google.monitoring.v3.ServiceLevelObjective.fromObject(object.serviceLevelObjective); + } + return message; + }; + + /** + * Creates a plain object from a CreateServiceLevelObjectiveRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @static + * @param {google.monitoring.v3.CreateServiceLevelObjectiveRequest} message CreateServiceLevelObjectiveRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateServiceLevelObjectiveRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.serviceLevelObjective = null; + object.serviceLevelObjectiveId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.serviceLevelObjective != null && message.hasOwnProperty("serviceLevelObjective")) + object.serviceLevelObjective = $root.google.monitoring.v3.ServiceLevelObjective.toObject(message.serviceLevelObjective, options); + if (message.serviceLevelObjectiveId != null && message.hasOwnProperty("serviceLevelObjectiveId")) + object.serviceLevelObjectiveId = message.serviceLevelObjectiveId; + return object; + }; + + /** + * Converts this CreateServiceLevelObjectiveRequest to JSON. + * @function toJSON + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @instance + * @returns {Object.} JSON object + */ + CreateServiceLevelObjectiveRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateServiceLevelObjectiveRequest; + })(); + + v3.GetServiceLevelObjectiveRequest = (function() { + + /** + * Properties of a GetServiceLevelObjectiveRequest. + * @memberof google.monitoring.v3 + * @interface IGetServiceLevelObjectiveRequest + * @property {string|null} [name] GetServiceLevelObjectiveRequest name + * @property {google.monitoring.v3.ServiceLevelObjective.View|null} [view] GetServiceLevelObjectiveRequest view + */ + + /** + * Constructs a new GetServiceLevelObjectiveRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents a GetServiceLevelObjectiveRequest. + * @implements IGetServiceLevelObjectiveRequest + * @constructor + * @param {google.monitoring.v3.IGetServiceLevelObjectiveRequest=} [properties] Properties to set + */ + function GetServiceLevelObjectiveRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetServiceLevelObjectiveRequest name. + * @member {string} name + * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest + * @instance + */ + GetServiceLevelObjectiveRequest.prototype.name = ""; + + /** + * GetServiceLevelObjectiveRequest view. + * @member {google.monitoring.v3.ServiceLevelObjective.View} view + * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest + * @instance + */ + GetServiceLevelObjectiveRequest.prototype.view = 0; + + /** + * Creates a new GetServiceLevelObjectiveRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest + * @static + * @param {google.monitoring.v3.IGetServiceLevelObjectiveRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.GetServiceLevelObjectiveRequest} GetServiceLevelObjectiveRequest instance + */ + GetServiceLevelObjectiveRequest.create = function create(properties) { + return new GetServiceLevelObjectiveRequest(properties); + }; + + /** + * Encodes the specified GetServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.GetServiceLevelObjectiveRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest + * @static + * @param {google.monitoring.v3.IGetServiceLevelObjectiveRequest} message GetServiceLevelObjectiveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetServiceLevelObjectiveRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && message.hasOwnProperty("view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetServiceLevelObjectiveRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest + * @static + * @param {google.monitoring.v3.IGetServiceLevelObjectiveRequest} message GetServiceLevelObjectiveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetServiceLevelObjectiveRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetServiceLevelObjectiveRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.GetServiceLevelObjectiveRequest} GetServiceLevelObjectiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetServiceLevelObjectiveRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetServiceLevelObjectiveRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.view = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.GetServiceLevelObjectiveRequest} GetServiceLevelObjectiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetServiceLevelObjectiveRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetServiceLevelObjectiveRequest message. + * @function verify + * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetServiceLevelObjectiveRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 2: + case 1: + break; + } + return null; + }; + + /** + * Creates a GetServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.GetServiceLevelObjectiveRequest} GetServiceLevelObjectiveRequest + */ + GetServiceLevelObjectiveRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.GetServiceLevelObjectiveRequest) + return object; + var message = new $root.google.monitoring.v3.GetServiceLevelObjectiveRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + case "VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "FULL": + case 2: + message.view = 2; + break; + case "EXPLICIT": + case 1: + message.view = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetServiceLevelObjectiveRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest + * @static + * @param {google.monitoring.v3.GetServiceLevelObjectiveRequest} message GetServiceLevelObjectiveRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetServiceLevelObjectiveRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.monitoring.v3.ServiceLevelObjective.View[message.view] : message.view; + return object; + }; + + /** + * Converts this GetServiceLevelObjectiveRequest to JSON. + * @function toJSON + * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest + * @instance + * @returns {Object.} JSON object + */ + GetServiceLevelObjectiveRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetServiceLevelObjectiveRequest; + })(); + + v3.ListServiceLevelObjectivesRequest = (function() { + + /** + * Properties of a ListServiceLevelObjectivesRequest. + * @memberof google.monitoring.v3 + * @interface IListServiceLevelObjectivesRequest + * @property {string|null} [parent] ListServiceLevelObjectivesRequest parent + * @property {string|null} [filter] ListServiceLevelObjectivesRequest filter + * @property {number|null} [pageSize] ListServiceLevelObjectivesRequest pageSize + * @property {string|null} [pageToken] ListServiceLevelObjectivesRequest pageToken + * @property {google.monitoring.v3.ServiceLevelObjective.View|null} [view] ListServiceLevelObjectivesRequest view + */ + + /** + * Constructs a new ListServiceLevelObjectivesRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents a ListServiceLevelObjectivesRequest. + * @implements IListServiceLevelObjectivesRequest + * @constructor + * @param {google.monitoring.v3.IListServiceLevelObjectivesRequest=} [properties] Properties to set + */ + function ListServiceLevelObjectivesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListServiceLevelObjectivesRequest parent. + * @member {string} parent + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest + * @instance + */ + ListServiceLevelObjectivesRequest.prototype.parent = ""; + + /** + * ListServiceLevelObjectivesRequest filter. + * @member {string} filter + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest + * @instance + */ + ListServiceLevelObjectivesRequest.prototype.filter = ""; + + /** + * ListServiceLevelObjectivesRequest pageSize. + * @member {number} pageSize + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest + * @instance + */ + ListServiceLevelObjectivesRequest.prototype.pageSize = 0; + + /** + * ListServiceLevelObjectivesRequest pageToken. + * @member {string} pageToken + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest + * @instance + */ + ListServiceLevelObjectivesRequest.prototype.pageToken = ""; + + /** + * ListServiceLevelObjectivesRequest view. + * @member {google.monitoring.v3.ServiceLevelObjective.View} view + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest + * @instance + */ + ListServiceLevelObjectivesRequest.prototype.view = 0; + + /** + * Creates a new ListServiceLevelObjectivesRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest + * @static + * @param {google.monitoring.v3.IListServiceLevelObjectivesRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.ListServiceLevelObjectivesRequest} ListServiceLevelObjectivesRequest instance + */ + ListServiceLevelObjectivesRequest.create = function create(properties) { + return new ListServiceLevelObjectivesRequest(properties); + }; + + /** + * Encodes the specified ListServiceLevelObjectivesRequest message. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest + * @static + * @param {google.monitoring.v3.IListServiceLevelObjectivesRequest} message ListServiceLevelObjectivesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServiceLevelObjectivesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.view != null && message.hasOwnProperty("view")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.view); + return writer; + }; + + /** + * Encodes the specified ListServiceLevelObjectivesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest + * @static + * @param {google.monitoring.v3.IListServiceLevelObjectivesRequest} message ListServiceLevelObjectivesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServiceLevelObjectivesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListServiceLevelObjectivesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.ListServiceLevelObjectivesRequest} ListServiceLevelObjectivesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServiceLevelObjectivesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListServiceLevelObjectivesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.pageSize = reader.int32(); + break; + case 4: + message.pageToken = reader.string(); + break; + case 5: + message.view = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListServiceLevelObjectivesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.ListServiceLevelObjectivesRequest} ListServiceLevelObjectivesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServiceLevelObjectivesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListServiceLevelObjectivesRequest message. + * @function verify + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListServiceLevelObjectivesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 2: + case 1: + break; + } + return null; + }; + + /** + * Creates a ListServiceLevelObjectivesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.ListServiceLevelObjectivesRequest} ListServiceLevelObjectivesRequest + */ + ListServiceLevelObjectivesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListServiceLevelObjectivesRequest) + return object; + var message = new $root.google.monitoring.v3.ListServiceLevelObjectivesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + switch (object.view) { + case "VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "FULL": + case 2: + message.view = 2; + break; + case "EXPLICIT": + case 1: + message.view = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListServiceLevelObjectivesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest + * @static + * @param {google.monitoring.v3.ListServiceLevelObjectivesRequest} message ListServiceLevelObjectivesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListServiceLevelObjectivesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.view = options.enums === String ? "VIEW_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.monitoring.v3.ServiceLevelObjective.View[message.view] : message.view; + return object; + }; + + /** + * Converts this ListServiceLevelObjectivesRequest to JSON. + * @function toJSON + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest + * @instance + * @returns {Object.} JSON object + */ + ListServiceLevelObjectivesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListServiceLevelObjectivesRequest; + })(); + + v3.ListServiceLevelObjectivesResponse = (function() { + + /** + * Properties of a ListServiceLevelObjectivesResponse. + * @memberof google.monitoring.v3 + * @interface IListServiceLevelObjectivesResponse + * @property {Array.|null} [serviceLevelObjectives] ListServiceLevelObjectivesResponse serviceLevelObjectives + * @property {string|null} [nextPageToken] ListServiceLevelObjectivesResponse nextPageToken + */ + + /** + * Constructs a new ListServiceLevelObjectivesResponse. + * @memberof google.monitoring.v3 + * @classdesc Represents a ListServiceLevelObjectivesResponse. + * @implements IListServiceLevelObjectivesResponse + * @constructor + * @param {google.monitoring.v3.IListServiceLevelObjectivesResponse=} [properties] Properties to set + */ + function ListServiceLevelObjectivesResponse(properties) { + this.serviceLevelObjectives = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListServiceLevelObjectivesResponse serviceLevelObjectives. + * @member {Array.} serviceLevelObjectives + * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse + * @instance + */ + ListServiceLevelObjectivesResponse.prototype.serviceLevelObjectives = $util.emptyArray; + + /** + * ListServiceLevelObjectivesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse + * @instance + */ + ListServiceLevelObjectivesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListServiceLevelObjectivesResponse instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse + * @static + * @param {google.monitoring.v3.IListServiceLevelObjectivesResponse=} [properties] Properties to set + * @returns {google.monitoring.v3.ListServiceLevelObjectivesResponse} ListServiceLevelObjectivesResponse instance + */ + ListServiceLevelObjectivesResponse.create = function create(properties) { + return new ListServiceLevelObjectivesResponse(properties); + }; + + /** + * Encodes the specified ListServiceLevelObjectivesResponse message. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesResponse.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse + * @static + * @param {google.monitoring.v3.IListServiceLevelObjectivesResponse} message ListServiceLevelObjectivesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServiceLevelObjectivesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceLevelObjectives != null && message.serviceLevelObjectives.length) + for (var i = 0; i < message.serviceLevelObjectives.length; ++i) + $root.google.monitoring.v3.ServiceLevelObjective.encode(message.serviceLevelObjectives[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListServiceLevelObjectivesResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse + * @static + * @param {google.monitoring.v3.IListServiceLevelObjectivesResponse} message ListServiceLevelObjectivesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServiceLevelObjectivesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListServiceLevelObjectivesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.ListServiceLevelObjectivesResponse} ListServiceLevelObjectivesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServiceLevelObjectivesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListServiceLevelObjectivesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.serviceLevelObjectives && message.serviceLevelObjectives.length)) + message.serviceLevelObjectives = []; + message.serviceLevelObjectives.push($root.google.monitoring.v3.ServiceLevelObjective.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListServiceLevelObjectivesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.ListServiceLevelObjectivesResponse} ListServiceLevelObjectivesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServiceLevelObjectivesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListServiceLevelObjectivesResponse message. + * @function verify + * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListServiceLevelObjectivesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceLevelObjectives != null && message.hasOwnProperty("serviceLevelObjectives")) { + if (!Array.isArray(message.serviceLevelObjectives)) + return "serviceLevelObjectives: array expected"; + for (var i = 0; i < message.serviceLevelObjectives.length; ++i) { + var error = $root.google.monitoring.v3.ServiceLevelObjective.verify(message.serviceLevelObjectives[i]); + if (error) + return "serviceLevelObjectives." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListServiceLevelObjectivesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.ListServiceLevelObjectivesResponse} ListServiceLevelObjectivesResponse + */ + ListServiceLevelObjectivesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListServiceLevelObjectivesResponse) + return object; + var message = new $root.google.monitoring.v3.ListServiceLevelObjectivesResponse(); + if (object.serviceLevelObjectives) { + if (!Array.isArray(object.serviceLevelObjectives)) + throw TypeError(".google.monitoring.v3.ListServiceLevelObjectivesResponse.serviceLevelObjectives: array expected"); + message.serviceLevelObjectives = []; + for (var i = 0; i < object.serviceLevelObjectives.length; ++i) { + if (typeof object.serviceLevelObjectives[i] !== "object") + throw TypeError(".google.monitoring.v3.ListServiceLevelObjectivesResponse.serviceLevelObjectives: object expected"); + message.serviceLevelObjectives[i] = $root.google.monitoring.v3.ServiceLevelObjective.fromObject(object.serviceLevelObjectives[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListServiceLevelObjectivesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse + * @static + * @param {google.monitoring.v3.ListServiceLevelObjectivesResponse} message ListServiceLevelObjectivesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListServiceLevelObjectivesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.serviceLevelObjectives = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.serviceLevelObjectives && message.serviceLevelObjectives.length) { + object.serviceLevelObjectives = []; + for (var j = 0; j < message.serviceLevelObjectives.length; ++j) + object.serviceLevelObjectives[j] = $root.google.monitoring.v3.ServiceLevelObjective.toObject(message.serviceLevelObjectives[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListServiceLevelObjectivesResponse to JSON. + * @function toJSON + * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse + * @instance + * @returns {Object.} JSON object + */ + ListServiceLevelObjectivesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListServiceLevelObjectivesResponse; + })(); + + v3.UpdateServiceLevelObjectiveRequest = (function() { + + /** + * Properties of an UpdateServiceLevelObjectiveRequest. + * @memberof google.monitoring.v3 + * @interface IUpdateServiceLevelObjectiveRequest + * @property {google.monitoring.v3.IServiceLevelObjective|null} [serviceLevelObjective] UpdateServiceLevelObjectiveRequest serviceLevelObjective + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateServiceLevelObjectiveRequest updateMask + */ + + /** + * Constructs a new UpdateServiceLevelObjectiveRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents an UpdateServiceLevelObjectiveRequest. + * @implements IUpdateServiceLevelObjectiveRequest + * @constructor + * @param {google.monitoring.v3.IUpdateServiceLevelObjectiveRequest=} [properties] Properties to set + */ + function UpdateServiceLevelObjectiveRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateServiceLevelObjectiveRequest serviceLevelObjective. + * @member {google.monitoring.v3.IServiceLevelObjective|null|undefined} serviceLevelObjective + * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest + * @instance + */ + UpdateServiceLevelObjectiveRequest.prototype.serviceLevelObjective = null; + + /** + * UpdateServiceLevelObjectiveRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest + * @instance + */ + UpdateServiceLevelObjectiveRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateServiceLevelObjectiveRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest + * @static + * @param {google.monitoring.v3.IUpdateServiceLevelObjectiveRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.UpdateServiceLevelObjectiveRequest} UpdateServiceLevelObjectiveRequest instance + */ + UpdateServiceLevelObjectiveRequest.create = function create(properties) { + return new UpdateServiceLevelObjectiveRequest(properties); + }; + + /** + * Encodes the specified UpdateServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.UpdateServiceLevelObjectiveRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest + * @static + * @param {google.monitoring.v3.IUpdateServiceLevelObjectiveRequest} message UpdateServiceLevelObjectiveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateServiceLevelObjectiveRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceLevelObjective != null && message.hasOwnProperty("serviceLevelObjective")) + $root.google.monitoring.v3.ServiceLevelObjective.encode(message.serviceLevelObjective, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateServiceLevelObjectiveRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest + * @static + * @param {google.monitoring.v3.IUpdateServiceLevelObjectiveRequest} message UpdateServiceLevelObjectiveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateServiceLevelObjectiveRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateServiceLevelObjectiveRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.UpdateServiceLevelObjectiveRequest} UpdateServiceLevelObjectiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateServiceLevelObjectiveRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.UpdateServiceLevelObjectiveRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serviceLevelObjective = $root.google.monitoring.v3.ServiceLevelObjective.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.UpdateServiceLevelObjectiveRequest} UpdateServiceLevelObjectiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateServiceLevelObjectiveRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateServiceLevelObjectiveRequest message. + * @function verify + * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateServiceLevelObjectiveRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceLevelObjective != null && message.hasOwnProperty("serviceLevelObjective")) { + var error = $root.google.monitoring.v3.ServiceLevelObjective.verify(message.serviceLevelObjective); + if (error) + return "serviceLevelObjective." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.UpdateServiceLevelObjectiveRequest} UpdateServiceLevelObjectiveRequest + */ + UpdateServiceLevelObjectiveRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.UpdateServiceLevelObjectiveRequest) + return object; + var message = new $root.google.monitoring.v3.UpdateServiceLevelObjectiveRequest(); + if (object.serviceLevelObjective != null) { + if (typeof object.serviceLevelObjective !== "object") + throw TypeError(".google.monitoring.v3.UpdateServiceLevelObjectiveRequest.serviceLevelObjective: object expected"); + message.serviceLevelObjective = $root.google.monitoring.v3.ServiceLevelObjective.fromObject(object.serviceLevelObjective); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.monitoring.v3.UpdateServiceLevelObjectiveRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateServiceLevelObjectiveRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest + * @static + * @param {google.monitoring.v3.UpdateServiceLevelObjectiveRequest} message UpdateServiceLevelObjectiveRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateServiceLevelObjectiveRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serviceLevelObjective = null; + object.updateMask = null; + } + if (message.serviceLevelObjective != null && message.hasOwnProperty("serviceLevelObjective")) + object.serviceLevelObjective = $root.google.monitoring.v3.ServiceLevelObjective.toObject(message.serviceLevelObjective, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateServiceLevelObjectiveRequest to JSON. + * @function toJSON + * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateServiceLevelObjectiveRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateServiceLevelObjectiveRequest; + })(); + + v3.DeleteServiceLevelObjectiveRequest = (function() { + + /** + * Properties of a DeleteServiceLevelObjectiveRequest. + * @memberof google.monitoring.v3 + * @interface IDeleteServiceLevelObjectiveRequest + * @property {string|null} [name] DeleteServiceLevelObjectiveRequest name + */ + + /** + * Constructs a new DeleteServiceLevelObjectiveRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents a DeleteServiceLevelObjectiveRequest. + * @implements IDeleteServiceLevelObjectiveRequest + * @constructor + * @param {google.monitoring.v3.IDeleteServiceLevelObjectiveRequest=} [properties] Properties to set + */ + function DeleteServiceLevelObjectiveRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteServiceLevelObjectiveRequest name. + * @member {string} name + * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest + * @instance + */ + DeleteServiceLevelObjectiveRequest.prototype.name = ""; + + /** + * Creates a new DeleteServiceLevelObjectiveRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest + * @static + * @param {google.monitoring.v3.IDeleteServiceLevelObjectiveRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.DeleteServiceLevelObjectiveRequest} DeleteServiceLevelObjectiveRequest instance + */ + DeleteServiceLevelObjectiveRequest.create = function create(properties) { + return new DeleteServiceLevelObjectiveRequest(properties); + }; + + /** + * Encodes the specified DeleteServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.DeleteServiceLevelObjectiveRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest + * @static + * @param {google.monitoring.v3.IDeleteServiceLevelObjectiveRequest} message DeleteServiceLevelObjectiveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteServiceLevelObjectiveRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteServiceLevelObjectiveRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest + * @static + * @param {google.monitoring.v3.IDeleteServiceLevelObjectiveRequest} message DeleteServiceLevelObjectiveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteServiceLevelObjectiveRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteServiceLevelObjectiveRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.DeleteServiceLevelObjectiveRequest} DeleteServiceLevelObjectiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteServiceLevelObjectiveRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.DeleteServiceLevelObjectiveRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.DeleteServiceLevelObjectiveRequest} DeleteServiceLevelObjectiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteServiceLevelObjectiveRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteServiceLevelObjectiveRequest message. + * @function verify + * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteServiceLevelObjectiveRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.DeleteServiceLevelObjectiveRequest} DeleteServiceLevelObjectiveRequest + */ + DeleteServiceLevelObjectiveRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.DeleteServiceLevelObjectiveRequest) + return object; + var message = new $root.google.monitoring.v3.DeleteServiceLevelObjectiveRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteServiceLevelObjectiveRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest + * @static + * @param {google.monitoring.v3.DeleteServiceLevelObjectiveRequest} message DeleteServiceLevelObjectiveRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteServiceLevelObjectiveRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteServiceLevelObjectiveRequest to JSON. + * @function toJSON + * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteServiceLevelObjectiveRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteServiceLevelObjectiveRequest; + })(); + + v3.Service = (function() { + + /** + * Properties of a Service. + * @memberof google.monitoring.v3 + * @interface IService + * @property {string|null} [name] Service name + * @property {string|null} [displayName] Service displayName + * @property {google.monitoring.v3.Service.ICustom|null} [custom] Service custom + * @property {google.monitoring.v3.Service.IAppEngine|null} [appEngine] Service appEngine + * @property {google.monitoring.v3.Service.ICloudEndpoints|null} [cloudEndpoints] Service cloudEndpoints + * @property {google.monitoring.v3.Service.IClusterIstio|null} [clusterIstio] Service clusterIstio + * @property {google.monitoring.v3.Service.ITelemetry|null} [telemetry] Service telemetry + */ + + /** + * Constructs a new Service. + * @memberof google.monitoring.v3 + * @classdesc Represents a Service. + * @implements IService + * @constructor + * @param {google.monitoring.v3.IService=} [properties] Properties to set + */ + function Service(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Service name. + * @member {string} name + * @memberof google.monitoring.v3.Service + * @instance + */ + Service.prototype.name = ""; + + /** + * Service displayName. + * @member {string} displayName + * @memberof google.monitoring.v3.Service + * @instance + */ + Service.prototype.displayName = ""; + + /** + * Service custom. + * @member {google.monitoring.v3.Service.ICustom|null|undefined} custom + * @memberof google.monitoring.v3.Service + * @instance + */ + Service.prototype.custom = null; + + /** + * Service appEngine. + * @member {google.monitoring.v3.Service.IAppEngine|null|undefined} appEngine + * @memberof google.monitoring.v3.Service + * @instance + */ + Service.prototype.appEngine = null; + + /** + * Service cloudEndpoints. + * @member {google.monitoring.v3.Service.ICloudEndpoints|null|undefined} cloudEndpoints + * @memberof google.monitoring.v3.Service + * @instance + */ + Service.prototype.cloudEndpoints = null; + + /** + * Service clusterIstio. + * @member {google.monitoring.v3.Service.IClusterIstio|null|undefined} clusterIstio + * @memberof google.monitoring.v3.Service + * @instance + */ + Service.prototype.clusterIstio = null; + + /** + * Service telemetry. + * @member {google.monitoring.v3.Service.ITelemetry|null|undefined} telemetry + * @memberof google.monitoring.v3.Service + * @instance + */ + Service.prototype.telemetry = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Service identifier. + * @member {"custom"|"appEngine"|"cloudEndpoints"|"clusterIstio"|undefined} identifier + * @memberof google.monitoring.v3.Service + * @instance + */ + Object.defineProperty(Service.prototype, "identifier", { + get: $util.oneOfGetter($oneOfFields = ["custom", "appEngine", "cloudEndpoints", "clusterIstio"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Service instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.Service + * @static + * @param {google.monitoring.v3.IService=} [properties] Properties to set + * @returns {google.monitoring.v3.Service} Service instance + */ + Service.create = function create(properties) { + return new Service(properties); + }; + + /** + * Encodes the specified Service message. Does not implicitly {@link google.monitoring.v3.Service.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.Service + * @static + * @param {google.monitoring.v3.IService} message Service message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Service.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.custom != null && message.hasOwnProperty("custom")) + $root.google.monitoring.v3.Service.Custom.encode(message.custom, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.appEngine != null && message.hasOwnProperty("appEngine")) + $root.google.monitoring.v3.Service.AppEngine.encode(message.appEngine, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.cloudEndpoints != null && message.hasOwnProperty("cloudEndpoints")) + $root.google.monitoring.v3.Service.CloudEndpoints.encode(message.cloudEndpoints, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.clusterIstio != null && message.hasOwnProperty("clusterIstio")) + $root.google.monitoring.v3.Service.ClusterIstio.encode(message.clusterIstio, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.telemetry != null && message.hasOwnProperty("telemetry")) + $root.google.monitoring.v3.Service.Telemetry.encode(message.telemetry, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Service message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.Service + * @static + * @param {google.monitoring.v3.IService} message Service message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Service.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Service message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.Service + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.Service} Service + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Service.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Service(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 6: + message.custom = $root.google.monitoring.v3.Service.Custom.decode(reader, reader.uint32()); + break; + case 7: + message.appEngine = $root.google.monitoring.v3.Service.AppEngine.decode(reader, reader.uint32()); + break; + case 8: + message.cloudEndpoints = $root.google.monitoring.v3.Service.CloudEndpoints.decode(reader, reader.uint32()); + break; + case 9: + message.clusterIstio = $root.google.monitoring.v3.Service.ClusterIstio.decode(reader, reader.uint32()); + break; + case 13: + message.telemetry = $root.google.monitoring.v3.Service.Telemetry.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Service message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.Service + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.Service} Service + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Service.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Service message. + * @function verify + * @memberof google.monitoring.v3.Service + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Service.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.custom != null && message.hasOwnProperty("custom")) { + properties.identifier = 1; + { + var error = $root.google.monitoring.v3.Service.Custom.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.appEngine != null && message.hasOwnProperty("appEngine")) { + if (properties.identifier === 1) + return "identifier: multiple values"; + properties.identifier = 1; + { + var error = $root.google.monitoring.v3.Service.AppEngine.verify(message.appEngine); + if (error) + return "appEngine." + error; + } + } + if (message.cloudEndpoints != null && message.hasOwnProperty("cloudEndpoints")) { + if (properties.identifier === 1) + return "identifier: multiple values"; + properties.identifier = 1; + { + var error = $root.google.monitoring.v3.Service.CloudEndpoints.verify(message.cloudEndpoints); + if (error) + return "cloudEndpoints." + error; + } + } + if (message.clusterIstio != null && message.hasOwnProperty("clusterIstio")) { + if (properties.identifier === 1) + return "identifier: multiple values"; + properties.identifier = 1; + { + var error = $root.google.monitoring.v3.Service.ClusterIstio.verify(message.clusterIstio); + if (error) + return "clusterIstio." + error; + } + } + if (message.telemetry != null && message.hasOwnProperty("telemetry")) { + var error = $root.google.monitoring.v3.Service.Telemetry.verify(message.telemetry); + if (error) + return "telemetry." + error; + } + return null; + }; + + /** + * Creates a Service message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.Service + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.Service} Service + */ + Service.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.Service) + return object; + var message = new $root.google.monitoring.v3.Service(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.monitoring.v3.Service.custom: object expected"); + message.custom = $root.google.monitoring.v3.Service.Custom.fromObject(object.custom); + } + if (object.appEngine != null) { + if (typeof object.appEngine !== "object") + throw TypeError(".google.monitoring.v3.Service.appEngine: object expected"); + message.appEngine = $root.google.monitoring.v3.Service.AppEngine.fromObject(object.appEngine); + } + if (object.cloudEndpoints != null) { + if (typeof object.cloudEndpoints !== "object") + throw TypeError(".google.monitoring.v3.Service.cloudEndpoints: object expected"); + message.cloudEndpoints = $root.google.monitoring.v3.Service.CloudEndpoints.fromObject(object.cloudEndpoints); + } + if (object.clusterIstio != null) { + if (typeof object.clusterIstio !== "object") + throw TypeError(".google.monitoring.v3.Service.clusterIstio: object expected"); + message.clusterIstio = $root.google.monitoring.v3.Service.ClusterIstio.fromObject(object.clusterIstio); + } + if (object.telemetry != null) { + if (typeof object.telemetry !== "object") + throw TypeError(".google.monitoring.v3.Service.telemetry: object expected"); + message.telemetry = $root.google.monitoring.v3.Service.Telemetry.fromObject(object.telemetry); + } + return message; + }; + + /** + * Creates a plain object from a Service message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.Service + * @static + * @param {google.monitoring.v3.Service} message Service + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Service.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.telemetry = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.monitoring.v3.Service.Custom.toObject(message.custom, options); + if (options.oneofs) + object.identifier = "custom"; + } + if (message.appEngine != null && message.hasOwnProperty("appEngine")) { + object.appEngine = $root.google.monitoring.v3.Service.AppEngine.toObject(message.appEngine, options); + if (options.oneofs) + object.identifier = "appEngine"; + } + if (message.cloudEndpoints != null && message.hasOwnProperty("cloudEndpoints")) { + object.cloudEndpoints = $root.google.monitoring.v3.Service.CloudEndpoints.toObject(message.cloudEndpoints, options); + if (options.oneofs) + object.identifier = "cloudEndpoints"; + } + if (message.clusterIstio != null && message.hasOwnProperty("clusterIstio")) { + object.clusterIstio = $root.google.monitoring.v3.Service.ClusterIstio.toObject(message.clusterIstio, options); + if (options.oneofs) + object.identifier = "clusterIstio"; + } + if (message.telemetry != null && message.hasOwnProperty("telemetry")) + object.telemetry = $root.google.monitoring.v3.Service.Telemetry.toObject(message.telemetry, options); + return object; + }; + + /** + * Converts this Service to JSON. + * @function toJSON + * @memberof google.monitoring.v3.Service + * @instance + * @returns {Object.} JSON object + */ + Service.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Service.Custom = (function() { + + /** + * Properties of a Custom. + * @memberof google.monitoring.v3.Service + * @interface ICustom + */ + + /** + * Constructs a new Custom. + * @memberof google.monitoring.v3.Service + * @classdesc Represents a Custom. + * @implements ICustom + * @constructor + * @param {google.monitoring.v3.Service.ICustom=} [properties] Properties to set + */ + function Custom(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Custom instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.Service.Custom + * @static + * @param {google.monitoring.v3.Service.ICustom=} [properties] Properties to set + * @returns {google.monitoring.v3.Service.Custom} Custom instance + */ + Custom.create = function create(properties) { + return new Custom(properties); + }; + + /** + * Encodes the specified Custom message. Does not implicitly {@link google.monitoring.v3.Service.Custom.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.Service.Custom + * @static + * @param {google.monitoring.v3.Service.ICustom} message Custom message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Custom.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Custom message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.Custom.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.Service.Custom + * @static + * @param {google.monitoring.v3.Service.ICustom} message Custom message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Custom.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Custom message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.Service.Custom + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.Service.Custom} Custom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Custom.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Service.Custom(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Custom message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.Service.Custom + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.Service.Custom} Custom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Custom.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Custom message. + * @function verify + * @memberof google.monitoring.v3.Service.Custom + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Custom.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Custom message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.Service.Custom + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.Service.Custom} Custom + */ + Custom.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.Service.Custom) + return object; + return new $root.google.monitoring.v3.Service.Custom(); + }; + + /** + * Creates a plain object from a Custom message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.Service.Custom + * @static + * @param {google.monitoring.v3.Service.Custom} message Custom + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Custom.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Custom to JSON. + * @function toJSON + * @memberof google.monitoring.v3.Service.Custom + * @instance + * @returns {Object.} JSON object + */ + Custom.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Custom; + })(); + + Service.AppEngine = (function() { + + /** + * Properties of an AppEngine. + * @memberof google.monitoring.v3.Service + * @interface IAppEngine + * @property {string|null} [moduleId] AppEngine moduleId + */ + + /** + * Constructs a new AppEngine. + * @memberof google.monitoring.v3.Service + * @classdesc Represents an AppEngine. + * @implements IAppEngine + * @constructor + * @param {google.monitoring.v3.Service.IAppEngine=} [properties] Properties to set + */ + function AppEngine(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AppEngine moduleId. + * @member {string} moduleId + * @memberof google.monitoring.v3.Service.AppEngine + * @instance + */ + AppEngine.prototype.moduleId = ""; + + /** + * Creates a new AppEngine instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.Service.AppEngine + * @static + * @param {google.monitoring.v3.Service.IAppEngine=} [properties] Properties to set + * @returns {google.monitoring.v3.Service.AppEngine} AppEngine instance + */ + AppEngine.create = function create(properties) { + return new AppEngine(properties); + }; + + /** + * Encodes the specified AppEngine message. Does not implicitly {@link google.monitoring.v3.Service.AppEngine.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.Service.AppEngine + * @static + * @param {google.monitoring.v3.Service.IAppEngine} message AppEngine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppEngine.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.moduleId != null && message.hasOwnProperty("moduleId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.moduleId); + return writer; + }; + + /** + * Encodes the specified AppEngine message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.AppEngine.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.Service.AppEngine + * @static + * @param {google.monitoring.v3.Service.IAppEngine} message AppEngine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppEngine.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AppEngine message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.Service.AppEngine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.Service.AppEngine} AppEngine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppEngine.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Service.AppEngine(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moduleId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AppEngine message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.Service.AppEngine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.Service.AppEngine} AppEngine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppEngine.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AppEngine message. + * @function verify + * @memberof google.monitoring.v3.Service.AppEngine + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AppEngine.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.moduleId != null && message.hasOwnProperty("moduleId")) + if (!$util.isString(message.moduleId)) + return "moduleId: string expected"; + return null; + }; + + /** + * Creates an AppEngine message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.Service.AppEngine + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.Service.AppEngine} AppEngine + */ + AppEngine.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.Service.AppEngine) + return object; + var message = new $root.google.monitoring.v3.Service.AppEngine(); + if (object.moduleId != null) + message.moduleId = String(object.moduleId); + return message; + }; + + /** + * Creates a plain object from an AppEngine message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.Service.AppEngine + * @static + * @param {google.monitoring.v3.Service.AppEngine} message AppEngine + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AppEngine.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.moduleId = ""; + if (message.moduleId != null && message.hasOwnProperty("moduleId")) + object.moduleId = message.moduleId; + return object; + }; + + /** + * Converts this AppEngine to JSON. + * @function toJSON + * @memberof google.monitoring.v3.Service.AppEngine + * @instance + * @returns {Object.} JSON object + */ + AppEngine.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AppEngine; + })(); + + Service.CloudEndpoints = (function() { + + /** + * Properties of a CloudEndpoints. + * @memberof google.monitoring.v3.Service + * @interface ICloudEndpoints + * @property {string|null} [service] CloudEndpoints service + */ + + /** + * Constructs a new CloudEndpoints. + * @memberof google.monitoring.v3.Service + * @classdesc Represents a CloudEndpoints. + * @implements ICloudEndpoints + * @constructor + * @param {google.monitoring.v3.Service.ICloudEndpoints=} [properties] Properties to set + */ + function CloudEndpoints(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudEndpoints service. + * @member {string} service + * @memberof google.monitoring.v3.Service.CloudEndpoints + * @instance + */ + CloudEndpoints.prototype.service = ""; + + /** + * Creates a new CloudEndpoints instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.Service.CloudEndpoints + * @static + * @param {google.monitoring.v3.Service.ICloudEndpoints=} [properties] Properties to set + * @returns {google.monitoring.v3.Service.CloudEndpoints} CloudEndpoints instance + */ + CloudEndpoints.create = function create(properties) { + return new CloudEndpoints(properties); + }; + + /** + * Encodes the specified CloudEndpoints message. Does not implicitly {@link google.monitoring.v3.Service.CloudEndpoints.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.Service.CloudEndpoints + * @static + * @param {google.monitoring.v3.Service.ICloudEndpoints} message CloudEndpoints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudEndpoints.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && message.hasOwnProperty("service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + return writer; + }; + + /** + * Encodes the specified CloudEndpoints message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.CloudEndpoints.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.Service.CloudEndpoints + * @static + * @param {google.monitoring.v3.Service.ICloudEndpoints} message CloudEndpoints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudEndpoints.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudEndpoints message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.Service.CloudEndpoints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.Service.CloudEndpoints} CloudEndpoints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudEndpoints.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Service.CloudEndpoints(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.service = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudEndpoints message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.Service.CloudEndpoints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.Service.CloudEndpoints} CloudEndpoints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudEndpoints.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudEndpoints message. + * @function verify + * @memberof google.monitoring.v3.Service.CloudEndpoints + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudEndpoints.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + return null; + }; + + /** + * Creates a CloudEndpoints message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.Service.CloudEndpoints + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.Service.CloudEndpoints} CloudEndpoints + */ + CloudEndpoints.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.Service.CloudEndpoints) + return object; + var message = new $root.google.monitoring.v3.Service.CloudEndpoints(); + if (object.service != null) + message.service = String(object.service); + return message; + }; + + /** + * Creates a plain object from a CloudEndpoints message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.Service.CloudEndpoints + * @static + * @param {google.monitoring.v3.Service.CloudEndpoints} message CloudEndpoints + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudEndpoints.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + return object; + }; + + /** + * Converts this CloudEndpoints to JSON. + * @function toJSON + * @memberof google.monitoring.v3.Service.CloudEndpoints + * @instance + * @returns {Object.} JSON object + */ + CloudEndpoints.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CloudEndpoints; + })(); + + Service.ClusterIstio = (function() { + + /** + * Properties of a ClusterIstio. + * @memberof google.monitoring.v3.Service + * @interface IClusterIstio + * @property {string|null} [location] ClusterIstio location + * @property {string|null} [clusterName] ClusterIstio clusterName + * @property {string|null} [serviceNamespace] ClusterIstio serviceNamespace + * @property {string|null} [serviceName] ClusterIstio serviceName + */ + + /** + * Constructs a new ClusterIstio. + * @memberof google.monitoring.v3.Service + * @classdesc Represents a ClusterIstio. + * @implements IClusterIstio + * @constructor + * @param {google.monitoring.v3.Service.IClusterIstio=} [properties] Properties to set + */ + function ClusterIstio(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterIstio location. + * @member {string} location + * @memberof google.monitoring.v3.Service.ClusterIstio + * @instance + */ + ClusterIstio.prototype.location = ""; + + /** + * ClusterIstio clusterName. + * @member {string} clusterName + * @memberof google.monitoring.v3.Service.ClusterIstio + * @instance + */ + ClusterIstio.prototype.clusterName = ""; + + /** + * ClusterIstio serviceNamespace. + * @member {string} serviceNamespace + * @memberof google.monitoring.v3.Service.ClusterIstio + * @instance + */ + ClusterIstio.prototype.serviceNamespace = ""; + + /** + * ClusterIstio serviceName. + * @member {string} serviceName + * @memberof google.monitoring.v3.Service.ClusterIstio + * @instance + */ + ClusterIstio.prototype.serviceName = ""; + + /** + * Creates a new ClusterIstio instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.Service.ClusterIstio + * @static + * @param {google.monitoring.v3.Service.IClusterIstio=} [properties] Properties to set + * @returns {google.monitoring.v3.Service.ClusterIstio} ClusterIstio instance + */ + ClusterIstio.create = function create(properties) { + return new ClusterIstio(properties); + }; + + /** + * Encodes the specified ClusterIstio message. Does not implicitly {@link google.monitoring.v3.Service.ClusterIstio.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.Service.ClusterIstio + * @static + * @param {google.monitoring.v3.Service.IClusterIstio} message ClusterIstio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterIstio.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.hasOwnProperty("location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterName); + if (message.serviceNamespace != null && message.hasOwnProperty("serviceNamespace")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.serviceNamespace); + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.serviceName); + return writer; + }; + + /** + * Encodes the specified ClusterIstio message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.ClusterIstio.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.Service.ClusterIstio + * @static + * @param {google.monitoring.v3.Service.IClusterIstio} message ClusterIstio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterIstio.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClusterIstio message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.Service.ClusterIstio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.Service.ClusterIstio} ClusterIstio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterIstio.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Service.ClusterIstio(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.location = reader.string(); + break; + case 2: + message.clusterName = reader.string(); + break; + case 3: + message.serviceNamespace = reader.string(); + break; + case 4: + message.serviceName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterIstio message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.Service.ClusterIstio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.Service.ClusterIstio} ClusterIstio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterIstio.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterIstio message. + * @function verify + * @memberof google.monitoring.v3.Service.ClusterIstio + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterIstio.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + if (!$util.isString(message.clusterName)) + return "clusterName: string expected"; + if (message.serviceNamespace != null && message.hasOwnProperty("serviceNamespace")) + if (!$util.isString(message.serviceNamespace)) + return "serviceNamespace: string expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + return null; + }; + + /** + * Creates a ClusterIstio message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.Service.ClusterIstio + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.Service.ClusterIstio} ClusterIstio + */ + ClusterIstio.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.Service.ClusterIstio) + return object; + var message = new $root.google.monitoring.v3.Service.ClusterIstio(); + if (object.location != null) + message.location = String(object.location); + if (object.clusterName != null) + message.clusterName = String(object.clusterName); + if (object.serviceNamespace != null) + message.serviceNamespace = String(object.serviceNamespace); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + return message; + }; + + /** + * Creates a plain object from a ClusterIstio message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.Service.ClusterIstio + * @static + * @param {google.monitoring.v3.Service.ClusterIstio} message ClusterIstio + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterIstio.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.location = ""; + object.clusterName = ""; + object.serviceNamespace = ""; + object.serviceName = ""; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + object.clusterName = message.clusterName; + if (message.serviceNamespace != null && message.hasOwnProperty("serviceNamespace")) + object.serviceNamespace = message.serviceNamespace; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + return object; + }; + + /** + * Converts this ClusterIstio to JSON. + * @function toJSON + * @memberof google.monitoring.v3.Service.ClusterIstio + * @instance + * @returns {Object.} JSON object + */ + ClusterIstio.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ClusterIstio; + })(); + + Service.Telemetry = (function() { + + /** + * Properties of a Telemetry. + * @memberof google.monitoring.v3.Service + * @interface ITelemetry + * @property {string|null} [resourceName] Telemetry resourceName + */ + + /** + * Constructs a new Telemetry. + * @memberof google.monitoring.v3.Service + * @classdesc Represents a Telemetry. + * @implements ITelemetry + * @constructor + * @param {google.monitoring.v3.Service.ITelemetry=} [properties] Properties to set + */ + function Telemetry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Telemetry resourceName. + * @member {string} resourceName + * @memberof google.monitoring.v3.Service.Telemetry + * @instance + */ + Telemetry.prototype.resourceName = ""; + + /** + * Creates a new Telemetry instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.Service.Telemetry + * @static + * @param {google.monitoring.v3.Service.ITelemetry=} [properties] Properties to set + * @returns {google.monitoring.v3.Service.Telemetry} Telemetry instance + */ + Telemetry.create = function create(properties) { + return new Telemetry(properties); + }; + + /** + * Encodes the specified Telemetry message. Does not implicitly {@link google.monitoring.v3.Service.Telemetry.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.Service.Telemetry + * @static + * @param {google.monitoring.v3.Service.ITelemetry} message Telemetry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Telemetry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); + return writer; + }; + + /** + * Encodes the specified Telemetry message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.Telemetry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.Service.Telemetry + * @static + * @param {google.monitoring.v3.Service.ITelemetry} message Telemetry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Telemetry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Telemetry message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.Service.Telemetry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.Service.Telemetry} Telemetry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Telemetry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Service.Telemetry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Telemetry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.Service.Telemetry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.Service.Telemetry} Telemetry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Telemetry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Telemetry message. + * @function verify + * @memberof google.monitoring.v3.Service.Telemetry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Telemetry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + return null; + }; + + /** + * Creates a Telemetry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.Service.Telemetry + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.Service.Telemetry} Telemetry + */ + Telemetry.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.Service.Telemetry) + return object; + var message = new $root.google.monitoring.v3.Service.Telemetry(); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + return message; + }; + + /** + * Creates a plain object from a Telemetry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.Service.Telemetry + * @static + * @param {google.monitoring.v3.Service.Telemetry} message Telemetry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Telemetry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.resourceName = ""; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + return object; + }; + + /** + * Converts this Telemetry to JSON. + * @function toJSON + * @memberof google.monitoring.v3.Service.Telemetry + * @instance + * @returns {Object.} JSON object + */ + Telemetry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Telemetry; + })(); + + return Service; + })(); + + v3.ServiceLevelObjective = (function() { + + /** + * Properties of a ServiceLevelObjective. + * @memberof google.monitoring.v3 + * @interface IServiceLevelObjective + * @property {string|null} [name] ServiceLevelObjective name + * @property {string|null} [displayName] ServiceLevelObjective displayName + * @property {google.monitoring.v3.IServiceLevelIndicator|null} [serviceLevelIndicator] ServiceLevelObjective serviceLevelIndicator + * @property {number|null} [goal] ServiceLevelObjective goal + * @property {google.protobuf.IDuration|null} [rollingPeriod] ServiceLevelObjective rollingPeriod + * @property {google.type.CalendarPeriod|null} [calendarPeriod] ServiceLevelObjective calendarPeriod + */ + + /** + * Constructs a new ServiceLevelObjective. + * @memberof google.monitoring.v3 + * @classdesc Represents a ServiceLevelObjective. + * @implements IServiceLevelObjective + * @constructor + * @param {google.monitoring.v3.IServiceLevelObjective=} [properties] Properties to set + */ + function ServiceLevelObjective(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceLevelObjective name. + * @member {string} name + * @memberof google.monitoring.v3.ServiceLevelObjective + * @instance + */ + ServiceLevelObjective.prototype.name = ""; + + /** + * ServiceLevelObjective displayName. + * @member {string} displayName + * @memberof google.monitoring.v3.ServiceLevelObjective + * @instance + */ + ServiceLevelObjective.prototype.displayName = ""; + + /** + * ServiceLevelObjective serviceLevelIndicator. + * @member {google.monitoring.v3.IServiceLevelIndicator|null|undefined} serviceLevelIndicator + * @memberof google.monitoring.v3.ServiceLevelObjective + * @instance + */ + ServiceLevelObjective.prototype.serviceLevelIndicator = null; + + /** + * ServiceLevelObjective goal. + * @member {number} goal + * @memberof google.monitoring.v3.ServiceLevelObjective + * @instance + */ + ServiceLevelObjective.prototype.goal = 0; + + /** + * ServiceLevelObjective rollingPeriod. + * @member {google.protobuf.IDuration|null|undefined} rollingPeriod + * @memberof google.monitoring.v3.ServiceLevelObjective + * @instance + */ + ServiceLevelObjective.prototype.rollingPeriod = null; + + /** + * ServiceLevelObjective calendarPeriod. + * @member {google.type.CalendarPeriod} calendarPeriod + * @memberof google.monitoring.v3.ServiceLevelObjective + * @instance + */ + ServiceLevelObjective.prototype.calendarPeriod = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ServiceLevelObjective period. + * @member {"rollingPeriod"|"calendarPeriod"|undefined} period + * @memberof google.monitoring.v3.ServiceLevelObjective + * @instance + */ + Object.defineProperty(ServiceLevelObjective.prototype, "period", { + get: $util.oneOfGetter($oneOfFields = ["rollingPeriod", "calendarPeriod"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ServiceLevelObjective instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.ServiceLevelObjective + * @static + * @param {google.monitoring.v3.IServiceLevelObjective=} [properties] Properties to set + * @returns {google.monitoring.v3.ServiceLevelObjective} ServiceLevelObjective instance + */ + ServiceLevelObjective.create = function create(properties) { + return new ServiceLevelObjective(properties); + }; + + /** + * Encodes the specified ServiceLevelObjective message. Does not implicitly {@link google.monitoring.v3.ServiceLevelObjective.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.ServiceLevelObjective + * @static + * @param {google.monitoring.v3.IServiceLevelObjective} message ServiceLevelObjective message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceLevelObjective.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.serviceLevelIndicator != null && message.hasOwnProperty("serviceLevelIndicator")) + $root.google.monitoring.v3.ServiceLevelIndicator.encode(message.serviceLevelIndicator, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.goal != null && message.hasOwnProperty("goal")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.goal); + if (message.rollingPeriod != null && message.hasOwnProperty("rollingPeriod")) + $root.google.protobuf.Duration.encode(message.rollingPeriod, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.calendarPeriod != null && message.hasOwnProperty("calendarPeriod")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.calendarPeriod); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified ServiceLevelObjective message, length delimited. Does not implicitly {@link google.monitoring.v3.ServiceLevelObjective.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.ServiceLevelObjective + * @static + * @param {google.monitoring.v3.IServiceLevelObjective} message ServiceLevelObjective message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceLevelObjective.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceLevelObjective message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.ServiceLevelObjective + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.ServiceLevelObjective} ServiceLevelObjective + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceLevelObjective.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ServiceLevelObjective(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 11: + message.displayName = reader.string(); + break; + case 3: + message.serviceLevelIndicator = $root.google.monitoring.v3.ServiceLevelIndicator.decode(reader, reader.uint32()); + break; + case 4: + message.goal = reader.double(); + break; + case 5: + message.rollingPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 6: + message.calendarPeriod = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceLevelObjective message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.ServiceLevelObjective + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.ServiceLevelObjective} ServiceLevelObjective + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceLevelObjective.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceLevelObjective message. + * @function verify + * @memberof google.monitoring.v3.ServiceLevelObjective + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceLevelObjective.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.serviceLevelIndicator != null && message.hasOwnProperty("serviceLevelIndicator")) { + var error = $root.google.monitoring.v3.ServiceLevelIndicator.verify(message.serviceLevelIndicator); + if (error) + return "serviceLevelIndicator." + error; + } + if (message.goal != null && message.hasOwnProperty("goal")) + if (typeof message.goal !== "number") + return "goal: number expected"; + if (message.rollingPeriod != null && message.hasOwnProperty("rollingPeriod")) { + properties.period = 1; + { + var error = $root.google.protobuf.Duration.verify(message.rollingPeriod); + if (error) + return "rollingPeriod." + error; + } + } + if (message.calendarPeriod != null && message.hasOwnProperty("calendarPeriod")) { + if (properties.period === 1) + return "period: multiple values"; + properties.period = 1; + switch (message.calendarPeriod) { + default: + return "calendarPeriod: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + return null; + }; + + /** + * Creates a ServiceLevelObjective message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.ServiceLevelObjective + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.ServiceLevelObjective} ServiceLevelObjective + */ + ServiceLevelObjective.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ServiceLevelObjective) + return object; + var message = new $root.google.monitoring.v3.ServiceLevelObjective(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.serviceLevelIndicator != null) { + if (typeof object.serviceLevelIndicator !== "object") + throw TypeError(".google.monitoring.v3.ServiceLevelObjective.serviceLevelIndicator: object expected"); + message.serviceLevelIndicator = $root.google.monitoring.v3.ServiceLevelIndicator.fromObject(object.serviceLevelIndicator); + } + if (object.goal != null) + message.goal = Number(object.goal); + if (object.rollingPeriod != null) { + if (typeof object.rollingPeriod !== "object") + throw TypeError(".google.monitoring.v3.ServiceLevelObjective.rollingPeriod: object expected"); + message.rollingPeriod = $root.google.protobuf.Duration.fromObject(object.rollingPeriod); + } + switch (object.calendarPeriod) { + case "CALENDAR_PERIOD_UNSPECIFIED": + case 0: + message.calendarPeriod = 0; + break; + case "DAY": + case 1: + message.calendarPeriod = 1; + break; + case "WEEK": + case 2: + message.calendarPeriod = 2; + break; + case "FORTNIGHT": + case 3: + message.calendarPeriod = 3; + break; + case "MONTH": + case 4: + message.calendarPeriod = 4; + break; + case "QUARTER": + case 5: + message.calendarPeriod = 5; + break; + case "HALF": + case 6: + message.calendarPeriod = 6; + break; + case "YEAR": + case 7: + message.calendarPeriod = 7; + break; + } + return message; + }; + + /** + * Creates a plain object from a ServiceLevelObjective message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.ServiceLevelObjective + * @static + * @param {google.monitoring.v3.ServiceLevelObjective} message ServiceLevelObjective + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceLevelObjective.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.serviceLevelIndicator = null; + object.goal = 0; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.serviceLevelIndicator != null && message.hasOwnProperty("serviceLevelIndicator")) + object.serviceLevelIndicator = $root.google.monitoring.v3.ServiceLevelIndicator.toObject(message.serviceLevelIndicator, options); + if (message.goal != null && message.hasOwnProperty("goal")) + object.goal = options.json && !isFinite(message.goal) ? String(message.goal) : message.goal; + if (message.rollingPeriod != null && message.hasOwnProperty("rollingPeriod")) { + object.rollingPeriod = $root.google.protobuf.Duration.toObject(message.rollingPeriod, options); + if (options.oneofs) + object.period = "rollingPeriod"; + } + if (message.calendarPeriod != null && message.hasOwnProperty("calendarPeriod")) { + object.calendarPeriod = options.enums === String ? $root.google.type.CalendarPeriod[message.calendarPeriod] : message.calendarPeriod; + if (options.oneofs) + object.period = "calendarPeriod"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this ServiceLevelObjective to JSON. + * @function toJSON + * @memberof google.monitoring.v3.ServiceLevelObjective + * @instance + * @returns {Object.} JSON object + */ + ServiceLevelObjective.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * View enum. + * @name google.monitoring.v3.ServiceLevelObjective.View + * @enum {string} + * @property {number} VIEW_UNSPECIFIED=0 VIEW_UNSPECIFIED value + * @property {number} FULL=2 FULL value + * @property {number} EXPLICIT=1 EXPLICIT value + */ + ServiceLevelObjective.View = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VIEW_UNSPECIFIED"] = 0; + values[valuesById[2] = "FULL"] = 2; + values[valuesById[1] = "EXPLICIT"] = 1; + return values; + })(); + + return ServiceLevelObjective; + })(); + + v3.ServiceLevelIndicator = (function() { + + /** + * Properties of a ServiceLevelIndicator. + * @memberof google.monitoring.v3 + * @interface IServiceLevelIndicator + * @property {google.monitoring.v3.IBasicSli|null} [basicSli] ServiceLevelIndicator basicSli + * @property {google.monitoring.v3.IRequestBasedSli|null} [requestBased] ServiceLevelIndicator requestBased + * @property {google.monitoring.v3.IWindowsBasedSli|null} [windowsBased] ServiceLevelIndicator windowsBased + */ + + /** + * Constructs a new ServiceLevelIndicator. + * @memberof google.monitoring.v3 + * @classdesc Represents a ServiceLevelIndicator. + * @implements IServiceLevelIndicator + * @constructor + * @param {google.monitoring.v3.IServiceLevelIndicator=} [properties] Properties to set + */ + function ServiceLevelIndicator(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceLevelIndicator basicSli. + * @member {google.monitoring.v3.IBasicSli|null|undefined} basicSli + * @memberof google.monitoring.v3.ServiceLevelIndicator + * @instance + */ + ServiceLevelIndicator.prototype.basicSli = null; + + /** + * ServiceLevelIndicator requestBased. + * @member {google.monitoring.v3.IRequestBasedSli|null|undefined} requestBased + * @memberof google.monitoring.v3.ServiceLevelIndicator + * @instance + */ + ServiceLevelIndicator.prototype.requestBased = null; + + /** + * ServiceLevelIndicator windowsBased. + * @member {google.monitoring.v3.IWindowsBasedSli|null|undefined} windowsBased + * @memberof google.monitoring.v3.ServiceLevelIndicator + * @instance + */ + ServiceLevelIndicator.prototype.windowsBased = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ServiceLevelIndicator type. + * @member {"basicSli"|"requestBased"|"windowsBased"|undefined} type + * @memberof google.monitoring.v3.ServiceLevelIndicator + * @instance + */ + Object.defineProperty(ServiceLevelIndicator.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["basicSli", "requestBased", "windowsBased"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ServiceLevelIndicator instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.ServiceLevelIndicator + * @static + * @param {google.monitoring.v3.IServiceLevelIndicator=} [properties] Properties to set + * @returns {google.monitoring.v3.ServiceLevelIndicator} ServiceLevelIndicator instance + */ + ServiceLevelIndicator.create = function create(properties) { + return new ServiceLevelIndicator(properties); + }; + + /** + * Encodes the specified ServiceLevelIndicator message. Does not implicitly {@link google.monitoring.v3.ServiceLevelIndicator.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.ServiceLevelIndicator + * @static + * @param {google.monitoring.v3.IServiceLevelIndicator} message ServiceLevelIndicator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceLevelIndicator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestBased != null && message.hasOwnProperty("requestBased")) + $root.google.monitoring.v3.RequestBasedSli.encode(message.requestBased, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.windowsBased != null && message.hasOwnProperty("windowsBased")) + $root.google.monitoring.v3.WindowsBasedSli.encode(message.windowsBased, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.basicSli != null && message.hasOwnProperty("basicSli")) + $root.google.monitoring.v3.BasicSli.encode(message.basicSli, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceLevelIndicator message, length delimited. Does not implicitly {@link google.monitoring.v3.ServiceLevelIndicator.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.ServiceLevelIndicator + * @static + * @param {google.monitoring.v3.IServiceLevelIndicator} message ServiceLevelIndicator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceLevelIndicator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceLevelIndicator message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.ServiceLevelIndicator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.ServiceLevelIndicator} ServiceLevelIndicator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceLevelIndicator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ServiceLevelIndicator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.basicSli = $root.google.monitoring.v3.BasicSli.decode(reader, reader.uint32()); + break; + case 1: + message.requestBased = $root.google.monitoring.v3.RequestBasedSli.decode(reader, reader.uint32()); + break; + case 2: + message.windowsBased = $root.google.monitoring.v3.WindowsBasedSli.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceLevelIndicator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.ServiceLevelIndicator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.ServiceLevelIndicator} ServiceLevelIndicator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceLevelIndicator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceLevelIndicator message. + * @function verify + * @memberof google.monitoring.v3.ServiceLevelIndicator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceLevelIndicator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.basicSli != null && message.hasOwnProperty("basicSli")) { + properties.type = 1; + { + var error = $root.google.monitoring.v3.BasicSli.verify(message.basicSli); + if (error) + return "basicSli." + error; + } + } + if (message.requestBased != null && message.hasOwnProperty("requestBased")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.monitoring.v3.RequestBasedSli.verify(message.requestBased); + if (error) + return "requestBased." + error; + } + } + if (message.windowsBased != null && message.hasOwnProperty("windowsBased")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.monitoring.v3.WindowsBasedSli.verify(message.windowsBased); + if (error) + return "windowsBased." + error; + } + } + return null; + }; + + /** + * Creates a ServiceLevelIndicator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.ServiceLevelIndicator + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.ServiceLevelIndicator} ServiceLevelIndicator + */ + ServiceLevelIndicator.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ServiceLevelIndicator) + return object; + var message = new $root.google.monitoring.v3.ServiceLevelIndicator(); + if (object.basicSli != null) { + if (typeof object.basicSli !== "object") + throw TypeError(".google.monitoring.v3.ServiceLevelIndicator.basicSli: object expected"); + message.basicSli = $root.google.monitoring.v3.BasicSli.fromObject(object.basicSli); + } + if (object.requestBased != null) { + if (typeof object.requestBased !== "object") + throw TypeError(".google.monitoring.v3.ServiceLevelIndicator.requestBased: object expected"); + message.requestBased = $root.google.monitoring.v3.RequestBasedSli.fromObject(object.requestBased); + } + if (object.windowsBased != null) { + if (typeof object.windowsBased !== "object") + throw TypeError(".google.monitoring.v3.ServiceLevelIndicator.windowsBased: object expected"); + message.windowsBased = $root.google.monitoring.v3.WindowsBasedSli.fromObject(object.windowsBased); + } + return message; + }; + + /** + * Creates a plain object from a ServiceLevelIndicator message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.ServiceLevelIndicator + * @static + * @param {google.monitoring.v3.ServiceLevelIndicator} message ServiceLevelIndicator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceLevelIndicator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.requestBased != null && message.hasOwnProperty("requestBased")) { + object.requestBased = $root.google.monitoring.v3.RequestBasedSli.toObject(message.requestBased, options); + if (options.oneofs) + object.type = "requestBased"; + } + if (message.windowsBased != null && message.hasOwnProperty("windowsBased")) { + object.windowsBased = $root.google.monitoring.v3.WindowsBasedSli.toObject(message.windowsBased, options); + if (options.oneofs) + object.type = "windowsBased"; + } + if (message.basicSli != null && message.hasOwnProperty("basicSli")) { + object.basicSli = $root.google.monitoring.v3.BasicSli.toObject(message.basicSli, options); + if (options.oneofs) + object.type = "basicSli"; + } + return object; + }; + + /** + * Converts this ServiceLevelIndicator to JSON. + * @function toJSON + * @memberof google.monitoring.v3.ServiceLevelIndicator + * @instance + * @returns {Object.} JSON object + */ + ServiceLevelIndicator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ServiceLevelIndicator; + })(); + + v3.BasicSli = (function() { + + /** + * Properties of a BasicSli. + * @memberof google.monitoring.v3 + * @interface IBasicSli + * @property {Array.|null} [method] BasicSli method + * @property {Array.|null} [location] BasicSli location + * @property {Array.|null} [version] BasicSli version + * @property {google.monitoring.v3.BasicSli.IAvailabilityCriteria|null} [availability] BasicSli availability + * @property {google.monitoring.v3.BasicSli.ILatencyCriteria|null} [latency] BasicSli latency + */ + + /** + * Constructs a new BasicSli. + * @memberof google.monitoring.v3 + * @classdesc Represents a BasicSli. + * @implements IBasicSli + * @constructor + * @param {google.monitoring.v3.IBasicSli=} [properties] Properties to set + */ + function BasicSli(properties) { + this.method = []; + this.location = []; + this.version = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BasicSli method. + * @member {Array.} method + * @memberof google.monitoring.v3.BasicSli + * @instance + */ + BasicSli.prototype.method = $util.emptyArray; + + /** + * BasicSli location. + * @member {Array.} location + * @memberof google.monitoring.v3.BasicSli + * @instance + */ + BasicSli.prototype.location = $util.emptyArray; + + /** + * BasicSli version. + * @member {Array.} version + * @memberof google.monitoring.v3.BasicSli + * @instance + */ + BasicSli.prototype.version = $util.emptyArray; + + /** + * BasicSli availability. + * @member {google.monitoring.v3.BasicSli.IAvailabilityCriteria|null|undefined} availability + * @memberof google.monitoring.v3.BasicSli + * @instance + */ + BasicSli.prototype.availability = null; + + /** + * BasicSli latency. + * @member {google.monitoring.v3.BasicSli.ILatencyCriteria|null|undefined} latency + * @memberof google.monitoring.v3.BasicSli + * @instance + */ + BasicSli.prototype.latency = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BasicSli sliCriteria. + * @member {"availability"|"latency"|undefined} sliCriteria + * @memberof google.monitoring.v3.BasicSli + * @instance + */ + Object.defineProperty(BasicSli.prototype, "sliCriteria", { + get: $util.oneOfGetter($oneOfFields = ["availability", "latency"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BasicSli instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.BasicSli + * @static + * @param {google.monitoring.v3.IBasicSli=} [properties] Properties to set + * @returns {google.monitoring.v3.BasicSli} BasicSli instance + */ + BasicSli.create = function create(properties) { + return new BasicSli(properties); + }; + + /** + * Encodes the specified BasicSli message. Does not implicitly {@link google.monitoring.v3.BasicSli.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.BasicSli + * @static + * @param {google.monitoring.v3.IBasicSli} message BasicSli message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicSli.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.availability != null && message.hasOwnProperty("availability")) + $root.google.monitoring.v3.BasicSli.AvailabilityCriteria.encode(message.availability, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.latency != null && message.hasOwnProperty("latency")) + $root.google.monitoring.v3.BasicSli.LatencyCriteria.encode(message.latency, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.method[i]); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.location[i]); + if (message.version != null && message.version.length) + for (var i = 0; i < message.version.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.version[i]); + return writer; + }; + + /** + * Encodes the specified BasicSli message, length delimited. Does not implicitly {@link google.monitoring.v3.BasicSli.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.BasicSli + * @static + * @param {google.monitoring.v3.IBasicSli} message BasicSli message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicSli.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BasicSli message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.BasicSli + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.BasicSli} BasicSli + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicSli.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.BasicSli(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 7: + if (!(message.method && message.method.length)) + message.method = []; + message.method.push(reader.string()); + break; + case 8: + if (!(message.location && message.location.length)) + message.location = []; + message.location.push(reader.string()); + break; + case 9: + if (!(message.version && message.version.length)) + message.version = []; + message.version.push(reader.string()); + break; + case 2: + message.availability = $root.google.monitoring.v3.BasicSli.AvailabilityCriteria.decode(reader, reader.uint32()); + break; + case 3: + message.latency = $root.google.monitoring.v3.BasicSli.LatencyCriteria.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BasicSli message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.BasicSli + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.BasicSli} BasicSli + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicSli.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BasicSli message. + * @function verify + * @memberof google.monitoring.v3.BasicSli + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BasicSli.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) + if (!$util.isString(message.method[i])) + return "method: string[] expected"; + } + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) + if (!$util.isString(message.location[i])) + return "location: string[] expected"; + } + if (message.version != null && message.hasOwnProperty("version")) { + if (!Array.isArray(message.version)) + return "version: array expected"; + for (var i = 0; i < message.version.length; ++i) + if (!$util.isString(message.version[i])) + return "version: string[] expected"; + } + if (message.availability != null && message.hasOwnProperty("availability")) { + properties.sliCriteria = 1; + { + var error = $root.google.monitoring.v3.BasicSli.AvailabilityCriteria.verify(message.availability); + if (error) + return "availability." + error; + } + } + if (message.latency != null && message.hasOwnProperty("latency")) { + if (properties.sliCriteria === 1) + return "sliCriteria: multiple values"; + properties.sliCriteria = 1; + { + var error = $root.google.monitoring.v3.BasicSli.LatencyCriteria.verify(message.latency); + if (error) + return "latency." + error; + } + } + return null; + }; + + /** + * Creates a BasicSli message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.BasicSli + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.BasicSli} BasicSli + */ + BasicSli.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.BasicSli) + return object; + var message = new $root.google.monitoring.v3.BasicSli(); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.monitoring.v3.BasicSli.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) + message.method[i] = String(object.method[i]); + } + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.monitoring.v3.BasicSli.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) + message.location[i] = String(object.location[i]); + } + if (object.version) { + if (!Array.isArray(object.version)) + throw TypeError(".google.monitoring.v3.BasicSli.version: array expected"); + message.version = []; + for (var i = 0; i < object.version.length; ++i) + message.version[i] = String(object.version[i]); + } + if (object.availability != null) { + if (typeof object.availability !== "object") + throw TypeError(".google.monitoring.v3.BasicSli.availability: object expected"); + message.availability = $root.google.monitoring.v3.BasicSli.AvailabilityCriteria.fromObject(object.availability); + } + if (object.latency != null) { + if (typeof object.latency !== "object") + throw TypeError(".google.monitoring.v3.BasicSli.latency: object expected"); + message.latency = $root.google.monitoring.v3.BasicSli.LatencyCriteria.fromObject(object.latency); + } + return message; + }; + + /** + * Creates a plain object from a BasicSli message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.BasicSli + * @static + * @param {google.monitoring.v3.BasicSli} message BasicSli + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BasicSli.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.method = []; + object.location = []; + object.version = []; + } + if (message.availability != null && message.hasOwnProperty("availability")) { + object.availability = $root.google.monitoring.v3.BasicSli.AvailabilityCriteria.toObject(message.availability, options); + if (options.oneofs) + object.sliCriteria = "availability"; + } + if (message.latency != null && message.hasOwnProperty("latency")) { + object.latency = $root.google.monitoring.v3.BasicSli.LatencyCriteria.toObject(message.latency, options); + if (options.oneofs) + object.sliCriteria = "latency"; + } + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = message.method[j]; + } + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = message.location[j]; + } + if (message.version && message.version.length) { + object.version = []; + for (var j = 0; j < message.version.length; ++j) + object.version[j] = message.version[j]; + } + return object; + }; + + /** + * Converts this BasicSli to JSON. + * @function toJSON + * @memberof google.monitoring.v3.BasicSli + * @instance + * @returns {Object.} JSON object + */ + BasicSli.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + BasicSli.AvailabilityCriteria = (function() { + + /** + * Properties of an AvailabilityCriteria. + * @memberof google.monitoring.v3.BasicSli + * @interface IAvailabilityCriteria + */ + + /** + * Constructs a new AvailabilityCriteria. + * @memberof google.monitoring.v3.BasicSli + * @classdesc Represents an AvailabilityCriteria. + * @implements IAvailabilityCriteria + * @constructor + * @param {google.monitoring.v3.BasicSli.IAvailabilityCriteria=} [properties] Properties to set + */ + function AvailabilityCriteria(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new AvailabilityCriteria instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria + * @static + * @param {google.monitoring.v3.BasicSli.IAvailabilityCriteria=} [properties] Properties to set + * @returns {google.monitoring.v3.BasicSli.AvailabilityCriteria} AvailabilityCriteria instance + */ + AvailabilityCriteria.create = function create(properties) { + return new AvailabilityCriteria(properties); + }; + + /** + * Encodes the specified AvailabilityCriteria message. Does not implicitly {@link google.monitoring.v3.BasicSli.AvailabilityCriteria.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria + * @static + * @param {google.monitoring.v3.BasicSli.IAvailabilityCriteria} message AvailabilityCriteria message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvailabilityCriteria.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AvailabilityCriteria message, length delimited. Does not implicitly {@link google.monitoring.v3.BasicSli.AvailabilityCriteria.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria + * @static + * @param {google.monitoring.v3.BasicSli.IAvailabilityCriteria} message AvailabilityCriteria message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvailabilityCriteria.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AvailabilityCriteria message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.BasicSli.AvailabilityCriteria} AvailabilityCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvailabilityCriteria.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.BasicSli.AvailabilityCriteria(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AvailabilityCriteria message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.BasicSli.AvailabilityCriteria} AvailabilityCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvailabilityCriteria.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AvailabilityCriteria message. + * @function verify + * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AvailabilityCriteria.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AvailabilityCriteria message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.BasicSli.AvailabilityCriteria} AvailabilityCriteria + */ + AvailabilityCriteria.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.BasicSli.AvailabilityCriteria) + return object; + return new $root.google.monitoring.v3.BasicSli.AvailabilityCriteria(); + }; + + /** + * Creates a plain object from an AvailabilityCriteria message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria + * @static + * @param {google.monitoring.v3.BasicSli.AvailabilityCriteria} message AvailabilityCriteria + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AvailabilityCriteria.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AvailabilityCriteria to JSON. + * @function toJSON + * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria + * @instance + * @returns {Object.} JSON object + */ + AvailabilityCriteria.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AvailabilityCriteria; + })(); + + BasicSli.LatencyCriteria = (function() { + + /** + * Properties of a LatencyCriteria. + * @memberof google.monitoring.v3.BasicSli + * @interface ILatencyCriteria + * @property {google.protobuf.IDuration|null} [threshold] LatencyCriteria threshold + */ + + /** + * Constructs a new LatencyCriteria. + * @memberof google.monitoring.v3.BasicSli + * @classdesc Represents a LatencyCriteria. + * @implements ILatencyCriteria + * @constructor + * @param {google.monitoring.v3.BasicSli.ILatencyCriteria=} [properties] Properties to set + */ + function LatencyCriteria(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LatencyCriteria threshold. + * @member {google.protobuf.IDuration|null|undefined} threshold + * @memberof google.monitoring.v3.BasicSli.LatencyCriteria + * @instance + */ + LatencyCriteria.prototype.threshold = null; + + /** + * Creates a new LatencyCriteria instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.BasicSli.LatencyCriteria + * @static + * @param {google.monitoring.v3.BasicSli.ILatencyCriteria=} [properties] Properties to set + * @returns {google.monitoring.v3.BasicSli.LatencyCriteria} LatencyCriteria instance + */ + LatencyCriteria.create = function create(properties) { + return new LatencyCriteria(properties); + }; + + /** + * Encodes the specified LatencyCriteria message. Does not implicitly {@link google.monitoring.v3.BasicSli.LatencyCriteria.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.BasicSli.LatencyCriteria + * @static + * @param {google.monitoring.v3.BasicSli.ILatencyCriteria} message LatencyCriteria message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatencyCriteria.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.threshold != null && message.hasOwnProperty("threshold")) + $root.google.protobuf.Duration.encode(message.threshold, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LatencyCriteria message, length delimited. Does not implicitly {@link google.monitoring.v3.BasicSli.LatencyCriteria.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.BasicSli.LatencyCriteria + * @static + * @param {google.monitoring.v3.BasicSli.ILatencyCriteria} message LatencyCriteria message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatencyCriteria.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LatencyCriteria message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.BasicSli.LatencyCriteria + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.BasicSli.LatencyCriteria} LatencyCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatencyCriteria.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.BasicSli.LatencyCriteria(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.threshold = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LatencyCriteria message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.BasicSli.LatencyCriteria + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.BasicSli.LatencyCriteria} LatencyCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatencyCriteria.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LatencyCriteria message. + * @function verify + * @memberof google.monitoring.v3.BasicSli.LatencyCriteria + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LatencyCriteria.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.threshold != null && message.hasOwnProperty("threshold")) { + var error = $root.google.protobuf.Duration.verify(message.threshold); + if (error) + return "threshold." + error; + } + return null; + }; + + /** + * Creates a LatencyCriteria message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.BasicSli.LatencyCriteria + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.BasicSli.LatencyCriteria} LatencyCriteria + */ + LatencyCriteria.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.BasicSli.LatencyCriteria) + return object; + var message = new $root.google.monitoring.v3.BasicSli.LatencyCriteria(); + if (object.threshold != null) { + if (typeof object.threshold !== "object") + throw TypeError(".google.monitoring.v3.BasicSli.LatencyCriteria.threshold: object expected"); + message.threshold = $root.google.protobuf.Duration.fromObject(object.threshold); + } + return message; + }; + + /** + * Creates a plain object from a LatencyCriteria message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.BasicSli.LatencyCriteria + * @static + * @param {google.monitoring.v3.BasicSli.LatencyCriteria} message LatencyCriteria + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LatencyCriteria.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.threshold = null; + if (message.threshold != null && message.hasOwnProperty("threshold")) + object.threshold = $root.google.protobuf.Duration.toObject(message.threshold, options); + return object; + }; + + /** + * Converts this LatencyCriteria to JSON. + * @function toJSON + * @memberof google.monitoring.v3.BasicSli.LatencyCriteria + * @instance + * @returns {Object.} JSON object + */ + LatencyCriteria.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LatencyCriteria; + })(); + + return BasicSli; + })(); + + v3.Range = (function() { + + /** + * Properties of a Range. + * @memberof google.monitoring.v3 + * @interface IRange + * @property {number|null} [min] Range min + * @property {number|null} [max] Range max + */ + + /** + * Constructs a new Range. + * @memberof google.monitoring.v3 + * @classdesc Represents a Range. + * @implements IRange + * @constructor + * @param {google.monitoring.v3.IRange=} [properties] Properties to set + */ + function Range(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Range min. + * @member {number} min + * @memberof google.monitoring.v3.Range + * @instance + */ + Range.prototype.min = 0; + + /** + * Range max. + * @member {number} max + * @memberof google.monitoring.v3.Range + * @instance + */ + Range.prototype.max = 0; + + /** + * Creates a new Range instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.Range + * @static + * @param {google.monitoring.v3.IRange=} [properties] Properties to set + * @returns {google.monitoring.v3.Range} Range instance + */ + Range.create = function create(properties) { + return new Range(properties); + }; + + /** + * Encodes the specified Range message. Does not implicitly {@link google.monitoring.v3.Range.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.Range + * @static + * @param {google.monitoring.v3.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.min != null && message.hasOwnProperty("min")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.min); + if (message.max != null && message.hasOwnProperty("max")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.max); + return writer; + }; + + /** + * Encodes the specified Range message, length delimited. Does not implicitly {@link google.monitoring.v3.Range.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.Range + * @static + * @param {google.monitoring.v3.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Range message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Range(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.min = reader.double(); + break; + case 2: + message.max = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Range message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Range message. + * @function verify + * @memberof google.monitoring.v3.Range + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Range.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.min != null && message.hasOwnProperty("min")) + if (typeof message.min !== "number") + return "min: number expected"; + if (message.max != null && message.hasOwnProperty("max")) + if (typeof message.max !== "number") + return "max: number expected"; + return null; + }; + + /** + * Creates a Range message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.Range + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.Range} Range + */ + Range.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.Range) + return object; + var message = new $root.google.monitoring.v3.Range(); + if (object.min != null) + message.min = Number(object.min); + if (object.max != null) + message.max = Number(object.max); + return message; + }; + + /** + * Creates a plain object from a Range message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.Range + * @static + * @param {google.monitoring.v3.Range} message Range + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Range.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.min = 0; + object.max = 0; + } + if (message.min != null && message.hasOwnProperty("min")) + object.min = options.json && !isFinite(message.min) ? String(message.min) : message.min; + if (message.max != null && message.hasOwnProperty("max")) + object.max = options.json && !isFinite(message.max) ? String(message.max) : message.max; + return object; + }; + + /** + * Converts this Range to JSON. + * @function toJSON + * @memberof google.monitoring.v3.Range + * @instance + * @returns {Object.} JSON object + */ + Range.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Range; + })(); + + v3.RequestBasedSli = (function() { + + /** + * Properties of a RequestBasedSli. + * @memberof google.monitoring.v3 + * @interface IRequestBasedSli + * @property {google.monitoring.v3.ITimeSeriesRatio|null} [goodTotalRatio] RequestBasedSli goodTotalRatio + * @property {google.monitoring.v3.IDistributionCut|null} [distributionCut] RequestBasedSli distributionCut + */ + + /** + * Constructs a new RequestBasedSli. + * @memberof google.monitoring.v3 + * @classdesc Represents a RequestBasedSli. + * @implements IRequestBasedSli + * @constructor + * @param {google.monitoring.v3.IRequestBasedSli=} [properties] Properties to set + */ + function RequestBasedSli(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestBasedSli goodTotalRatio. + * @member {google.monitoring.v3.ITimeSeriesRatio|null|undefined} goodTotalRatio + * @memberof google.monitoring.v3.RequestBasedSli + * @instance + */ + RequestBasedSli.prototype.goodTotalRatio = null; + + /** + * RequestBasedSli distributionCut. + * @member {google.monitoring.v3.IDistributionCut|null|undefined} distributionCut + * @memberof google.monitoring.v3.RequestBasedSli + * @instance + */ + RequestBasedSli.prototype.distributionCut = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RequestBasedSli method. + * @member {"goodTotalRatio"|"distributionCut"|undefined} method + * @memberof google.monitoring.v3.RequestBasedSli + * @instance + */ + Object.defineProperty(RequestBasedSli.prototype, "method", { + get: $util.oneOfGetter($oneOfFields = ["goodTotalRatio", "distributionCut"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RequestBasedSli instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.RequestBasedSli + * @static + * @param {google.monitoring.v3.IRequestBasedSli=} [properties] Properties to set + * @returns {google.monitoring.v3.RequestBasedSli} RequestBasedSli instance + */ + RequestBasedSli.create = function create(properties) { + return new RequestBasedSli(properties); + }; + + /** + * Encodes the specified RequestBasedSli message. Does not implicitly {@link google.monitoring.v3.RequestBasedSli.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.RequestBasedSli + * @static + * @param {google.monitoring.v3.IRequestBasedSli} message RequestBasedSli message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestBasedSli.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.goodTotalRatio != null && message.hasOwnProperty("goodTotalRatio")) + $root.google.monitoring.v3.TimeSeriesRatio.encode(message.goodTotalRatio, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.distributionCut != null && message.hasOwnProperty("distributionCut")) + $root.google.monitoring.v3.DistributionCut.encode(message.distributionCut, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RequestBasedSli message, length delimited. Does not implicitly {@link google.monitoring.v3.RequestBasedSli.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.RequestBasedSli + * @static + * @param {google.monitoring.v3.IRequestBasedSli} message RequestBasedSli message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestBasedSli.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestBasedSli message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.RequestBasedSli + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.RequestBasedSli} RequestBasedSli + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestBasedSli.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.RequestBasedSli(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.goodTotalRatio = $root.google.monitoring.v3.TimeSeriesRatio.decode(reader, reader.uint32()); + break; + case 3: + message.distributionCut = $root.google.monitoring.v3.DistributionCut.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestBasedSli message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.RequestBasedSli + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.RequestBasedSli} RequestBasedSli + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestBasedSli.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestBasedSli message. + * @function verify + * @memberof google.monitoring.v3.RequestBasedSli + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestBasedSli.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.goodTotalRatio != null && message.hasOwnProperty("goodTotalRatio")) { + properties.method = 1; + { + var error = $root.google.monitoring.v3.TimeSeriesRatio.verify(message.goodTotalRatio); + if (error) + return "goodTotalRatio." + error; + } + } + if (message.distributionCut != null && message.hasOwnProperty("distributionCut")) { + if (properties.method === 1) + return "method: multiple values"; + properties.method = 1; + { + var error = $root.google.monitoring.v3.DistributionCut.verify(message.distributionCut); + if (error) + return "distributionCut." + error; + } + } + return null; + }; + + /** + * Creates a RequestBasedSli message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.RequestBasedSli + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.RequestBasedSli} RequestBasedSli + */ + RequestBasedSli.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.RequestBasedSli) + return object; + var message = new $root.google.monitoring.v3.RequestBasedSli(); + if (object.goodTotalRatio != null) { + if (typeof object.goodTotalRatio !== "object") + throw TypeError(".google.monitoring.v3.RequestBasedSli.goodTotalRatio: object expected"); + message.goodTotalRatio = $root.google.monitoring.v3.TimeSeriesRatio.fromObject(object.goodTotalRatio); + } + if (object.distributionCut != null) { + if (typeof object.distributionCut !== "object") + throw TypeError(".google.monitoring.v3.RequestBasedSli.distributionCut: object expected"); + message.distributionCut = $root.google.monitoring.v3.DistributionCut.fromObject(object.distributionCut); + } + return message; + }; + + /** + * Creates a plain object from a RequestBasedSli message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.RequestBasedSli + * @static + * @param {google.monitoring.v3.RequestBasedSli} message RequestBasedSli + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestBasedSli.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.goodTotalRatio != null && message.hasOwnProperty("goodTotalRatio")) { + object.goodTotalRatio = $root.google.monitoring.v3.TimeSeriesRatio.toObject(message.goodTotalRatio, options); + if (options.oneofs) + object.method = "goodTotalRatio"; + } + if (message.distributionCut != null && message.hasOwnProperty("distributionCut")) { + object.distributionCut = $root.google.monitoring.v3.DistributionCut.toObject(message.distributionCut, options); + if (options.oneofs) + object.method = "distributionCut"; + } + return object; + }; + + /** + * Converts this RequestBasedSli to JSON. + * @function toJSON + * @memberof google.monitoring.v3.RequestBasedSli + * @instance + * @returns {Object.} JSON object + */ + RequestBasedSli.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestBasedSli; + })(); + + v3.TimeSeriesRatio = (function() { + + /** + * Properties of a TimeSeriesRatio. + * @memberof google.monitoring.v3 + * @interface ITimeSeriesRatio + * @property {string|null} [goodServiceFilter] TimeSeriesRatio goodServiceFilter + * @property {string|null} [badServiceFilter] TimeSeriesRatio badServiceFilter + * @property {string|null} [totalServiceFilter] TimeSeriesRatio totalServiceFilter + */ + + /** + * Constructs a new TimeSeriesRatio. + * @memberof google.monitoring.v3 + * @classdesc Represents a TimeSeriesRatio. + * @implements ITimeSeriesRatio + * @constructor + * @param {google.monitoring.v3.ITimeSeriesRatio=} [properties] Properties to set + */ + function TimeSeriesRatio(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeSeriesRatio goodServiceFilter. + * @member {string} goodServiceFilter + * @memberof google.monitoring.v3.TimeSeriesRatio + * @instance + */ + TimeSeriesRatio.prototype.goodServiceFilter = ""; + + /** + * TimeSeriesRatio badServiceFilter. + * @member {string} badServiceFilter + * @memberof google.monitoring.v3.TimeSeriesRatio + * @instance + */ + TimeSeriesRatio.prototype.badServiceFilter = ""; + + /** + * TimeSeriesRatio totalServiceFilter. + * @member {string} totalServiceFilter + * @memberof google.monitoring.v3.TimeSeriesRatio + * @instance + */ + TimeSeriesRatio.prototype.totalServiceFilter = ""; + + /** + * Creates a new TimeSeriesRatio instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.TimeSeriesRatio + * @static + * @param {google.monitoring.v3.ITimeSeriesRatio=} [properties] Properties to set + * @returns {google.monitoring.v3.TimeSeriesRatio} TimeSeriesRatio instance + */ + TimeSeriesRatio.create = function create(properties) { + return new TimeSeriesRatio(properties); + }; + + /** + * Encodes the specified TimeSeriesRatio message. Does not implicitly {@link google.monitoring.v3.TimeSeriesRatio.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.TimeSeriesRatio + * @static + * @param {google.monitoring.v3.ITimeSeriesRatio} message TimeSeriesRatio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeSeriesRatio.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.goodServiceFilter != null && message.hasOwnProperty("goodServiceFilter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.goodServiceFilter); + if (message.badServiceFilter != null && message.hasOwnProperty("badServiceFilter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.badServiceFilter); + if (message.totalServiceFilter != null && message.hasOwnProperty("totalServiceFilter")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.totalServiceFilter); + return writer; + }; + + /** + * Encodes the specified TimeSeriesRatio message, length delimited. Does not implicitly {@link google.monitoring.v3.TimeSeriesRatio.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.TimeSeriesRatio + * @static + * @param {google.monitoring.v3.ITimeSeriesRatio} message TimeSeriesRatio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeSeriesRatio.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeSeriesRatio message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.TimeSeriesRatio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.TimeSeriesRatio} TimeSeriesRatio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeSeriesRatio.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.TimeSeriesRatio(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.goodServiceFilter = reader.string(); + break; + case 5: + message.badServiceFilter = reader.string(); + break; + case 6: + message.totalServiceFilter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeSeriesRatio message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.TimeSeriesRatio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.TimeSeriesRatio} TimeSeriesRatio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeSeriesRatio.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeSeriesRatio message. + * @function verify + * @memberof google.monitoring.v3.TimeSeriesRatio + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeSeriesRatio.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.goodServiceFilter != null && message.hasOwnProperty("goodServiceFilter")) + if (!$util.isString(message.goodServiceFilter)) + return "goodServiceFilter: string expected"; + if (message.badServiceFilter != null && message.hasOwnProperty("badServiceFilter")) + if (!$util.isString(message.badServiceFilter)) + return "badServiceFilter: string expected"; + if (message.totalServiceFilter != null && message.hasOwnProperty("totalServiceFilter")) + if (!$util.isString(message.totalServiceFilter)) + return "totalServiceFilter: string expected"; + return null; + }; + + /** + * Creates a TimeSeriesRatio message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.TimeSeriesRatio + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.TimeSeriesRatio} TimeSeriesRatio + */ + TimeSeriesRatio.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.TimeSeriesRatio) + return object; + var message = new $root.google.monitoring.v3.TimeSeriesRatio(); + if (object.goodServiceFilter != null) + message.goodServiceFilter = String(object.goodServiceFilter); + if (object.badServiceFilter != null) + message.badServiceFilter = String(object.badServiceFilter); + if (object.totalServiceFilter != null) + message.totalServiceFilter = String(object.totalServiceFilter); + return message; + }; + + /** + * Creates a plain object from a TimeSeriesRatio message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.TimeSeriesRatio + * @static + * @param {google.monitoring.v3.TimeSeriesRatio} message TimeSeriesRatio + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeSeriesRatio.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.goodServiceFilter = ""; + object.badServiceFilter = ""; + object.totalServiceFilter = ""; + } + if (message.goodServiceFilter != null && message.hasOwnProperty("goodServiceFilter")) + object.goodServiceFilter = message.goodServiceFilter; + if (message.badServiceFilter != null && message.hasOwnProperty("badServiceFilter")) + object.badServiceFilter = message.badServiceFilter; + if (message.totalServiceFilter != null && message.hasOwnProperty("totalServiceFilter")) + object.totalServiceFilter = message.totalServiceFilter; + return object; + }; + + /** + * Converts this TimeSeriesRatio to JSON. + * @function toJSON + * @memberof google.monitoring.v3.TimeSeriesRatio + * @instance + * @returns {Object.} JSON object + */ + TimeSeriesRatio.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TimeSeriesRatio; + })(); + + v3.DistributionCut = (function() { + + /** + * Properties of a DistributionCut. + * @memberof google.monitoring.v3 + * @interface IDistributionCut + * @property {string|null} [distributionFilter] DistributionCut distributionFilter + * @property {google.monitoring.v3.IRange|null} [range] DistributionCut range + */ + + /** + * Constructs a new DistributionCut. + * @memberof google.monitoring.v3 + * @classdesc Represents a DistributionCut. + * @implements IDistributionCut + * @constructor + * @param {google.monitoring.v3.IDistributionCut=} [properties] Properties to set + */ + function DistributionCut(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DistributionCut distributionFilter. + * @member {string} distributionFilter + * @memberof google.monitoring.v3.DistributionCut + * @instance + */ + DistributionCut.prototype.distributionFilter = ""; + + /** + * DistributionCut range. + * @member {google.monitoring.v3.IRange|null|undefined} range + * @memberof google.monitoring.v3.DistributionCut + * @instance + */ + DistributionCut.prototype.range = null; + + /** + * Creates a new DistributionCut instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.DistributionCut + * @static + * @param {google.monitoring.v3.IDistributionCut=} [properties] Properties to set + * @returns {google.monitoring.v3.DistributionCut} DistributionCut instance + */ + DistributionCut.create = function create(properties) { + return new DistributionCut(properties); + }; + + /** + * Encodes the specified DistributionCut message. Does not implicitly {@link google.monitoring.v3.DistributionCut.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.DistributionCut + * @static + * @param {google.monitoring.v3.IDistributionCut} message DistributionCut message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DistributionCut.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.distributionFilter != null && message.hasOwnProperty("distributionFilter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.distributionFilter); + if (message.range != null && message.hasOwnProperty("range")) + $root.google.monitoring.v3.Range.encode(message.range, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DistributionCut message, length delimited. Does not implicitly {@link google.monitoring.v3.DistributionCut.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.DistributionCut + * @static + * @param {google.monitoring.v3.IDistributionCut} message DistributionCut message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DistributionCut.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DistributionCut message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.DistributionCut + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.DistributionCut} DistributionCut + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DistributionCut.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.DistributionCut(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.distributionFilter = reader.string(); + break; + case 5: + message.range = $root.google.monitoring.v3.Range.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DistributionCut message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.DistributionCut + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.DistributionCut} DistributionCut + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DistributionCut.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DistributionCut message. + * @function verify + * @memberof google.monitoring.v3.DistributionCut + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DistributionCut.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.distributionFilter != null && message.hasOwnProperty("distributionFilter")) + if (!$util.isString(message.distributionFilter)) + return "distributionFilter: string expected"; + if (message.range != null && message.hasOwnProperty("range")) { + var error = $root.google.monitoring.v3.Range.verify(message.range); + if (error) + return "range." + error; + } + return null; + }; + + /** + * Creates a DistributionCut message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.DistributionCut + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.DistributionCut} DistributionCut + */ + DistributionCut.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.DistributionCut) + return object; + var message = new $root.google.monitoring.v3.DistributionCut(); + if (object.distributionFilter != null) + message.distributionFilter = String(object.distributionFilter); + if (object.range != null) { + if (typeof object.range !== "object") + throw TypeError(".google.monitoring.v3.DistributionCut.range: object expected"); + message.range = $root.google.monitoring.v3.Range.fromObject(object.range); + } + return message; + }; + + /** + * Creates a plain object from a DistributionCut message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.DistributionCut + * @static + * @param {google.monitoring.v3.DistributionCut} message DistributionCut + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DistributionCut.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.distributionFilter = ""; + object.range = null; + } + if (message.distributionFilter != null && message.hasOwnProperty("distributionFilter")) + object.distributionFilter = message.distributionFilter; + if (message.range != null && message.hasOwnProperty("range")) + object.range = $root.google.monitoring.v3.Range.toObject(message.range, options); + return object; + }; + + /** + * Converts this DistributionCut to JSON. + * @function toJSON + * @memberof google.monitoring.v3.DistributionCut + * @instance + * @returns {Object.} JSON object + */ + DistributionCut.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DistributionCut; + })(); + + v3.WindowsBasedSli = (function() { + + /** + * Properties of a WindowsBasedSli. + * @memberof google.monitoring.v3 + * @interface IWindowsBasedSli + * @property {string|null} [goodBadMetricFilter] WindowsBasedSli goodBadMetricFilter + * @property {google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold|null} [goodTotalRatioThreshold] WindowsBasedSli goodTotalRatioThreshold + * @property {google.monitoring.v3.WindowsBasedSli.IMetricRange|null} [metricMeanInRange] WindowsBasedSli metricMeanInRange + * @property {google.monitoring.v3.WindowsBasedSli.IMetricRange|null} [metricSumInRange] WindowsBasedSli metricSumInRange + * @property {google.protobuf.IDuration|null} [windowPeriod] WindowsBasedSli windowPeriod + */ + + /** + * Constructs a new WindowsBasedSli. + * @memberof google.monitoring.v3 + * @classdesc Represents a WindowsBasedSli. + * @implements IWindowsBasedSli + * @constructor + * @param {google.monitoring.v3.IWindowsBasedSli=} [properties] Properties to set + */ + function WindowsBasedSli(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WindowsBasedSli goodBadMetricFilter. + * @member {string} goodBadMetricFilter + * @memberof google.monitoring.v3.WindowsBasedSli + * @instance + */ + WindowsBasedSli.prototype.goodBadMetricFilter = ""; + + /** + * WindowsBasedSli goodTotalRatioThreshold. + * @member {google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold|null|undefined} goodTotalRatioThreshold + * @memberof google.monitoring.v3.WindowsBasedSli + * @instance + */ + WindowsBasedSli.prototype.goodTotalRatioThreshold = null; + + /** + * WindowsBasedSli metricMeanInRange. + * @member {google.monitoring.v3.WindowsBasedSli.IMetricRange|null|undefined} metricMeanInRange + * @memberof google.monitoring.v3.WindowsBasedSli + * @instance + */ + WindowsBasedSli.prototype.metricMeanInRange = null; + + /** + * WindowsBasedSli metricSumInRange. + * @member {google.monitoring.v3.WindowsBasedSli.IMetricRange|null|undefined} metricSumInRange + * @memberof google.monitoring.v3.WindowsBasedSli + * @instance + */ + WindowsBasedSli.prototype.metricSumInRange = null; + + /** + * WindowsBasedSli windowPeriod. + * @member {google.protobuf.IDuration|null|undefined} windowPeriod + * @memberof google.monitoring.v3.WindowsBasedSli + * @instance + */ + WindowsBasedSli.prototype.windowPeriod = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WindowsBasedSli windowCriterion. + * @member {"goodBadMetricFilter"|"goodTotalRatioThreshold"|"metricMeanInRange"|"metricSumInRange"|undefined} windowCriterion + * @memberof google.monitoring.v3.WindowsBasedSli + * @instance + */ + Object.defineProperty(WindowsBasedSli.prototype, "windowCriterion", { + get: $util.oneOfGetter($oneOfFields = ["goodBadMetricFilter", "goodTotalRatioThreshold", "metricMeanInRange", "metricSumInRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WindowsBasedSli instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.WindowsBasedSli + * @static + * @param {google.monitoring.v3.IWindowsBasedSli=} [properties] Properties to set + * @returns {google.monitoring.v3.WindowsBasedSli} WindowsBasedSli instance + */ + WindowsBasedSli.create = function create(properties) { + return new WindowsBasedSli(properties); + }; + + /** + * Encodes the specified WindowsBasedSli message. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.WindowsBasedSli + * @static + * @param {google.monitoring.v3.IWindowsBasedSli} message WindowsBasedSli message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsBasedSli.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.goodTotalRatioThreshold != null && message.hasOwnProperty("goodTotalRatioThreshold")) + $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.encode(message.goodTotalRatioThreshold, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.windowPeriod != null && message.hasOwnProperty("windowPeriod")) + $root.google.protobuf.Duration.encode(message.windowPeriod, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.goodBadMetricFilter != null && message.hasOwnProperty("goodBadMetricFilter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.goodBadMetricFilter); + if (message.metricMeanInRange != null && message.hasOwnProperty("metricMeanInRange")) + $root.google.monitoring.v3.WindowsBasedSli.MetricRange.encode(message.metricMeanInRange, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.metricSumInRange != null && message.hasOwnProperty("metricSumInRange")) + $root.google.monitoring.v3.WindowsBasedSli.MetricRange.encode(message.metricSumInRange, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WindowsBasedSli message, length delimited. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.WindowsBasedSli + * @static + * @param {google.monitoring.v3.IWindowsBasedSli} message WindowsBasedSli message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsBasedSli.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsBasedSli message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.WindowsBasedSli + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.WindowsBasedSli} WindowsBasedSli + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsBasedSli.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.WindowsBasedSli(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: + message.goodBadMetricFilter = reader.string(); + break; + case 2: + message.goodTotalRatioThreshold = $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.decode(reader, reader.uint32()); + break; + case 6: + message.metricMeanInRange = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.decode(reader, reader.uint32()); + break; + case 7: + message.metricSumInRange = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.decode(reader, reader.uint32()); + break; + case 4: + message.windowPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsBasedSli message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.WindowsBasedSli + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.WindowsBasedSli} WindowsBasedSli + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsBasedSli.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsBasedSli message. + * @function verify + * @memberof google.monitoring.v3.WindowsBasedSli + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowsBasedSli.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.goodBadMetricFilter != null && message.hasOwnProperty("goodBadMetricFilter")) { + properties.windowCriterion = 1; + if (!$util.isString(message.goodBadMetricFilter)) + return "goodBadMetricFilter: string expected"; + } + if (message.goodTotalRatioThreshold != null && message.hasOwnProperty("goodTotalRatioThreshold")) { + if (properties.windowCriterion === 1) + return "windowCriterion: multiple values"; + properties.windowCriterion = 1; + { + var error = $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.verify(message.goodTotalRatioThreshold); + if (error) + return "goodTotalRatioThreshold." + error; + } + } + if (message.metricMeanInRange != null && message.hasOwnProperty("metricMeanInRange")) { + if (properties.windowCriterion === 1) + return "windowCriterion: multiple values"; + properties.windowCriterion = 1; + { + var error = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.verify(message.metricMeanInRange); + if (error) + return "metricMeanInRange." + error; + } + } + if (message.metricSumInRange != null && message.hasOwnProperty("metricSumInRange")) { + if (properties.windowCriterion === 1) + return "windowCriterion: multiple values"; + properties.windowCriterion = 1; + { + var error = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.verify(message.metricSumInRange); + if (error) + return "metricSumInRange." + error; + } + } + if (message.windowPeriod != null && message.hasOwnProperty("windowPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.windowPeriod); + if (error) + return "windowPeriod." + error; + } + return null; + }; + + /** + * Creates a WindowsBasedSli message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.WindowsBasedSli + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.WindowsBasedSli} WindowsBasedSli + */ + WindowsBasedSli.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.WindowsBasedSli) + return object; + var message = new $root.google.monitoring.v3.WindowsBasedSli(); + if (object.goodBadMetricFilter != null) + message.goodBadMetricFilter = String(object.goodBadMetricFilter); + if (object.goodTotalRatioThreshold != null) { + if (typeof object.goodTotalRatioThreshold !== "object") + throw TypeError(".google.monitoring.v3.WindowsBasedSli.goodTotalRatioThreshold: object expected"); + message.goodTotalRatioThreshold = $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.fromObject(object.goodTotalRatioThreshold); + } + if (object.metricMeanInRange != null) { + if (typeof object.metricMeanInRange !== "object") + throw TypeError(".google.monitoring.v3.WindowsBasedSli.metricMeanInRange: object expected"); + message.metricMeanInRange = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.fromObject(object.metricMeanInRange); + } + if (object.metricSumInRange != null) { + if (typeof object.metricSumInRange !== "object") + throw TypeError(".google.monitoring.v3.WindowsBasedSli.metricSumInRange: object expected"); + message.metricSumInRange = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.fromObject(object.metricSumInRange); + } + if (object.windowPeriod != null) { + if (typeof object.windowPeriod !== "object") + throw TypeError(".google.monitoring.v3.WindowsBasedSli.windowPeriod: object expected"); + message.windowPeriod = $root.google.protobuf.Duration.fromObject(object.windowPeriod); + } + return message; + }; + + /** + * Creates a plain object from a WindowsBasedSli message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.WindowsBasedSli + * @static + * @param {google.monitoring.v3.WindowsBasedSli} message WindowsBasedSli + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowsBasedSli.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.windowPeriod = null; + if (message.goodTotalRatioThreshold != null && message.hasOwnProperty("goodTotalRatioThreshold")) { + object.goodTotalRatioThreshold = $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.toObject(message.goodTotalRatioThreshold, options); + if (options.oneofs) + object.windowCriterion = "goodTotalRatioThreshold"; + } + if (message.windowPeriod != null && message.hasOwnProperty("windowPeriod")) + object.windowPeriod = $root.google.protobuf.Duration.toObject(message.windowPeriod, options); + if (message.goodBadMetricFilter != null && message.hasOwnProperty("goodBadMetricFilter")) { + object.goodBadMetricFilter = message.goodBadMetricFilter; + if (options.oneofs) + object.windowCriterion = "goodBadMetricFilter"; + } + if (message.metricMeanInRange != null && message.hasOwnProperty("metricMeanInRange")) { + object.metricMeanInRange = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.toObject(message.metricMeanInRange, options); + if (options.oneofs) + object.windowCriterion = "metricMeanInRange"; + } + if (message.metricSumInRange != null && message.hasOwnProperty("metricSumInRange")) { + object.metricSumInRange = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.toObject(message.metricSumInRange, options); + if (options.oneofs) + object.windowCriterion = "metricSumInRange"; + } + return object; + }; + + /** + * Converts this WindowsBasedSli to JSON. + * @function toJSON + * @memberof google.monitoring.v3.WindowsBasedSli + * @instance + * @returns {Object.} JSON object + */ + WindowsBasedSli.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + WindowsBasedSli.PerformanceThreshold = (function() { + + /** + * Properties of a PerformanceThreshold. + * @memberof google.monitoring.v3.WindowsBasedSli + * @interface IPerformanceThreshold + * @property {google.monitoring.v3.IRequestBasedSli|null} [performance] PerformanceThreshold performance + * @property {google.monitoring.v3.IBasicSli|null} [basicSliPerformance] PerformanceThreshold basicSliPerformance + * @property {number|null} [threshold] PerformanceThreshold threshold + */ + + /** + * Constructs a new PerformanceThreshold. + * @memberof google.monitoring.v3.WindowsBasedSli + * @classdesc Represents a PerformanceThreshold. + * @implements IPerformanceThreshold + * @constructor + * @param {google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold=} [properties] Properties to set + */ + function PerformanceThreshold(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PerformanceThreshold performance. + * @member {google.monitoring.v3.IRequestBasedSli|null|undefined} performance + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + * @instance + */ + PerformanceThreshold.prototype.performance = null; + + /** + * PerformanceThreshold basicSliPerformance. + * @member {google.monitoring.v3.IBasicSli|null|undefined} basicSliPerformance + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + * @instance + */ + PerformanceThreshold.prototype.basicSliPerformance = null; + + /** + * PerformanceThreshold threshold. + * @member {number} threshold + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + * @instance + */ + PerformanceThreshold.prototype.threshold = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PerformanceThreshold type. + * @member {"performance"|"basicSliPerformance"|undefined} type + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + * @instance + */ + Object.defineProperty(PerformanceThreshold.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["performance", "basicSliPerformance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PerformanceThreshold instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + * @static + * @param {google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold=} [properties] Properties to set + * @returns {google.monitoring.v3.WindowsBasedSli.PerformanceThreshold} PerformanceThreshold instance + */ + PerformanceThreshold.create = function create(properties) { + return new PerformanceThreshold(properties); + }; + + /** + * Encodes the specified PerformanceThreshold message. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + * @static + * @param {google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold} message PerformanceThreshold message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PerformanceThreshold.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.performance != null && message.hasOwnProperty("performance")) + $root.google.monitoring.v3.RequestBasedSli.encode(message.performance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.threshold != null && message.hasOwnProperty("threshold")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.threshold); + if (message.basicSliPerformance != null && message.hasOwnProperty("basicSliPerformance")) + $root.google.monitoring.v3.BasicSli.encode(message.basicSliPerformance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PerformanceThreshold message, length delimited. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + * @static + * @param {google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold} message PerformanceThreshold message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PerformanceThreshold.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PerformanceThreshold message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.WindowsBasedSli.PerformanceThreshold} PerformanceThreshold + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PerformanceThreshold.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.performance = $root.google.monitoring.v3.RequestBasedSli.decode(reader, reader.uint32()); + break; + case 3: + message.basicSliPerformance = $root.google.monitoring.v3.BasicSli.decode(reader, reader.uint32()); + break; + case 2: + message.threshold = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PerformanceThreshold message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.WindowsBasedSli.PerformanceThreshold} PerformanceThreshold + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PerformanceThreshold.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PerformanceThreshold message. + * @function verify + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PerformanceThreshold.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.performance != null && message.hasOwnProperty("performance")) { + properties.type = 1; + { + var error = $root.google.monitoring.v3.RequestBasedSli.verify(message.performance); + if (error) + return "performance." + error; + } + } + if (message.basicSliPerformance != null && message.hasOwnProperty("basicSliPerformance")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.monitoring.v3.BasicSli.verify(message.basicSliPerformance); + if (error) + return "basicSliPerformance." + error; + } + } + if (message.threshold != null && message.hasOwnProperty("threshold")) + if (typeof message.threshold !== "number") + return "threshold: number expected"; + return null; + }; + + /** + * Creates a PerformanceThreshold message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.WindowsBasedSli.PerformanceThreshold} PerformanceThreshold + */ + PerformanceThreshold.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold) + return object; + var message = new $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold(); + if (object.performance != null) { + if (typeof object.performance !== "object") + throw TypeError(".google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.performance: object expected"); + message.performance = $root.google.monitoring.v3.RequestBasedSli.fromObject(object.performance); + } + if (object.basicSliPerformance != null) { + if (typeof object.basicSliPerformance !== "object") + throw TypeError(".google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.basicSliPerformance: object expected"); + message.basicSliPerformance = $root.google.monitoring.v3.BasicSli.fromObject(object.basicSliPerformance); + } + if (object.threshold != null) + message.threshold = Number(object.threshold); + return message; + }; + + /** + * Creates a plain object from a PerformanceThreshold message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + * @static + * @param {google.monitoring.v3.WindowsBasedSli.PerformanceThreshold} message PerformanceThreshold + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PerformanceThreshold.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.threshold = 0; + if (message.performance != null && message.hasOwnProperty("performance")) { + object.performance = $root.google.monitoring.v3.RequestBasedSli.toObject(message.performance, options); + if (options.oneofs) + object.type = "performance"; + } + if (message.threshold != null && message.hasOwnProperty("threshold")) + object.threshold = options.json && !isFinite(message.threshold) ? String(message.threshold) : message.threshold; + if (message.basicSliPerformance != null && message.hasOwnProperty("basicSliPerformance")) { + object.basicSliPerformance = $root.google.monitoring.v3.BasicSli.toObject(message.basicSliPerformance, options); + if (options.oneofs) + object.type = "basicSliPerformance"; + } + return object; + }; + + /** + * Converts this PerformanceThreshold to JSON. + * @function toJSON + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + * @instance + * @returns {Object.} JSON object + */ + PerformanceThreshold.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PerformanceThreshold; + })(); + + WindowsBasedSli.MetricRange = (function() { + + /** + * Properties of a MetricRange. + * @memberof google.monitoring.v3.WindowsBasedSli + * @interface IMetricRange + * @property {string|null} [timeSeries] MetricRange timeSeries + * @property {google.monitoring.v3.IRange|null} [range] MetricRange range + */ + + /** + * Constructs a new MetricRange. + * @memberof google.monitoring.v3.WindowsBasedSli + * @classdesc Represents a MetricRange. + * @implements IMetricRange + * @constructor + * @param {google.monitoring.v3.WindowsBasedSli.IMetricRange=} [properties] Properties to set + */ + function MetricRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetricRange timeSeries. + * @member {string} timeSeries + * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange + * @instance + */ + MetricRange.prototype.timeSeries = ""; + + /** + * MetricRange range. + * @member {google.monitoring.v3.IRange|null|undefined} range + * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange + * @instance + */ + MetricRange.prototype.range = null; + + /** + * Creates a new MetricRange instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange + * @static + * @param {google.monitoring.v3.WindowsBasedSli.IMetricRange=} [properties] Properties to set + * @returns {google.monitoring.v3.WindowsBasedSli.MetricRange} MetricRange instance + */ + MetricRange.create = function create(properties) { + return new MetricRange(properties); + }; + + /** + * Encodes the specified MetricRange message. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.MetricRange.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange + * @static + * @param {google.monitoring.v3.WindowsBasedSli.IMetricRange} message MetricRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.timeSeries); + if (message.range != null && message.hasOwnProperty("range")) + $root.google.monitoring.v3.Range.encode(message.range, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MetricRange message, length delimited. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.MetricRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange + * @static + * @param {google.monitoring.v3.WindowsBasedSli.IMetricRange} message MetricRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricRange message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.WindowsBasedSli.MetricRange} MetricRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.WindowsBasedSli.MetricRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.timeSeries = reader.string(); + break; + case 4: + message.range = $root.google.monitoring.v3.Range.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.WindowsBasedSli.MetricRange} MetricRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricRange message. + * @function verify + * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) + if (!$util.isString(message.timeSeries)) + return "timeSeries: string expected"; + if (message.range != null && message.hasOwnProperty("range")) { + var error = $root.google.monitoring.v3.Range.verify(message.range); + if (error) + return "range." + error; + } + return null; + }; + + /** + * Creates a MetricRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.WindowsBasedSli.MetricRange} MetricRange + */ + MetricRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.WindowsBasedSli.MetricRange) + return object; + var message = new $root.google.monitoring.v3.WindowsBasedSli.MetricRange(); + if (object.timeSeries != null) + message.timeSeries = String(object.timeSeries); + if (object.range != null) { + if (typeof object.range !== "object") + throw TypeError(".google.monitoring.v3.WindowsBasedSli.MetricRange.range: object expected"); + message.range = $root.google.monitoring.v3.Range.fromObject(object.range); + } + return message; + }; + + /** + * Creates a plain object from a MetricRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange + * @static + * @param {google.monitoring.v3.WindowsBasedSli.MetricRange} message MetricRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.timeSeries = ""; + object.range = null; + } + if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) + object.timeSeries = message.timeSeries; + if (message.range != null && message.hasOwnProperty("range")) + object.range = $root.google.monitoring.v3.Range.toObject(message.range, options); + return object; + }; + + /** + * Converts this MetricRange to JSON. + * @function toJSON + * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange + * @instance + * @returns {Object.} JSON object + */ + MetricRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MetricRange; + })(); + + return WindowsBasedSli; + })(); + v3.UptimeCheckService = (function() { /** @@ -36547,6 +44091,44 @@ return rpc; })(); + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + /** + * CalendarPeriod enum. + * @name google.type.CalendarPeriod + * @enum {string} + * @property {number} CALENDAR_PERIOD_UNSPECIFIED=0 CALENDAR_PERIOD_UNSPECIFIED value + * @property {number} DAY=1 DAY value + * @property {number} WEEK=2 WEEK value + * @property {number} FORTNIGHT=3 FORTNIGHT value + * @property {number} MONTH=4 MONTH value + * @property {number} QUARTER=5 QUARTER value + * @property {number} HALF=6 HALF value + * @property {number} YEAR=7 YEAR value + */ + type.CalendarPeriod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CALENDAR_PERIOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "DAY"] = 1; + values[valuesById[2] = "WEEK"] = 2; + values[valuesById[3] = "FORTNIGHT"] = 3; + values[valuesById[4] = "MONTH"] = 4; + values[valuesById[5] = "QUARTER"] = 5; + values[valuesById[6] = "HALF"] = 6; + values[valuesById[7] = "YEAR"] = 7; + return values; + })(); + + return type; + })(); + return google; })(); diff --git a/packages/google-cloud-monitoring/protos/protos.json b/packages/google-cloud-monitoring/protos/protos.json index 150edcdf26b..57bebf5ff94 100644 --- a/packages/google-cloud-monitoring/protos/protos.json +++ b/packages/google-cloud-monitoring/protos/protos.json @@ -1294,6 +1294,591 @@ } } }, + "ServiceMonitoringService": { + "options": { + "(google.api.default_host)": "monitoring.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.read" + }, + "methods": { + "CreateService": { + "requestType": "CreateServiceRequest", + "responseType": "Service", + "options": { + "(google.api.http).post": "/v3/{parent=*/*}/services", + "(google.api.http).body": "service" + } + }, + "GetService": { + "requestType": "GetServiceRequest", + "responseType": "Service", + "options": { + "(google.api.http).get": "/v3/{name=*/*/services/*}" + } + }, + "ListServices": { + "requestType": "ListServicesRequest", + "responseType": "ListServicesResponse", + "options": { + "(google.api.http).get": "/v3/{parent=*/*}/services" + } + }, + "UpdateService": { + "requestType": "UpdateServiceRequest", + "responseType": "Service", + "options": { + "(google.api.http).patch": "/v3/{service.name=*/*/services/*}", + "(google.api.http).body": "service" + } + }, + "DeleteService": { + "requestType": "DeleteServiceRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3/{name=*/*/services/*}" + } + }, + "CreateServiceLevelObjective": { + "requestType": "CreateServiceLevelObjectiveRequest", + "responseType": "ServiceLevelObjective", + "options": { + "(google.api.http).post": "/v3/{parent=*/*/services/*}/serviceLevelObjectives", + "(google.api.http).body": "service_level_objective" + } + }, + "GetServiceLevelObjective": { + "requestType": "GetServiceLevelObjectiveRequest", + "responseType": "ServiceLevelObjective", + "options": { + "(google.api.http).get": "/v3/{name=*/*/services/*/serviceLevelObjectives/*}" + } + }, + "ListServiceLevelObjectives": { + "requestType": "ListServiceLevelObjectivesRequest", + "responseType": "ListServiceLevelObjectivesResponse", + "options": { + "(google.api.http).get": "/v3/{parent=*/*/services/*}/serviceLevelObjectives" + } + }, + "UpdateServiceLevelObjective": { + "requestType": "UpdateServiceLevelObjectiveRequest", + "responseType": "ServiceLevelObjective", + "options": { + "(google.api.http).patch": "/v3/{service_level_objective.name=*/*/services/*/serviceLevelObjectives/*}", + "(google.api.http).body": "service_level_objective" + } + }, + "DeleteServiceLevelObjective": { + "requestType": "DeleteServiceLevelObjectiveRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3/{name=*/*/services/*/serviceLevelObjectives/*}" + } + } + } + }, + "CreateServiceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "serviceId": { + "type": "string", + "id": 3 + }, + "service": { + "type": "Service", + "id": 2 + } + } + }, + "GetServiceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListServicesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListServicesResponse": { + "fields": { + "services": { + "rule": "repeated", + "type": "Service", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateServiceRequest": { + "fields": { + "service": { + "type": "Service", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteServiceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "CreateServiceLevelObjectiveRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "serviceLevelObjectiveId": { + "type": "string", + "id": 3 + }, + "serviceLevelObjective": { + "type": "ServiceLevelObjective", + "id": 2 + } + } + }, + "GetServiceLevelObjectiveRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "view": { + "type": "ServiceLevelObjective.View", + "id": 2 + } + } + }, + "ListServiceLevelObjectivesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + }, + "view": { + "type": "ServiceLevelObjective.View", + "id": 5 + } + } + }, + "ListServiceLevelObjectivesResponse": { + "fields": { + "serviceLevelObjectives": { + "rule": "repeated", + "type": "ServiceLevelObjective", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateServiceLevelObjectiveRequest": { + "fields": { + "serviceLevelObjective": { + "type": "ServiceLevelObjective", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteServiceLevelObjectiveRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "Service": { + "oneofs": { + "identifier": { + "oneof": [ + "custom", + "appEngine", + "cloudEndpoints", + "clusterIstio" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "custom": { + "type": "Custom", + "id": 6 + }, + "appEngine": { + "type": "AppEngine", + "id": 7 + }, + "cloudEndpoints": { + "type": "CloudEndpoints", + "id": 8 + }, + "clusterIstio": { + "type": "ClusterIstio", + "id": 9 + }, + "telemetry": { + "type": "Telemetry", + "id": 13 + } + }, + "nested": { + "Custom": { + "fields": {} + }, + "AppEngine": { + "fields": { + "moduleId": { + "type": "string", + "id": 1 + } + } + }, + "CloudEndpoints": { + "fields": { + "service": { + "type": "string", + "id": 1 + } + } + }, + "ClusterIstio": { + "fields": { + "location": { + "type": "string", + "id": 1 + }, + "clusterName": { + "type": "string", + "id": 2 + }, + "serviceNamespace": { + "type": "string", + "id": 3 + }, + "serviceName": { + "type": "string", + "id": 4 + } + } + }, + "Telemetry": { + "fields": { + "resourceName": { + "type": "string", + "id": 1 + } + } + } + } + }, + "ServiceLevelObjective": { + "oneofs": { + "period": { + "oneof": [ + "rollingPeriod", + "calendarPeriod" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 11 + }, + "serviceLevelIndicator": { + "type": "ServiceLevelIndicator", + "id": 3 + }, + "goal": { + "type": "double", + "id": 4 + }, + "rollingPeriod": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "calendarPeriod": { + "type": "google.type.CalendarPeriod", + "id": 6 + } + }, + "nested": { + "View": { + "values": { + "VIEW_UNSPECIFIED": 0, + "FULL": 2, + "EXPLICIT": 1 + } + } + } + }, + "ServiceLevelIndicator": { + "oneofs": { + "type": { + "oneof": [ + "basicSli", + "requestBased", + "windowsBased" + ] + } + }, + "fields": { + "basicSli": { + "type": "BasicSli", + "id": 4 + }, + "requestBased": { + "type": "RequestBasedSli", + "id": 1 + }, + "windowsBased": { + "type": "WindowsBasedSli", + "id": 2 + } + } + }, + "BasicSli": { + "oneofs": { + "sliCriteria": { + "oneof": [ + "availability", + "latency" + ] + } + }, + "fields": { + "method": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "location": { + "rule": "repeated", + "type": "string", + "id": 8 + }, + "version": { + "rule": "repeated", + "type": "string", + "id": 9 + }, + "availability": { + "type": "AvailabilityCriteria", + "id": 2 + }, + "latency": { + "type": "LatencyCriteria", + "id": 3 + } + }, + "nested": { + "AvailabilityCriteria": { + "fields": {} + }, + "LatencyCriteria": { + "fields": { + "threshold": { + "type": "google.protobuf.Duration", + "id": 3 + } + } + } + } + }, + "Range": { + "fields": { + "min": { + "type": "double", + "id": 1 + }, + "max": { + "type": "double", + "id": 2 + } + } + }, + "RequestBasedSli": { + "oneofs": { + "method": { + "oneof": [ + "goodTotalRatio", + "distributionCut" + ] + } + }, + "fields": { + "goodTotalRatio": { + "type": "TimeSeriesRatio", + "id": 1 + }, + "distributionCut": { + "type": "DistributionCut", + "id": 3 + } + } + }, + "TimeSeriesRatio": { + "fields": { + "goodServiceFilter": { + "type": "string", + "id": 4 + }, + "badServiceFilter": { + "type": "string", + "id": 5 + }, + "totalServiceFilter": { + "type": "string", + "id": 6 + } + } + }, + "DistributionCut": { + "fields": { + "distributionFilter": { + "type": "string", + "id": 4 + }, + "range": { + "type": "Range", + "id": 5 + } + } + }, + "WindowsBasedSli": { + "oneofs": { + "windowCriterion": { + "oneof": [ + "goodBadMetricFilter", + "goodTotalRatioThreshold", + "metricMeanInRange", + "metricSumInRange" + ] + } + }, + "fields": { + "goodBadMetricFilter": { + "type": "string", + "id": 5 + }, + "goodTotalRatioThreshold": { + "type": "PerformanceThreshold", + "id": 2 + }, + "metricMeanInRange": { + "type": "MetricRange", + "id": 6 + }, + "metricSumInRange": { + "type": "MetricRange", + "id": 7 + }, + "windowPeriod": { + "type": "google.protobuf.Duration", + "id": 4 + } + }, + "nested": { + "PerformanceThreshold": { + "oneofs": { + "type": { + "oneof": [ + "performance", + "basicSliPerformance" + ] + } + }, + "fields": { + "performance": { + "type": "RequestBasedSli", + "id": 1 + }, + "basicSliPerformance": { + "type": "BasicSli", + "id": 3 + }, + "threshold": { + "type": "double", + "id": 2 + } + } + }, + "MetricRange": { + "fields": { + "timeSeries": { + "type": "string", + "id": 1 + }, + "range": { + "type": "Range", + "id": 4 + } + } + } + } + }, "UptimeCheckService": { "options": { "(google.api.default_host)": "monitoring.googleapis.com", @@ -3185,6 +3770,29 @@ } } } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/calendarperiod;calendarperiod", + "java_multiple_files": true, + "java_outer_classname": "CalendarPeriodProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "CalendarPeriod": { + "values": { + "CALENDAR_PERIOD_UNSPECIFIED": 0, + "DAY": 1, + "WEEK": 2, + "FORTNIGHT": 3, + "MONTH": 4, + "QUARTER": 5, + "HALF": 6, + "YEAR": 7 + } + } + } } } } diff --git a/packages/google-cloud-monitoring/src/v3/alert_policy_service_client_config.json b/packages/google-cloud-monitoring/src/v3/alert_policy_service_client_config.json index de7fdbc0fdc..d6101ccaae8 100644 --- a/packages/google-cloud-monitoring/src/v3/alert_policy_service_client_config.json +++ b/packages/google-cloud-monitoring/src/v3/alert_policy_service_client_config.json @@ -21,27 +21,27 @@ }, "methods": { "ListAlertPolicies": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetAlertPolicy": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "CreateAlertPolicy": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteAlertPolicy": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "UpdateAlertPolicy": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-monitoring/src/v3/doc/google/monitoring/v3/doc_service.js b/packages/google-cloud-monitoring/src/v3/doc/google/monitoring/v3/doc_service.js new file mode 100644 index 00000000000..22da60afed1 --- /dev/null +++ b/packages/google-cloud-monitoring/src/v3/doc/google/monitoring/v3/doc_service.js @@ -0,0 +1,539 @@ +// 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 +// +// https://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 purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * A `Service` is a discrete, autonomous, and network-accessible unit, designed + * to solve an individual concern + * ([Wikipedia](https://en.wikipedia.org/wiki/Service-orientation)). In + * Stackdriver Monitoring, a `Service` acts as the root resource under which + * operational aspects of the service are accessible. + * + * @property {string} name + * Resource name for this Service. Of the form + * `projects/{project_id}/services/{service_id}`. + * + * @property {string} displayName + * Name used for UI elements listing this Service. + * + * @property {Object} custom + * Custom service type. + * + * This object should have the same structure as [Custom]{@link google.monitoring.v3.Custom} + * + * @property {Object} appEngine + * Type used for App Engine services. + * + * This object should have the same structure as [AppEngine]{@link google.monitoring.v3.AppEngine} + * + * @property {Object} cloudEndpoints + * Type used for Cloud Endpoints services. + * + * This object should have the same structure as [CloudEndpoints]{@link google.monitoring.v3.CloudEndpoints} + * + * @property {Object} clusterIstio + * Type used for Istio services that live in a Kubernetes cluster. + * + * This object should have the same structure as [ClusterIstio]{@link google.monitoring.v3.ClusterIstio} + * + * @property {Object} telemetry + * Configuration for how to query telemetry on a Service. + * + * This object should have the same structure as [Telemetry]{@link google.monitoring.v3.Telemetry} + * + * @typedef Service + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.Service definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} + */ +const Service = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * Custom view of service telemetry. Currently a place-holder pending final + * design. + * @typedef Custom + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.Service.Custom definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} + */ + Custom: { + // This is for documentation. Actual contents will be loaded by gRPC. + }, + + /** + * App Engine service. Learn more at https://cloud.google.com/appengine. + * + * @property {string} moduleId + * The ID of the App Engine module underlying this service. Corresponds to + * the `module_id` resource label in the `gae_app` monitored resource: + * https://cloud.google.com/monitoring/api/resources#tag_gae_app + * + * @typedef AppEngine + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.Service.AppEngine definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} + */ + AppEngine: { + // This is for documentation. Actual contents will be loaded by gRPC. + }, + + /** + * Cloud Endpoints service. Learn more at https://cloud.google.com/endpoints. + * + * @property {string} service + * The name of the Cloud Endpoints service underlying this service. + * Corresponds to the `service` resource label in the `api` monitored + * resource: https://cloud.google.com/monitoring/api/resources#tag_api + * + * @typedef CloudEndpoints + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.Service.CloudEndpoints definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} + */ + CloudEndpoints: { + // This is for documentation. Actual contents will be loaded by gRPC. + }, + + /** + * Istio service. Learn more at http://istio.io. + * + * @property {string} location + * The location of the Kubernetes cluster in which this Istio service is + * defined. Corresponds to the `location` resource label in `k8s_cluster` + * resources. + * + * @property {string} clusterName + * The name of the Kubernetes cluster in which this Istio service is + * defined. Corresponds to the `cluster_name` resource label in + * `k8s_cluster` resources. + * + * @property {string} serviceNamespace + * The namespace of the Istio service underlying this service. Corresponds + * to the `destination_service_namespace` metric label in Istio metrics. + * + * @property {string} serviceName + * The name of the Istio service underlying this service. Corresponds to the + * `destination_service_name` metric label in Istio metrics. + * + * @typedef ClusterIstio + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.Service.ClusterIstio definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} + */ + ClusterIstio: { + // This is for documentation. Actual contents will be loaded by gRPC. + }, + + /** + * Configuration for how to query telemetry on a Service. + * + * @property {string} resourceName + * The full name of the resource that defines this service. Formatted as + * described in https://cloud.google.com/apis/design/resource_names. + * + * @typedef Telemetry + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.Service.Telemetry definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} + */ + Telemetry: { + // This is for documentation. Actual contents will be loaded by gRPC. + } +}; + +/** + * A Service-Level Objective (SLO) describes a level of desired good service. It + * consists of a service-level indicator (SLI), a performance goal, and a period + * over which the objective is to be evaluated against that goal. The SLO can + * use SLIs defined in a number of different manners. Typical SLOs might include + * "99% of requests in each rolling week have latency below 200 milliseconds" or + * "99.5% of requests in each calendar month return successfully." + * + * @property {string} name + * Resource name for this `ServiceLevelObjective`. + * Of the form + * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. + * + * @property {string} displayName + * Name used for UI elements listing this SLO. + * + * @property {Object} serviceLevelIndicator + * The definition of good service, used to measure and calculate the quality + * of the `Service`'s performance with respect to a single aspect of service + * quality. + * + * This object should have the same structure as [ServiceLevelIndicator]{@link google.monitoring.v3.ServiceLevelIndicator} + * + * @property {number} goal + * The fraction of service that must be good in order for this objective to be + * met. `0 < goal <= 1`. + * + * @property {Object} rollingPeriod + * A rolling time period, semantically "in the past ``". + * Must be an integer multiple of 1 day no larger than 30 days. + * + * This object should have the same structure as [Duration]{@link google.protobuf.Duration} + * + * @property {number} calendarPeriod + * A calendar period, semantically "since the start of the current + * ``". At this time, only `DAY`, `WEEK`, `FORTNIGHT`, and + * `MONTH` are supported. + * + * The number should be among the values of [CalendarPeriod]{@link google.type.CalendarPeriod} + * + * @typedef ServiceLevelObjective + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.ServiceLevelObjective definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} + */ +const ServiceLevelObjective = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * `ServiceLevelObjective.View` determines what form of + * `ServiceLevelObjective` is returned from `GetServiceLevelObjective`, + * `ListServiceLevelObjectives`, and `ListServiceLevelObjectiveVersions` RPCs. + * + * @enum {number} + * @memberof google.monitoring.v3 + */ + View: { + + /** + * Same as FULL. + */ + VIEW_UNSPECIFIED: 0, + + /** + * Return the embedded `ServiceLevelIndicator` in the form in which it was + * defined. If it was defined using a `BasicSli`, return that `BasicSli`. + */ + FULL: 2, + + /** + * For `ServiceLevelIndicator`s using `BasicSli` articulation, instead + * return the `ServiceLevelIndicator` with its mode of computation fully + * spelled out as a `RequestBasedSli`. For `ServiceLevelIndicator`s using + * `RequestBasedSli` or `WindowsBasedSli`, return the + * `ServiceLevelIndicator` as it was provided. + */ + EXPLICIT: 1 + } +}; + +/** + * A Service-Level Indicator (SLI) describes the "performance" of a service. For + * some services, the SLI is well-defined. In such cases, the SLI can be + * described easily by referencing the well-known SLI and providing the needed + * parameters. Alternatively, a "custom" SLI can be defined with a query to the + * underlying metric store. An SLI is defined to be `good_service / + * total_service` over any queried time interval. The value of performance + * always falls into the range `0 <= performance <= 1`. A custom SLI describes + * how to compute this ratio, whether this is by dividing values from a pair of + * time series, cutting a `Distribution` into good and bad counts, or counting + * time windows in which the service complies with a criterion. For separation + * of concerns, a single Service-Level Indicator measures performance for only + * one aspect of service quality, such as fraction of successful queries or + * fast-enough queries. + * + * @property {Object} basicSli + * Basic SLI on a well-known service type. + * + * This object should have the same structure as [BasicSli]{@link google.monitoring.v3.BasicSli} + * + * @property {Object} requestBased + * Request-based SLIs + * + * This object should have the same structure as [RequestBasedSli]{@link google.monitoring.v3.RequestBasedSli} + * + * @property {Object} windowsBased + * Windows-based SLIs + * + * This object should have the same structure as [WindowsBasedSli]{@link google.monitoring.v3.WindowsBasedSli} + * + * @typedef ServiceLevelIndicator + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.ServiceLevelIndicator definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} + */ +const ServiceLevelIndicator = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * An SLI measuring performance on a well-known service type. Performance will + * be computed on the basis of pre-defined metrics. The type of the + * `service_resource` determines the metrics to use and the + * `service_resource.labels` and `metric_labels` are used to construct a + * monitoring filter to filter that metric down to just the data relevant to + * this service. + * + * @property {string[]} method + * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from + * other methods will not be used to calculate performance for this SLI. If + * omitted, this SLI applies to all the Service's methods. For service types + * that don't support breaking down by method, setting this field will result + * in an error. + * + * @property {string[]} location + * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry + * from other locations will not be used to calculate performance for this + * SLI. If omitted, this SLI applies to all locations in which the Service has + * activity. For service types that don't support breaking down by location, + * setting this field will result in an error. + * + * @property {string[]} version + * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry + * from other API versions will not be used to calculate performance for this + * SLI. If omitted, this SLI applies to all API versions. For service types + * that don't support breaking down by version, setting this field will result + * in an error. + * + * @property {Object} availability + * Good service is defined to be the count of requests made to this service + * that return successfully. + * + * This object should have the same structure as [AvailabilityCriteria]{@link google.monitoring.v3.AvailabilityCriteria} + * + * @property {Object} latency + * Good service is defined to be the count of requests made to this service + * that are fast enough with respect to `latency.threshold`. + * + * This object should have the same structure as [LatencyCriteria]{@link google.monitoring.v3.LatencyCriteria} + * + * @typedef BasicSli + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.BasicSli definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} + */ +const BasicSli = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * Future parameters for the availability SLI. + * @typedef AvailabilityCriteria + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.BasicSli.AvailabilityCriteria definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} + */ + AvailabilityCriteria: { + // This is for documentation. Actual contents will be loaded by gRPC. + }, + + /** + * Parameters for a latency threshold SLI. + * + * @property {Object} threshold + * Good service is defined to be the count of requests made to this service + * that return in no more than `threshold`. + * + * This object should have the same structure as [Duration]{@link google.protobuf.Duration} + * + * @typedef LatencyCriteria + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.BasicSli.LatencyCriteria definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} + */ + LatencyCriteria: { + // This is for documentation. Actual contents will be loaded by gRPC. + } +}; + +/** + * Range of numerical values, inclusive of `min` and exclusive of `max`. If the + * open range "< range.max" is desired, set `range.min = -infinity`. If the open + * range ">= range.min" is desired, set `range.max = infinity`. + * + * @property {number} min + * Range minimum. + * + * @property {number} max + * Range maximum. + * + * @typedef Range + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.Range definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} + */ +const Range = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Service Level Indicators for which atomic units of service are counted + * directly. + * + * @property {Object} goodTotalRatio + * `good_total_ratio` is used when the ratio of `good_service` to + * `total_service` is computed from two `TimeSeries`. + * + * This object should have the same structure as [TimeSeriesRatio]{@link google.monitoring.v3.TimeSeriesRatio} + * + * @property {Object} distributionCut + * `distribution_cut` is used when `good_service` is a count of values + * aggregated in a `Distribution` that fall into a good range. The + * `total_service` is the total count of all values aggregated in the + * `Distribution`. + * + * This object should have the same structure as [DistributionCut]{@link google.monitoring.v3.DistributionCut} + * + * @typedef RequestBasedSli + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.RequestBasedSli definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} + */ +const RequestBasedSli = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * A `TimeSeriesRatio` specifies two `TimeSeries` to use for computing the + * `good_service / total_service` ratio. The specified `TimeSeries` must have + * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = + * DELTA` or `MetricKind = CUMULATIVE`. The `TimeSeriesRatio` must specify + * exactly two of good, bad, and total, and the relationship `good_service + + * bad_service = total_service` will be assumed. + * + * @property {string} goodServiceFilter + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` quantifying good service provided. Must have + * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = + * DELTA` or `MetricKind = CUMULATIVE`. + * + * @property {string} badServiceFilter + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` quantifying bad service, either demanded service + * that was not provided or demanded service that was of inadequate quality. + * Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have + * `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. + * + * @property {string} totalServiceFilter + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` quantifying total demanded service. Must have + * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = + * DELTA` or `MetricKind = CUMULATIVE`. + * + * @typedef TimeSeriesRatio + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.TimeSeriesRatio definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} + */ +const TimeSeriesRatio = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * A `DistributionCut` defines a `TimeSeries` and thresholds used for measuring + * good service and total service. The `TimeSeries` must have `ValueType = + * DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. The + * computed `good_service` will be the count of values x in the `Distribution` + * such that `range.min <= x < range.max`. + * + * @property {string} distributionFilter + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` aggregating values. Must have `ValueType = + * DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. + * + * @property {Object} range + * Range of values considered "good." For a one-sided range, set one bound to + * an infinite value. + * + * This object should have the same structure as [Range]{@link google.monitoring.v3.Range} + * + * @typedef DistributionCut + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.DistributionCut definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} + */ +const DistributionCut = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * A `WindowsBasedSli` defines `good_service` as the count of time windows for + * which the provided service was of good quality. Criteria for determining + * if service was good are embedded in the `window_criterion`. + * + * @property {string} goodBadMetricFilter + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` with `ValueType = BOOL`. The window is good if + * any `true` values appear in the window. + * + * @property {Object} goodTotalRatioThreshold + * A window is good if its `performance` is high enough. + * + * This object should have the same structure as [PerformanceThreshold]{@link google.monitoring.v3.PerformanceThreshold} + * + * @property {Object} metricMeanInRange + * A window is good if the metric's value is in a good range, averaged + * across returned streams. + * + * This object should have the same structure as [MetricRange]{@link google.monitoring.v3.MetricRange} + * + * @property {Object} metricSumInRange + * A window is good if the metric's value is in a good range, summed across + * returned streams. + * + * This object should have the same structure as [MetricRange]{@link google.monitoring.v3.MetricRange} + * + * @property {Object} windowPeriod + * Duration over which window quality is evaluated. Must be an integer + * fraction of a day and at least `60s`. + * + * This object should have the same structure as [Duration]{@link google.protobuf.Duration} + * + * @typedef WindowsBasedSli + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.WindowsBasedSli definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} + */ +const WindowsBasedSli = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * A `PerformanceThreshold` is used when each window is good when that window + * has a sufficiently high `performance`. + * + * @property {Object} performance + * `RequestBasedSli` to evaluate to judge window quality. + * + * This object should have the same structure as [RequestBasedSli]{@link google.monitoring.v3.RequestBasedSli} + * + * @property {Object} basicSliPerformance + * `BasicSli` to evaluate to judge window quality. + * + * This object should have the same structure as [BasicSli]{@link google.monitoring.v3.BasicSli} + * + * @property {number} threshold + * If window `performance >= threshold`, the window is counted as good. + * + * @typedef PerformanceThreshold + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.WindowsBasedSli.PerformanceThreshold definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} + */ + PerformanceThreshold: { + // This is for documentation. Actual contents will be loaded by gRPC. + }, + + /** + * A `MetricRange` is used when each window is good when the value x of a + * single `TimeSeries` satisfies `range.min <= x < range.max`. The provided + * `TimeSeries` must have `ValueType = INT64` or `ValueType = DOUBLE` and + * `MetricKind = GAUGE`. + * + * @property {string} timeSeries + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying the `TimeSeries` to use for evaluating window quality. + * + * @property {Object} range + * Range of values considered "good." For a one-sided range, set one bound + * to an infinite value. + * + * This object should have the same structure as [Range]{@link google.monitoring.v3.Range} + * + * @typedef MetricRange + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.WindowsBasedSli.MetricRange definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} + */ + MetricRange: { + // This is for documentation. Actual contents will be loaded by gRPC. + } +}; \ No newline at end of file diff --git a/packages/google-cloud-monitoring/src/v3/doc/google/monitoring/v3/doc_service_service.js b/packages/google-cloud-monitoring/src/v3/doc/google/monitoring/v3/doc_service_service.js new file mode 100644 index 00000000000..78856efd49e --- /dev/null +++ b/packages/google-cloud-monitoring/src/v3/doc/google/monitoring/v3/doc_service_service.js @@ -0,0 +1,299 @@ +// 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 +// +// https://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 purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * The `CreateService` request. + * + * @property {string} parent + * Resource name of the parent workspace. + * Of the form `projects/{project_id}`. + * + * @property {string} serviceId + * Optional. The Service id to use for this Service. If omitted, an id will be + * generated instead. Must match the pattern [a-z0-9\-]+ + * + * @property {Object} service + * The `Service` to create. + * + * This object should have the same structure as [Service]{@link google.monitoring.v3.Service} + * + * @typedef CreateServiceRequest + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.CreateServiceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} + */ +const CreateServiceRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The `GetService` request. + * + * @property {string} name + * Resource name of the `Service`. + * Of the form `projects/{project_id}/services/{service_id}`. + * + * @typedef GetServiceRequest + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.GetServiceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} + */ +const GetServiceRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The `ListServices` request. + * + * @property {string} parent + * Resource name of the parent `Workspace`. + * Of the form `projects/{project_id}`. + * + * @property {string} filter + * A filter specifying what `Service`s to return. The filter currently + * supports the following fields: + * + * - `identifier_case` + * - `app_engine.module_id` + * - `cloud_endpoints.service` + * - `cluster_istio.location` + * - `cluster_istio.cluster_name` + * - `cluster_istio.service_namespace` + * - `cluster_istio.service_name` + * + * `identifier_case` refers to which option in the identifier oneof is + * populated. For example, the filter `identifier_case = "CUSTOM"` would match + * all services with a value for the `custom` field. Valid options are + * "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". + * + * @property {number} pageSize + * A non-negative number that is the maximum number of results to return. + * When 0, use default page size. + * + * @property {string} pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * @typedef ListServicesRequest + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.ListServicesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} + */ +const ListServicesRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The `ListServices` response. + * + * @property {Object[]} services + * The `Service`s matching the specified filter. + * + * This object should have the same structure as [Service]{@link google.monitoring.v3.Service} + * + * @property {string} nextPageToken + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `pageToken` in the next call to this method. + * + * @typedef ListServicesResponse + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.ListServicesResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} + */ +const ListServicesResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The `UpdateService` request. + * + * @property {Object} service + * The `Service` to draw updates from. + * The given `name` specifies the resource to update. + * + * This object should have the same structure as [Service]{@link google.monitoring.v3.Service} + * + * @property {Object} updateMask + * A set of field paths defining which fields to use for the update. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * + * @typedef UpdateServiceRequest + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.UpdateServiceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} + */ +const UpdateServiceRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The `DeleteService` request. + * + * @property {string} name + * Resource name of the `Service` to delete. + * Of the form `projects/{project_id}/service/{service_id}`. + * + * @typedef DeleteServiceRequest + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.DeleteServiceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} + */ +const DeleteServiceRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The `CreateServiceLevelObjective` request. + * + * @property {string} parent + * Resource name of the parent `Service`. + * Of the form `projects/{project_id}/services/{service_id}`. + * + * @property {string} serviceLevelObjectiveId + * Optional. The ServiceLevelObjective id to use for this + * ServiceLevelObjective. If omitted, an id will be generated instead. Must + * match the pattern [a-z0-9\-]+ + * + * @property {Object} serviceLevelObjective + * The `ServiceLevelObjective` to create. + * The provided `name` will be respected if no `ServiceLevelObjective` exists + * with this name. + * + * This object should have the same structure as [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective} + * + * @typedef CreateServiceLevelObjectiveRequest + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.CreateServiceLevelObjectiveRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} + */ +const CreateServiceLevelObjectiveRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The `GetServiceLevelObjective` request. + * + * @property {string} name + * Resource name of the `ServiceLevelObjective` to get. + * Of the form + * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. + * + * @property {number} view + * View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the + * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + * + * The number should be among the values of [View]{@link google.monitoring.v3.View} + * + * @typedef GetServiceLevelObjectiveRequest + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.GetServiceLevelObjectiveRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} + */ +const GetServiceLevelObjectiveRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The `ListServiceLevelObjectives` request. + * + * @property {string} parent + * Resource name of the parent `Service`. + * Of the form `projects/{project_id}/services/{service_id}`. + * + * @property {string} filter + * A filter specifying what `ServiceLevelObjective`s to return. + * + * @property {number} pageSize + * A non-negative number that is the maximum number of results to return. + * When 0, use default page size. + * + * @property {string} pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * @property {number} view + * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each + * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + * + * The number should be among the values of [View]{@link google.monitoring.v3.View} + * + * @typedef ListServiceLevelObjectivesRequest + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.ListServiceLevelObjectivesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} + */ +const ListServiceLevelObjectivesRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The `ListServiceLevelObjectives` response. + * + * @property {Object[]} serviceLevelObjectives + * The `ServiceLevelObjective`s matching the specified filter. + * + * This object should have the same structure as [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective} + * + * @property {string} nextPageToken + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `pageToken` in the next call to this method. + * + * @typedef ListServiceLevelObjectivesResponse + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.ListServiceLevelObjectivesResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} + */ +const ListServiceLevelObjectivesResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The `UpdateServiceLevelObjective` request. + * + * @property {Object} serviceLevelObjective + * The `ServiceLevelObjective` to draw updates from. + * The given `name` specifies the resource to update. + * + * This object should have the same structure as [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective} + * + * @property {Object} updateMask + * A set of field paths defining which fields to use for the update. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * + * @typedef UpdateServiceLevelObjectiveRequest + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.UpdateServiceLevelObjectiveRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} + */ +const UpdateServiceLevelObjectiveRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The `DeleteServiceLevelObjective` request. + * + * @property {string} name + * Resource name of the `ServiceLevelObjective` to delete. + * Of the form + * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. + * + * @typedef DeleteServiceLevelObjectiveRequest + * @memberof google.monitoring.v3 + * @see [google.monitoring.v3.DeleteServiceLevelObjectiveRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} + */ +const DeleteServiceLevelObjectiveRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-monitoring/src/v3/group_service_client_config.json b/packages/google-cloud-monitoring/src/v3/group_service_client_config.json index fde5e90f1d0..a57878c2ece 100644 --- a/packages/google-cloud-monitoring/src/v3/group_service_client_config.json +++ b/packages/google-cloud-monitoring/src/v3/group_service_client_config.json @@ -21,32 +21,32 @@ }, "methods": { "ListGroups": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetGroup": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "CreateGroup": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateGroup": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "DeleteGroup": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListGroupMembers": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-monitoring/src/v3/index.js b/packages/google-cloud-monitoring/src/v3/index.js index 9845e3fa484..ceaeae9e567 100644 --- a/packages/google-cloud-monitoring/src/v3/index.js +++ b/packages/google-cloud-monitoring/src/v3/index.js @@ -18,10 +18,12 @@ const AlertPolicyServiceClient = require('./alert_policy_service_client'); const GroupServiceClient = require('./group_service_client'); const MetricServiceClient = require('./metric_service_client'); const NotificationChannelServiceClient = require('./notification_channel_service_client'); +const ServiceMonitoringServiceClient = require('./service_monitoring_service_client'); const UptimeCheckServiceClient = require('./uptime_check_service_client'); module.exports.AlertPolicyServiceClient = AlertPolicyServiceClient; module.exports.GroupServiceClient = GroupServiceClient; module.exports.MetricServiceClient = MetricServiceClient; module.exports.NotificationChannelServiceClient = NotificationChannelServiceClient; +module.exports.ServiceMonitoringServiceClient = ServiceMonitoringServiceClient; module.exports.UptimeCheckServiceClient = UptimeCheckServiceClient; diff --git a/packages/google-cloud-monitoring/src/v3/metric_service_client_config.json b/packages/google-cloud-monitoring/src/v3/metric_service_client_config.json index 7dd4607375c..c67d2422ec1 100644 --- a/packages/google-cloud-monitoring/src/v3/metric_service_client_config.json +++ b/packages/google-cloud-monitoring/src/v3/metric_service_client_config.json @@ -21,37 +21,37 @@ }, "methods": { "ListMonitoredResourceDescriptors": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetMonitoredResourceDescriptor": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListMetricDescriptors": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetMetricDescriptor": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "CreateMetricDescriptor": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteMetricDescriptor": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListTimeSeries": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, diff --git a/packages/google-cloud-monitoring/src/v3/notification_channel_service_client_config.json b/packages/google-cloud-monitoring/src/v3/notification_channel_service_client_config.json index 4a0f4bdc195..5fddaef1323 100644 --- a/packages/google-cloud-monitoring/src/v3/notification_channel_service_client_config.json +++ b/packages/google-cloud-monitoring/src/v3/notification_channel_service_client_config.json @@ -21,52 +21,52 @@ }, "methods": { "ListNotificationChannelDescriptors": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetNotificationChannelDescriptor": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListNotificationChannels": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetNotificationChannel": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "CreateNotificationChannel": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateNotificationChannel": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteNotificationChannel": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "SendNotificationChannelVerificationCode": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetNotificationChannelVerificationCode": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "VerifyNotificationChannel": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-monitoring/src/v3/service_monitoring_service_client.js b/packages/google-cloud-monitoring/src/v3/service_monitoring_service_client.js new file mode 100644 index 00000000000..20d3b178828 --- /dev/null +++ b/packages/google-cloud-monitoring/src/v3/service_monitoring_service_client.js @@ -0,0 +1,1238 @@ +// 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 +// +// https://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. + +'use strict'; + +const gapicConfig = require('./service_monitoring_service_client_config.json'); +const gax = require('google-gax'); +const path = require('path'); + +const VERSION = require('../../package.json').version; + +/** + * The Stackdriver Monitoring Service-Oriented Monitoring API has endpoints for + * managing and querying aspects of a workspace's services. These include the + * `Service`'s monitored resources, its Service-Level Objectives, and a taxonomy + * of categorized Health Metrics. + * + * @class + * @memberof v3 + */ +class ServiceMonitoringServiceClient { + /** + * Construct an instance of ServiceMonitoringServiceClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + constructor(opts) { + opts = opts || {}; + this._descriptors = {}; + + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + opts.fallback = true; + } + + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + + const servicePath = + opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; + + // Ensure that options include the service address and port. + opts = Object.assign( + { + clientConfig: {}, + port: this.constructor.port, + servicePath, + }, + opts + ); + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = this.constructor.scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth; + + // Determine the client header string. + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), + servicePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/services/{service}' + ), + serviceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this._descriptors.page = { + listServices: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'services' + ), + listServiceLevelObjectives: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'serviceLevelObjectives' + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.monitoring.v3.ServiceMonitoringService', + gapicConfig, + opts.clientConfig, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this._innerApiCalls = {}; + + // Put together the "service stub" for + // google.monitoring.v3.ServiceMonitoringService. + const serviceMonitoringServiceStub = gaxGrpc.createStub( + opts.fallback + ? protos.lookupService('google.monitoring.v3.ServiceMonitoringService') + : protos.google.monitoring.v3.ServiceMonitoringService, + opts + ); + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const serviceMonitoringServiceStubMethods = [ + 'createService', + 'getService', + 'listServices', + 'updateService', + 'deleteService', + 'createServiceLevelObjective', + 'getServiceLevelObjective', + 'listServiceLevelObjectives', + 'updateServiceLevelObjective', + 'deleteServiceLevelObjective', + ]; + for (const methodName of serviceMonitoringServiceStubMethods) { + const innerCallPromise = serviceMonitoringServiceStub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] + ); + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'monitoring.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'monitoring.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/monitoring', + 'https://www.googleapis.com/auth/monitoring.read', + 'https://www.googleapis.com/auth/monitoring.write', + ]; + } + + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId(callback) { + return this.auth.getProjectId(callback); + } + + // ------------------- + // -- Service calls -- + // ------------------- + + /** + * Create a `Service`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Resource name of the parent workspace. + * Of the form `projects/{project_id}`. + * @param {Object} request.service + * The `Service` to create. + * + * This object should have the same structure as [Service]{@link google.monitoring.v3.Service} + * @param {string} [request.serviceId] + * Optional. The Service id to use for this Service. If omitted, an id will be + * generated instead. Must match the pattern [a-z0-9\-]+ + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Service]{@link google.monitoring.v3.Service}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Service]{@link google.monitoring.v3.Service}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const monitoring = require('@google-cloud/monitoring'); + * + * const client = new monitoring.v3.ServiceMonitoringServiceClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.projectPath('[PROJECT]'); + * const service = {}; + * const request = { + * parent: formattedParent, + * service: service, + * }; + * client.createService(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + createService(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); + + return this._innerApiCalls.createService(request, options, callback); + } + + /** + * Get the named `Service`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name of the `Service`. + * Of the form `projects/{project_id}/services/{service_id}`. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Service]{@link google.monitoring.v3.Service}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Service]{@link google.monitoring.v3.Service}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const monitoring = require('@google-cloud/monitoring'); + * + * const client = new monitoring.v3.ServiceMonitoringServiceClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.servicePath('[PROJECT]', '[SERVICE]'); + * client.getService({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + getService(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name, + }); + + return this._innerApiCalls.getService(request, options, callback); + } + + /** + * List `Service`s for this workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Resource name of the parent `Workspace`. + * Of the form `projects/{project_id}`. + * @param {string} [request.filter] + * A filter specifying what `Service`s to return. The filter currently + * supports the following fields: + * + * - `identifier_case` + * - `app_engine.module_id` + * - `cloud_endpoints.service` + * - `cluster_istio.location` + * - `cluster_istio.cluster_name` + * - `cluster_istio.service_namespace` + * - `cluster_istio.service_name` + * + * `identifier_case` refers to which option in the identifier oneof is + * populated. For example, the filter `identifier_case = "CUSTOM"` would match + * all services with a value for the `custom` field. Valid options are + * "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is Array of [Service]{@link google.monitoring.v3.Service}. + * + * When autoPaginate: false is specified through options, it contains the result + * in a single response. If the response indicates the next page exists, the third + * parameter is set to be used for the next request object. The fourth parameter keeps + * the raw response object of an object representing [ListServicesResponse]{@link google.monitoring.v3.ListServicesResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Service]{@link google.monitoring.v3.Service}. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Service]{@link google.monitoring.v3.Service} in a single response. + * The second element is the next request object if the response + * indicates the next page exists, or null. The third element is + * an object representing [ListServicesResponse]{@link google.monitoring.v3.ListServicesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const monitoring = require('@google-cloud/monitoring'); + * + * const client = new monitoring.v3.ServiceMonitoringServiceClient({ + * // optional auth parameters. + * }); + * + * // Iterate over all elements. + * const formattedParent = client.projectPath('[PROJECT]'); + * + * client.listServices({parent: formattedParent}) + * .then(responses => { + * const resources = responses[0]; + * for (const resource of resources) { + * // doThingsWith(resource) + * } + * }) + * .catch(err => { + * console.error(err); + * }); + * + * // Or obtain the paged response. + * const formattedParent = client.projectPath('[PROJECT]'); + * + * + * const options = {autoPaginate: false}; + * const callback = responses => { + * // The actual resources in a response. + * const resources = responses[0]; + * // The next request if the response shows that there are more responses. + * const nextRequest = responses[1]; + * // The actual response object, if necessary. + * // const rawResponse = responses[2]; + * for (const resource of resources) { + * // doThingsWith(resource); + * } + * if (nextRequest) { + * // Fetch the next page. + * return client.listServices(nextRequest, options).then(callback); + * } + * } + * client.listServices({parent: formattedParent}, options) + * .then(callback) + * .catch(err => { + * console.error(err); + * }); + */ + listServices(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); + + return this._innerApiCalls.listServices(request, options, callback); + } + + /** + * Equivalent to {@link listServices}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listServices} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Resource name of the parent `Workspace`. + * Of the form `projects/{project_id}`. + * @param {string} [request.filter] + * A filter specifying what `Service`s to return. The filter currently + * supports the following fields: + * + * - `identifier_case` + * - `app_engine.module_id` + * - `cloud_endpoints.service` + * - `cluster_istio.location` + * - `cluster_istio.cluster_name` + * - `cluster_istio.service_namespace` + * - `cluster_istio.service_name` + * + * `identifier_case` refers to which option in the identifier oneof is + * populated. For example, the filter `identifier_case = "CUSTOM"` would match + * all services with a value for the `custom` field. Valid options are + * "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @returns {Stream} + * An object stream which emits an object representing [Service]{@link google.monitoring.v3.Service} on 'data' event. + * + * @example + * + * const monitoring = require('@google-cloud/monitoring'); + * + * const client = new monitoring.v3.ServiceMonitoringServiceClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.projectPath('[PROJECT]'); + * client.listServicesStream({parent: formattedParent}) + * .on('data', element => { + * // doThingsWith(element) + * }).on('error', err => { + * console.log(err); + * }); + */ + listServicesStream(request, options) { + options = options || {}; + + return this._descriptors.page.listServices.createStream( + this._innerApiCalls.listServices, + request, + options + ); + } + + /** + * Update this `Service`. + * + * @param {Object} request + * The request object that will be sent. + * @param {Object} request.service + * The `Service` to draw updates from. + * The given `name` specifies the resource to update. + * + * This object should have the same structure as [Service]{@link google.monitoring.v3.Service} + * @param {Object} [request.updateMask] + * A set of field paths defining which fields to use for the update. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Service]{@link google.monitoring.v3.Service}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Service]{@link google.monitoring.v3.Service}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const monitoring = require('@google-cloud/monitoring'); + * + * const client = new monitoring.v3.ServiceMonitoringServiceClient({ + * // optional auth parameters. + * }); + * + * const service = {}; + * client.updateService({service: service}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + updateService(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'service.name': request.service.name, + }); + + return this._innerApiCalls.updateService(request, options, callback); + } + + /** + * Soft delete this `Service`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name of the `Service` to delete. + * Of the form `projects/{project_id}/service/{service_id}`. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error)} [callback] + * The function which will be called with the result of the API call. + * @returns {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const monitoring = require('@google-cloud/monitoring'); + * + * const client = new monitoring.v3.ServiceMonitoringServiceClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.servicePath('[PROJECT]', '[SERVICE]'); + * client.deleteService({name: formattedName}).catch(err => { + * console.error(err); + * }); + */ + deleteService(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name, + }); + + return this._innerApiCalls.deleteService(request, options, callback); + } + + /** + * Create a `ServiceLevelObjective` for the given `Service`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Resource name of the parent `Service`. + * Of the form `projects/{project_id}/services/{service_id}`. + * @param {Object} request.serviceLevelObjective + * The `ServiceLevelObjective` to create. + * The provided `name` will be respected if no `ServiceLevelObjective` exists + * with this name. + * + * This object should have the same structure as [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective} + * @param {string} [request.serviceLevelObjectiveId] + * Optional. The ServiceLevelObjective id to use for this + * ServiceLevelObjective. If omitted, an id will be generated instead. Must + * match the pattern [a-z0-9\-]+ + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const monitoring = require('@google-cloud/monitoring'); + * + * const client = new monitoring.v3.ServiceMonitoringServiceClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.servicePath('[PROJECT]', '[SERVICE]'); + * const serviceLevelObjective = {}; + * const request = { + * parent: formattedParent, + * serviceLevelObjective: serviceLevelObjective, + * }; + * client.createServiceLevelObjective(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + createServiceLevelObjective(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); + + return this._innerApiCalls.createServiceLevelObjective( + request, + options, + callback + ); + } + + /** + * Get a `ServiceLevelObjective` by name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name of the `ServiceLevelObjective` to get. + * Of the form + * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. + * @param {number} [request.view] + * View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the + * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + * + * The number should be among the values of [View]{@link google.monitoring.v3.View} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const monitoring = require('@google-cloud/monitoring'); + * + * const client = new monitoring.v3.ServiceMonitoringServiceClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.serviceLevelObjectivePath('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + * client.getServiceLevelObjective({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + getServiceLevelObjective(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name, + }); + + return this._innerApiCalls.getServiceLevelObjective( + request, + options, + callback + ); + } + + /** + * List the `ServiceLevelObjective`s for the given `Service`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Resource name of the parent `Service`. + * Of the form `projects/{project_id}/services/{service_id}`. + * @param {string} [request.filter] + * A filter specifying what `ServiceLevelObjective`s to return. + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {number} [request.view] + * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each + * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + * + * The number should be among the values of [View]{@link google.monitoring.v3.View} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is Array of [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective}. + * + * When autoPaginate: false is specified through options, it contains the result + * in a single response. If the response indicates the next page exists, the third + * parameter is set to be used for the next request object. The fourth parameter keeps + * the raw response object of an object representing [ListServiceLevelObjectivesResponse]{@link google.monitoring.v3.ListServiceLevelObjectivesResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective}. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective} in a single response. + * The second element is the next request object if the response + * indicates the next page exists, or null. The third element is + * an object representing [ListServiceLevelObjectivesResponse]{@link google.monitoring.v3.ListServiceLevelObjectivesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const monitoring = require('@google-cloud/monitoring'); + * + * const client = new monitoring.v3.ServiceMonitoringServiceClient({ + * // optional auth parameters. + * }); + * + * // Iterate over all elements. + * const formattedParent = client.servicePath('[PROJECT]', '[SERVICE]'); + * + * client.listServiceLevelObjectives({parent: formattedParent}) + * .then(responses => { + * const resources = responses[0]; + * for (const resource of resources) { + * // doThingsWith(resource) + * } + * }) + * .catch(err => { + * console.error(err); + * }); + * + * // Or obtain the paged response. + * const formattedParent = client.servicePath('[PROJECT]', '[SERVICE]'); + * + * + * const options = {autoPaginate: false}; + * const callback = responses => { + * // The actual resources in a response. + * const resources = responses[0]; + * // The next request if the response shows that there are more responses. + * const nextRequest = responses[1]; + * // The actual response object, if necessary. + * // const rawResponse = responses[2]; + * for (const resource of resources) { + * // doThingsWith(resource); + * } + * if (nextRequest) { + * // Fetch the next page. + * return client.listServiceLevelObjectives(nextRequest, options).then(callback); + * } + * } + * client.listServiceLevelObjectives({parent: formattedParent}, options) + * .then(callback) + * .catch(err => { + * console.error(err); + * }); + */ + listServiceLevelObjectives(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); + + return this._innerApiCalls.listServiceLevelObjectives( + request, + options, + callback + ); + } + + /** + * Equivalent to {@link listServiceLevelObjectives}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listServiceLevelObjectives} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Resource name of the parent `Service`. + * Of the form `projects/{project_id}/services/{service_id}`. + * @param {string} [request.filter] + * A filter specifying what `ServiceLevelObjective`s to return. + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {number} [request.view] + * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each + * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + * + * The number should be among the values of [View]{@link google.monitoring.v3.View} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @returns {Stream} + * An object stream which emits an object representing [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective} on 'data' event. + * + * @example + * + * const monitoring = require('@google-cloud/monitoring'); + * + * const client = new monitoring.v3.ServiceMonitoringServiceClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.servicePath('[PROJECT]', '[SERVICE]'); + * client.listServiceLevelObjectivesStream({parent: formattedParent}) + * .on('data', element => { + * // doThingsWith(element) + * }).on('error', err => { + * console.log(err); + * }); + */ + listServiceLevelObjectivesStream(request, options) { + options = options || {}; + + return this._descriptors.page.listServiceLevelObjectives.createStream( + this._innerApiCalls.listServiceLevelObjectives, + request, + options + ); + } + + /** + * Update the given `ServiceLevelObjective`. + * + * @param {Object} request + * The request object that will be sent. + * @param {Object} request.serviceLevelObjective + * The `ServiceLevelObjective` to draw updates from. + * The given `name` specifies the resource to update. + * + * This object should have the same structure as [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective} + * @param {Object} [request.updateMask] + * A set of field paths defining which fields to use for the update. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const monitoring = require('@google-cloud/monitoring'); + * + * const client = new monitoring.v3.ServiceMonitoringServiceClient({ + * // optional auth parameters. + * }); + * + * const serviceLevelObjective = {}; + * client.updateServiceLevelObjective({serviceLevelObjective: serviceLevelObjective}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + updateServiceLevelObjective(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'service_level_objective.name': request.serviceLevelObjective.name, + }); + + return this._innerApiCalls.updateServiceLevelObjective( + request, + options, + callback + ); + } + + /** + * Delete the given `ServiceLevelObjective`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name of the `ServiceLevelObjective` to delete. + * Of the form + * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error)} [callback] + * The function which will be called with the result of the API call. + * @returns {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const monitoring = require('@google-cloud/monitoring'); + * + * const client = new monitoring.v3.ServiceMonitoringServiceClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.serviceLevelObjectivePath('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + * client.deleteServiceLevelObjective({name: formattedName}).catch(err => { + * console.error(err); + * }); + */ + deleteServiceLevelObjective(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name, + }); + + return this._innerApiCalls.deleteServiceLevelObjective( + request, + options, + callback + ); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {String} project + * @returns {String} + */ + projectPath(project) { + return this._pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Return a fully-qualified service resource name string. + * + * @param {String} project + * @param {String} service + * @returns {String} + */ + servicePath(project, service) { + return this._pathTemplates.servicePathTemplate.render({ + project: project, + service: service, + }); + } + + /** + * Return a fully-qualified service_level_objective resource name string. + * + * @param {String} project + * @param {String} service + * @param {String} serviceLevelObjective + * @returns {String} + */ + serviceLevelObjectivePath(project, service, serviceLevelObjective) { + return this._pathTemplates.serviceLevelObjectivePathTemplate.render({ + project: project, + service: service, + service_level_objective: serviceLevelObjective, + }); + } + + /** + * Parse the projectName from a project resource. + * + * @param {String} projectName + * A fully-qualified path representing a project resources. + * @returns {String} - A string representing the project. + */ + matchProjectFromProjectName(projectName) { + return this._pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Parse the serviceName from a service resource. + * + * @param {String} serviceName + * A fully-qualified path representing a service resources. + * @returns {String} - A string representing the project. + */ + matchProjectFromServiceName(serviceName) { + return this._pathTemplates.servicePathTemplate.match(serviceName).project; + } + + /** + * Parse the serviceName from a service resource. + * + * @param {String} serviceName + * A fully-qualified path representing a service resources. + * @returns {String} - A string representing the service. + */ + matchServiceFromServiceName(serviceName) { + return this._pathTemplates.servicePathTemplate.match(serviceName).service; + } + + /** + * Parse the serviceLevelObjectiveName from a service_level_objective resource. + * + * @param {String} serviceLevelObjectiveName + * A fully-qualified path representing a service_level_objective resources. + * @returns {String} - A string representing the project. + */ + matchProjectFromServiceLevelObjectiveName(serviceLevelObjectiveName) { + return this._pathTemplates.serviceLevelObjectivePathTemplate.match( + serviceLevelObjectiveName + ).project; + } + + /** + * Parse the serviceLevelObjectiveName from a service_level_objective resource. + * + * @param {String} serviceLevelObjectiveName + * A fully-qualified path representing a service_level_objective resources. + * @returns {String} - A string representing the service. + */ + matchServiceFromServiceLevelObjectiveName(serviceLevelObjectiveName) { + return this._pathTemplates.serviceLevelObjectivePathTemplate.match( + serviceLevelObjectiveName + ).service; + } + + /** + * Parse the serviceLevelObjectiveName from a service_level_objective resource. + * + * @param {String} serviceLevelObjectiveName + * A fully-qualified path representing a service_level_objective resources. + * @returns {String} - A string representing the service_level_objective. + */ + matchServiceLevelObjectiveFromServiceLevelObjectiveName( + serviceLevelObjectiveName + ) { + return this._pathTemplates.serviceLevelObjectivePathTemplate.match( + serviceLevelObjectiveName + ).service_level_objective; + } +} + +module.exports = ServiceMonitoringServiceClient; diff --git a/packages/google-cloud-monitoring/src/v3/service_monitoring_service_client_config.json b/packages/google-cloud-monitoring/src/v3/service_monitoring_service_client_config.json new file mode 100644 index 00000000000..dfa25dc0bb1 --- /dev/null +++ b/packages/google-cloud-monitoring/src/v3/service_monitoring_service_client_config.json @@ -0,0 +1,76 @@ +{ + "interfaces": { + "google.monitoring.v3.ServiceMonitoringService": { + "retry_codes": { + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "non_idempotent": [] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateService": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetService": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListServices": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateService": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteService": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateServiceLevelObjective": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetServiceLevelObjective": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListServiceLevelObjectives": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateServiceLevelObjective": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteServiceLevelObjective": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-monitoring/src/v3/service_monitoring_service_proto_list.json b/packages/google-cloud-monitoring/src/v3/service_monitoring_service_proto_list.json new file mode 100644 index 00000000000..10dad48263d --- /dev/null +++ b/packages/google-cloud-monitoring/src/v3/service_monitoring_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/monitoring/v3/service_service.proto" +] diff --git a/packages/google-cloud-monitoring/synth.metadata b/packages/google-cloud-monitoring/synth.metadata index c8da64fe4b7..7e210387b10 100644 --- a/packages/google-cloud-monitoring/synth.metadata +++ b/packages/google-cloud-monitoring/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-11-02T11:11:54.790733Z", + "updateTime": "2019-11-13T12:16:01.746091Z", "sources": [ { "generator": { "name": "artman", - "version": "0.41.0", - "dockerImage": "googleapis/artman@sha256:75b38a3b073a7b243545f2332463096624c802bb1e56b8cb6f22ba1ecd325fa9" + "version": "0.41.1", + "dockerImage": "googleapis/artman@sha256:545c758c76c3f779037aa259023ec3d1ef2d57d2c8cd00a222cb187d63ceac5e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "aac770126e2def40dcc387f50e8007b21c869e58", - "internalRef": "278016738" + "sha": "88bbf96b90089994ed16208a0f38cdd07f743742", + "internalRef": "280134477" } }, { diff --git a/packages/google-cloud-monitoring/test/gapic-v3.js b/packages/google-cloud-monitoring/test/gapic-v3.js index f9411f5f7a6..037d55a5790 100644 --- a/packages/google-cloud-monitoring/test/gapic-v3.js +++ b/packages/google-cloud-monitoring/test/gapic-v3.js @@ -2064,6 +2064,676 @@ describe('NotificationChannelServiceClient', () => { }); }); }); +describe('ServiceMonitoringServiceClient', () => { + it('has servicePath', () => { + const servicePath = + monitoringModule.v3.ServiceMonitoringServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + monitoringModule.v3.ServiceMonitoringServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = monitoringModule.v3.ServiceMonitoringServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no options', () => { + const client = new monitoringModule.v3.ServiceMonitoringServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ + fallback: true, + }); + assert(client); + }); + + describe('createService', () => { + it('invokes createService without error', done => { + const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.projectPath('[PROJECT]'); + const service = {}; + const request = { + parent: formattedParent, + service: service, + }; + + // Mock response + const name = 'name3373707'; + const displayName = 'displayName1615086568'; + const expectedResponse = { + name: name, + displayName: displayName, + }; + + // Mock Grpc layer + client._innerApiCalls.createService = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.createService(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createService with error', done => { + const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.projectPath('[PROJECT]'); + const service = {}; + const request = { + parent: formattedParent, + service: service, + }; + + // Mock Grpc layer + client._innerApiCalls.createService = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.createService(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('getService', () => { + it('invokes getService without error', done => { + const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.servicePath('[PROJECT]', '[SERVICE]'); + const request = { + name: formattedName, + }; + + // Mock response + const name2 = 'name2-1052831874'; + const displayName = 'displayName1615086568'; + const expectedResponse = { + name: name2, + displayName: displayName, + }; + + // Mock Grpc layer + client._innerApiCalls.getService = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.getService(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getService with error', done => { + const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.servicePath('[PROJECT]', '[SERVICE]'); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.getService = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.getService(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('listServices', () => { + it('invokes listServices without error', done => { + const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.projectPath('[PROJECT]'); + const request = { + parent: formattedParent, + }; + + // Mock response + const nextPageToken = ''; + const servicesElement = {}; + const services = [servicesElement]; + const expectedResponse = { + nextPageToken: nextPageToken, + services: services, + }; + + // Mock Grpc layer + client._innerApiCalls.listServices = ( + actualRequest, + options, + callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse.services); + }; + + client.listServices(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse.services); + done(); + }); + }); + + it('invokes listServices with error', done => { + const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.projectPath('[PROJECT]'); + const request = { + parent: formattedParent, + }; + + // Mock Grpc layer + client._innerApiCalls.listServices = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.listServices(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('updateService', () => { + it('invokes updateService without error', done => { + const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const service = {}; + const request = { + service: service, + }; + + // Mock response + const name = 'name3373707'; + const displayName = 'displayName1615086568'; + const expectedResponse = { + name: name, + displayName: displayName, + }; + + // Mock Grpc layer + client._innerApiCalls.updateService = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.updateService(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateService with error', done => { + const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const service = {}; + const request = { + service: service, + }; + + // Mock Grpc layer + client._innerApiCalls.updateService = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.updateService(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('deleteService', () => { + it('invokes deleteService without error', done => { + const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.servicePath('[PROJECT]', '[SERVICE]'); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.deleteService = mockSimpleGrpcMethod(request); + + client.deleteService(request, err => { + assert.ifError(err); + done(); + }); + }); + + it('invokes deleteService with error', done => { + const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.servicePath('[PROJECT]', '[SERVICE]'); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.deleteService = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.deleteService(request, err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + + describe('createServiceLevelObjective', () => { + it('invokes createServiceLevelObjective without error', done => { + const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.servicePath('[PROJECT]', '[SERVICE]'); + const serviceLevelObjective = {}; + const request = { + parent: formattedParent, + serviceLevelObjective: serviceLevelObjective, + }; + + // Mock response + const name = 'name3373707'; + const displayName = 'displayName1615086568'; + const goal = 317825.0; + const expectedResponse = { + name: name, + displayName: displayName, + goal: goal, + }; + + // Mock Grpc layer + client._innerApiCalls.createServiceLevelObjective = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.createServiceLevelObjective(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createServiceLevelObjective with error', done => { + const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.servicePath('[PROJECT]', '[SERVICE]'); + const serviceLevelObjective = {}; + const request = { + parent: formattedParent, + serviceLevelObjective: serviceLevelObjective, + }; + + // Mock Grpc layer + client._innerApiCalls.createServiceLevelObjective = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.createServiceLevelObjective(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('getServiceLevelObjective', () => { + it('invokes getServiceLevelObjective without error', done => { + const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.serviceLevelObjectivePath( + '[PROJECT]', + '[SERVICE]', + '[SERVICE_LEVEL_OBJECTIVE]' + ); + const request = { + name: formattedName, + }; + + // Mock response + const name2 = 'name2-1052831874'; + const displayName = 'displayName1615086568'; + const goal = 317825.0; + const expectedResponse = { + name: name2, + displayName: displayName, + goal: goal, + }; + + // Mock Grpc layer + client._innerApiCalls.getServiceLevelObjective = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.getServiceLevelObjective(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getServiceLevelObjective with error', done => { + const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.serviceLevelObjectivePath( + '[PROJECT]', + '[SERVICE]', + '[SERVICE_LEVEL_OBJECTIVE]' + ); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.getServiceLevelObjective = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.getServiceLevelObjective(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('listServiceLevelObjectives', () => { + it('invokes listServiceLevelObjectives without error', done => { + const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.servicePath('[PROJECT]', '[SERVICE]'); + const request = { + parent: formattedParent, + }; + + // Mock response + const nextPageToken = ''; + const serviceLevelObjectivesElement = {}; + const serviceLevelObjectives = [serviceLevelObjectivesElement]; + const expectedResponse = { + nextPageToken: nextPageToken, + serviceLevelObjectives: serviceLevelObjectives, + }; + + // Mock Grpc layer + client._innerApiCalls.listServiceLevelObjectives = ( + actualRequest, + options, + callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse.serviceLevelObjectives); + }; + + client.listServiceLevelObjectives(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual( + response, + expectedResponse.serviceLevelObjectives + ); + done(); + }); + }); + + it('invokes listServiceLevelObjectives with error', done => { + const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.servicePath('[PROJECT]', '[SERVICE]'); + const request = { + parent: formattedParent, + }; + + // Mock Grpc layer + client._innerApiCalls.listServiceLevelObjectives = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.listServiceLevelObjectives(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('updateServiceLevelObjective', () => { + it('invokes updateServiceLevelObjective without error', done => { + const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const serviceLevelObjective = {}; + const request = { + serviceLevelObjective: serviceLevelObjective, + }; + + // Mock response + const name = 'name3373707'; + const displayName = 'displayName1615086568'; + const goal = 317825.0; + const expectedResponse = { + name: name, + displayName: displayName, + goal: goal, + }; + + // Mock Grpc layer + client._innerApiCalls.updateServiceLevelObjective = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.updateServiceLevelObjective(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateServiceLevelObjective with error', done => { + const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const serviceLevelObjective = {}; + const request = { + serviceLevelObjective: serviceLevelObjective, + }; + + // Mock Grpc layer + client._innerApiCalls.updateServiceLevelObjective = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.updateServiceLevelObjective(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('deleteServiceLevelObjective', () => { + it('invokes deleteServiceLevelObjective without error', done => { + const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.serviceLevelObjectivePath( + '[PROJECT]', + '[SERVICE]', + '[SERVICE_LEVEL_OBJECTIVE]' + ); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.deleteServiceLevelObjective = mockSimpleGrpcMethod( + request + ); + + client.deleteServiceLevelObjective(request, err => { + assert.ifError(err); + done(); + }); + }); + + it('invokes deleteServiceLevelObjective with error', done => { + const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.serviceLevelObjectivePath( + '[PROJECT]', + '[SERVICE]', + '[SERVICE_LEVEL_OBJECTIVE]' + ); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.deleteServiceLevelObjective = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.deleteServiceLevelObjective(request, err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); +}); describe('UptimeCheckServiceClient', () => { it('has servicePath', () => { const servicePath =