# Copyright 2015 Google Inc. # # 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. require 'date' require 'google/apis/core/base_service' require 'google/apis/core/json_representation' require 'google/apis/core/hashable' require 'google/apis/errors' module Google module Apis module MonitoringV1 # The request message for Operations.CancelOperation. class CancelOperationRequest include Google::Apis::Core::Hashable def initialize(**args) update!(**args) end # Update properties of this object def update!(**args) end end # A set of (label, value) pairs which were dropped during aggregation, attached # to google.api.Distribution.Exemplars in google.api.Distribution values during # aggregation.These values are used in combination with the label values that # remain on the aggregated Distribution timeseries to construct the full label # set for the exemplar values. The resulting full label set may be used to # identify the specific task/job/instance (for example) which may be # contributing to a long-tail, while allowing the storage savings of only # storing aggregated distribution values for a large group.Note that there are # no guarantees on ordering of the labels from exemplar-to-exemplar and from # distribution-to-distribution in the same stream, and there may be duplicates. # It is up to clients to resolve any ambiguities. class DroppedLabels include Google::Apis::Core::Hashable # Map from label to its value, for all labels dropped in any aggregation. # Corresponds to the JSON property `label` # @return [Hash] attr_accessor :label def initialize(**args) update!(**args) end # Update properties of this object def update!(**args) @label = args[:label] if args.key?(:label) end end # A generic empty message that you can re-use to avoid defining duplicated empty # messages in your APIs. A typical example is to use it as the request or the # response type of an API method. For instance: # service Foo ` # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); # ` # The JSON representation for Empty is empty JSON object ``. class Empty include Google::Apis::Core::Hashable def initialize(**args) update!(**args) end # Update properties of this object def update!(**args) end end # A single field of a message type. class Field include Google::Apis::Core::Hashable # The field cardinality. # Corresponds to the JSON property `cardinality` # @return [String] attr_accessor :cardinality # The string value of the default value of this field. Proto2 syntax only. # Corresponds to the JSON property `defaultValue` # @return [String] attr_accessor :default_value # The field JSON name. # Corresponds to the JSON property `jsonName` # @return [String] attr_accessor :json_name # The field type. # Corresponds to the JSON property `kind` # @return [String] attr_accessor :kind # The field name. # Corresponds to the JSON property `name` # @return [String] attr_accessor :name # The field number. # Corresponds to the JSON property `number` # @return [Fixnum] attr_accessor :number # The index of the field type in Type.oneofs, for message or enumeration types. # The first type has index 1; zero means the type is not in the list. # Corresponds to the JSON property `oneofIndex` # @return [Fixnum] attr_accessor :oneof_index # The protocol buffer options. # Corresponds to the JSON property `options` # @return [Array] attr_accessor :options # Whether to use alternative packed wire representation. # Corresponds to the JSON property `packed` # @return [Boolean] attr_accessor :packed alias_method :packed?, :packed # The field type URL, without the scheme, for message or enumeration types. # Example: "type.googleapis.com/google.protobuf.Timestamp". # Corresponds to the JSON property `typeUrl` # @return [String] attr_accessor :type_url def initialize(**args) update!(**args) end # Update properties of this object def update!(**args) @cardinality = args[:cardinality] if args.key?(:cardinality) @default_value = args[:default_value] if args.key?(:default_value) @json_name = args[:json_name] if args.key?(:json_name) @kind = args[:kind] if args.key?(:kind) @name = args[:name] if args.key?(:name) @number = args[:number] if args.key?(:number) @oneof_index = args[:oneof_index] if args.key?(:oneof_index) @options = args[:options] if args.key?(:options) @packed = args[:packed] if args.key?(:packed) @type_url = args[:type_url] if args.key?(:type_url) end end # The response message for Operations.ListOperations. class ListOperationsResponse include Google::Apis::Core::Hashable # The standard List next-page token. # Corresponds to the JSON property `nextPageToken` # @return [String] attr_accessor :next_page_token # A list of operations that matches the specified filter in the request. # Corresponds to the JSON property `operations` # @return [Array] attr_accessor :operations def initialize(**args) update!(**args) end # Update properties of this object def update!(**args) @next_page_token = args[:next_page_token] if args.key?(:next_page_token) @operations = args[:operations] if args.key?(:operations) end end # This resource represents a long-running operation that is the result of a # network API call. class Operation include Google::Apis::Core::Hashable # If the value is false, it means the operation is still in progress. If true, # the operation is completed, and either error or response is available. # Corresponds to the JSON property `done` # @return [Boolean] attr_accessor :done alias_method :done?, :done # The Status type defines a logical error model that is suitable for different # programming environments, including REST APIs and RPC APIs. It is used by gRPC # (https://github.com/grpc). The error model is designed to be: # Simple to use and understand for most users # Flexible enough to meet unexpected needsOverviewThe Status message contains # three pieces of data: error code, error message, and error details. The error # code should be an enum value of google.rpc.Code, but it may accept additional # error codes if needed. The error message should be a developer-facing English # message that helps developers understand and resolve the error. If a localized # user-facing error message is needed, put the localized message in the error # details or localize it in the client. The optional error details may contain # arbitrary information about the error. There is a predefined set of error # detail types in the package google.rpc that can be used for common error # conditions.Language mappingThe Status message is the logical representation of # the error model, but it is not necessarily the actual wire format. When the # Status message is exposed in different client libraries and different wire # protocols, it can be mapped differently. For example, it will likely be mapped # to some exceptions in Java, but more likely mapped to some error codes in C. # Other usesThe error model and the Status message can be used in a variety of # environments, either with or without APIs, to provide a consistent developer # experience across different environments.Example uses of this error model # include: # Partial errors. If a service needs to return partial errors to the client, it # may embed the Status in the normal response to indicate the partial errors. # Workflow errors. A typical workflow has multiple steps. Each step may have a # Status message for error reporting. # Batch operations. If a client uses batch request and batch response, the # Status message should be used directly inside batch response, one for each # error sub-response. # Asynchronous operations. If an API call embeds asynchronous operation results # in its response, the status of those operations should be represented directly # using the Status message. # Logging. If some API errors are stored in logs, the message Status could be # used directly after any stripping needed for security/privacy reasons. # Corresponds to the JSON property `error` # @return [Google::Apis::MonitoringV1::Status] attr_accessor :error # Service-specific metadata associated with the operation. It typically contains # progress information and common metadata such as create time. Some services # might not provide such metadata. Any method that returns a long-running # operation should document the metadata type, if any. # Corresponds to the JSON property `metadata` # @return [Hash] attr_accessor :metadata # The server-assigned name, which is only unique within the same service that # originally returns it. If you use the default HTTP mapping, the name should # have the format of operations/some/unique/name. # Corresponds to the JSON property `name` # @return [String] attr_accessor :name # The normal response of the operation in case of success. If the original # method returns no data on success, such as Delete, the response is google. # protobuf.Empty. If the original method is standard Get/Create/Update, the # response should be the resource. For other methods, the response should have # the type XxxResponse, where Xxx is the original method name. For example, if # the original method name is TakeSnapshot(), the inferred response type is # TakeSnapshotResponse. # Corresponds to the JSON property `response` # @return [Hash] attr_accessor :response def initialize(**args) update!(**args) end # Update properties of this object def update!(**args) @done = args[:done] if args.key?(:done) @error = args[:error] if args.key?(:error) @metadata = args[:metadata] if args.key?(:metadata) @name = args[:name] if args.key?(:name) @response = args[:response] if args.key?(:response) end end # A protocol buffer option, which can be attached to a message, field, # enumeration, etc. class Option include Google::Apis::Core::Hashable # The option's name. For protobuf built-in options (options defined in # descriptor.proto), this is the short name. For example, "map_entry". For # custom options, it should be the fully-qualified name. For example, "google. # api.http". # Corresponds to the JSON property `name` # @return [String] attr_accessor :name # The option's value packed in an Any message. If the value is a primitive, the # corresponding wrapper type defined in google/protobuf/wrappers.proto should be # used. If the value is an enum, it should be stored as an int32 value using the # google.protobuf.Int32Value type. # Corresponds to the JSON property `value` # @return [Hash] attr_accessor :value def initialize(**args) update!(**args) end # Update properties of this object def update!(**args) @name = args[:name] if args.key?(:name) @value = args[:value] if args.key?(:value) end end # SourceContext represents information about the source of a protobuf element, # like the file in which it is defined. class SourceContext include Google::Apis::Core::Hashable # The path-qualified name of the .proto file that contained the associated # protobuf element. For example: "google/protobuf/source_context.proto". # Corresponds to the JSON property `fileName` # @return [String] attr_accessor :file_name def initialize(**args) update!(**args) end # Update properties of this object def update!(**args) @file_name = args[:file_name] if args.key?(:file_name) end end # The context of a span, attached to google.api.Distribution.Exemplars in google. # api.Distribution values during aggregation.It contains the name of a span with # format: projects/PROJECT_ID/traces/TRACE_ID/spans/SPAN_ID class SpanContext include Google::Apis::Core::Hashable # The resource name of the span in the following format: # projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID] # TRACE_ID is a unique identifier for a trace within a project; it is a 32- # character hexadecimal encoding of a 16-byte array.SPAN_ID is a unique # identifier for a span within a trace; it is a 16-character hexadecimal # encoding of an 8-byte array. # Corresponds to the JSON property `spanName` # @return [String] attr_accessor :span_name def initialize(**args) update!(**args) end # Update properties of this object def update!(**args) @span_name = args[:span_name] if args.key?(:span_name) end end # The Status type defines a logical error model that is suitable for different # programming environments, including REST APIs and RPC APIs. It is used by gRPC # (https://github.com/grpc). The error model is designed to be: # Simple to use and understand for most users # Flexible enough to meet unexpected needsOverviewThe Status message contains # three pieces of data: error code, error message, and error details. The error # code should be an enum value of google.rpc.Code, but it may accept additional # error codes if needed. The error message should be a developer-facing English # message that helps developers understand and resolve the error. If a localized # user-facing error message is needed, put the localized message in the error # details or localize it in the client. The optional error details may contain # arbitrary information about the error. There is a predefined set of error # detail types in the package google.rpc that can be used for common error # conditions.Language mappingThe Status message is the logical representation of # the error model, but it is not necessarily the actual wire format. When the # Status message is exposed in different client libraries and different wire # protocols, it can be mapped differently. For example, it will likely be mapped # to some exceptions in Java, but more likely mapped to some error codes in C. # Other usesThe error model and the Status message can be used in a variety of # environments, either with or without APIs, to provide a consistent developer # experience across different environments.Example uses of this error model # include: # Partial errors. If a service needs to return partial errors to the client, it # may embed the Status in the normal response to indicate the partial errors. # Workflow errors. A typical workflow has multiple steps. Each step may have a # Status message for error reporting. # Batch operations. If a client uses batch request and batch response, the # Status message should be used directly inside batch response, one for each # error sub-response. # Asynchronous operations. If an API call embeds asynchronous operation results # in its response, the status of those operations should be represented directly # using the Status message. # Logging. If some API errors are stored in logs, the message Status could be # used directly after any stripping needed for security/privacy reasons. class Status include Google::Apis::Core::Hashable # The status code, which should be an enum value of google.rpc.Code. # Corresponds to the JSON property `code` # @return [Fixnum] attr_accessor :code # A list of messages that carry the error details. There is a common set of # message types for APIs to use. # Corresponds to the JSON property `details` # @return [Array>] attr_accessor :details # A developer-facing error message, which should be in English. Any user-facing # error message should be localized and sent in the google.rpc.Status.details # field, or localized by the client. # Corresponds to the JSON property `message` # @return [String] attr_accessor :message def initialize(**args) update!(**args) end # Update properties of this object def update!(**args) @code = args[:code] if args.key?(:code) @details = args[:details] if args.key?(:details) @message = args[:message] if args.key?(:message) end end # A protocol buffer message type. class Type include Google::Apis::Core::Hashable # The list of fields. # Corresponds to the JSON property `fields` # @return [Array] attr_accessor :fields # The fully qualified message name. # Corresponds to the JSON property `name` # @return [String] attr_accessor :name # The list of types appearing in oneof definitions in this type. # Corresponds to the JSON property `oneofs` # @return [Array] attr_accessor :oneofs # The protocol buffer options. # Corresponds to the JSON property `options` # @return [Array] attr_accessor :options # SourceContext represents information about the source of a protobuf element, # like the file in which it is defined. # Corresponds to the JSON property `sourceContext` # @return [Google::Apis::MonitoringV1::SourceContext] attr_accessor :source_context # The source syntax. # Corresponds to the JSON property `syntax` # @return [String] attr_accessor :syntax def initialize(**args) update!(**args) end # Update properties of this object def update!(**args) @fields = args[:fields] if args.key?(:fields) @name = args[:name] if args.key?(:name) @oneofs = args[:oneofs] if args.key?(:oneofs) @options = args[:options] if args.key?(:options) @source_context = args[:source_context] if args.key?(:source_context) @syntax = args[:syntax] if args.key?(:syntax) end end end end end