Autogenerated update (2017-08-25)

Add:
- adexperiencereport_v1
- androiddeviceprovisioning_v1
- androidmanagement_v1
- bigquerydatatransfer_v1
- cloudtrace_v2
- clouduseraccounts_vm_alpha
- consumersurveys_v2
- dlp_v2beta1
- oslogin_v1alpha
- playcustomapp_v1
- playmoviespartner_v1
- safebrowsing_v4
- spectrum_v1explorer
- speech_v1
- streetviewpublish_v1
- vault_v1
- videointelligence_v1beta1

Update:
- acceleratedmobilepageurl_v1
- adexchangebuyer2_v2beta1
- adexchangebuyer_v1_4
- adsense_v1_4
- adsensehost_v4_1
- analytics_v3
- analyticsreporting_v4
- androidenterprise_v1
- androidpublisher_v2
- appengine_v1
- appsactivity_v1
- appstate_v1
- bigquery_v2
- calendar_v3
- classroom_v1
- cloudbilling_v1
- cloudbuild_v1
- clouddebugger_v2
- clouderrorreporting_v1beta1
- cloudfunctions_v1
- cloudkms_v1
- cloudmonitoring_v2beta2
- cloudresourcemanager_v1
- compute_beta
- compute_v1
- container_v1
- content_v2
- dataflow_v1b3
- dataproc_v1
- datastore_v1
- deploymentmanager_v2
- dfareporting_v2_8
- dns_v1
- doubleclicksearch_v2
- drive_v3
- firebasedynamiclinks_v1
- firebaserules_v1
- fitness_v1
- games_configuration_v1configuration
- games_management_v1management
- games_v1
- genomics_v1
- gmail_v1
- iam_v1
- identitytoolkit_v3
- language_v1
- logging_v2
- manufacturers_v1
- ml_v1
- monitoring_v3
- oauth2_v2
- partners_v2
- people_v1
- plus_domains_v1
- plus_v1
- proximitybeacon_v1beta1
- pubsub_v1
- runtimeconfig_v1
- script_v1
- searchconsole_v1
- servicecontrol_v1
- servicemanagement_v1
- serviceuser_v1
- sheets_v4
- slides_v1
- sourcerepo_v1
- spanner_v1
- sqladmin_v1beta4
- storage_v1
- storagetransfer_v1
- toolresults_v1beta3
- vision_v1
- webmasters_v3
- youtube_analytics_v1
- youtube_partner_v1
- youtubereporting_v1
This commit is contained in:
Google APIs committed 2017-08-25 19:54:22 +00:00
1 parent ce32deabcf
commit 2dd396ce6e
315 files changed
+158012 -116092

No files matched your search

@@ -0,0 +1,797 @@
# 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 CloudtraceV2
# Text annotation with a set of attributes.
class Annotation
include Google::Apis::Core::Hashable
# A set of attributes, each in the format `[KEY]:[VALUE]`.
# Corresponds to the JSON property `attributes`
# @return [Google::Apis::CloudtraceV2::Attributes]
attr_accessor :attributes
# Represents a string that might be shortened to a specified length.
# Corresponds to the JSON property `description`
# @return [Google::Apis::CloudtraceV2::TruncatableString]
attr_accessor :description
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@attributes = args[:attributes] if args.key?(:attributes)
@description = args[:description] if args.key?(:description)
end
end
# The allowed types for [VALUE] in a `[KEY]:[VALUE]` attribute.
class AttributeValue
include Google::Apis::Core::Hashable
# A Boolean value represented by `true` or `false`.
# Corresponds to the JSON property `boolValue`
# @return [Boolean]
attr_accessor :bool_value
alias_method :bool_value?, :bool_value
# A 64-bit signed integer.
# Corresponds to the JSON property `intValue`
# @return [Fixnum]
attr_accessor :int_value
# Represents a string that might be shortened to a specified length.
# Corresponds to the JSON property `stringValue`
# @return [Google::Apis::CloudtraceV2::TruncatableString]
attr_accessor :string_value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@bool_value = args[:bool_value] if args.key?(:bool_value)
@int_value = args[:int_value] if args.key?(:int_value)
@string_value = args[:string_value] if args.key?(:string_value)
end
end
# A set of attributes, each in the format `[KEY]:[VALUE]`.
class Attributes
include Google::Apis::Core::Hashable
# The set of attributes. Each attribute's key can be up to 128 bytes
# long. The value can be a string up to 256 bytes, an integer, or the
# Boolean values `true` and `false`. For example:
# "/instance_id": "my-instance"
# "/http/user_agent": ""
# "/http/request_bytes": 300
# "abc.com/myattribute": true
# Corresponds to the JSON property `attributeMap`
# @return [Hash<String,Google::Apis::CloudtraceV2::AttributeValue>]
attr_accessor :attribute_map
# The number of attributes that were discarded. Attributes can be discarded
# because their keys are too long or because there are too many attributes.
# If this value is 0 then all attributes are valid.
# Corresponds to the JSON property `droppedAttributesCount`
# @return [Fixnum]
attr_accessor :dropped_attributes_count
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@attribute_map = args[:attribute_map] if args.key?(:attribute_map)
@dropped_attributes_count = args[:dropped_attributes_count] if args.key?(:dropped_attributes_count)
end
end
# The request message for the `BatchWriteSpans` method.
class BatchWriteSpansRequest
include Google::Apis::Core::Hashable
# A collection of spans.
# Corresponds to the JSON property `spans`
# @return [Array<Google::Apis::CloudtraceV2::Span>]
attr_accessor :spans
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@spans = args[:spans] if args.key?(:spans)
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 pointer from the current span to another span in the same trace or in a
# different trace. For example, this can be used in batching operations,
# where a single batch handler processes multiple requests from different
# traces or when the handler receives a request from a different project.
class Link
include Google::Apis::Core::Hashable
# A set of attributes, each in the format `[KEY]:[VALUE]`.
# Corresponds to the JSON property `attributes`
# @return [Google::Apis::CloudtraceV2::Attributes]
attr_accessor :attributes
# `SPAN_ID` identifies a span within a trace.
# Corresponds to the JSON property `spanId`
# @return [String]
attr_accessor :span_id
# `TRACE_ID` identifies a trace within a project.
# Corresponds to the JSON property `traceId`
# @return [String]
attr_accessor :trace_id
# The relationship of the current span relative to the linked span.
# Corresponds to the JSON property `type`
# @return [String]
attr_accessor :type
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@attributes = args[:attributes] if args.key?(:attributes)
@span_id = args[:span_id] if args.key?(:span_id)
@trace_id = args[:trace_id] if args.key?(:trace_id)
@type = args[:type] if args.key?(:type)
end
end
# A collection of links, which are references from this span to a span
# in the same or different trace.
class Links
include Google::Apis::Core::Hashable
# The number of dropped links after the maximum size was enforced. If
# this value is 0, then no links were dropped.
# Corresponds to the JSON property `droppedLinksCount`
# @return [Fixnum]
attr_accessor :dropped_links_count
# A collection of links.
# Corresponds to the JSON property `link`
# @return [Array<Google::Apis::CloudtraceV2::Link>]
attr_accessor :link
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@dropped_links_count = args[:dropped_links_count] if args.key?(:dropped_links_count)
@link = args[:link] if args.key?(:link)
end
end
# The response message for the `ListSpans` method.
class ListSpansResponse
include Google::Apis::Core::Hashable
# If defined, indicates that there might be more spans that match the
# request. Pass this as the value of `pageToken` in a subsequent request to
# retrieve additional spans.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
# The requested spans, if there are any in the specified trace.
# Corresponds to the JSON property `spans`
# @return [Array<Google::Apis::CloudtraceV2::Span>]
attr_accessor :spans
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)
@spans = args[:spans] if args.key?(:spans)
end
end
# The response message for the `ListTraces` method.
class ListTracesResponse
include Google::Apis::Core::Hashable
# If there might be more results than those appearing in this response, then
# `next_page_token` is included. To get the next set of results, call this
# method again using the value of `next_page_token` as `page_token`.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
# List of trace records returned.
# Corresponds to the JSON property `traces`
# @return [Array<Google::Apis::CloudtraceV2::Trace>]
attr_accessor :traces
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)
@traces = args[:traces] if args.key?(:traces)
end
end
# Binary module.
class Module
include Google::Apis::Core::Hashable
# Represents a string that might be shortened to a specified length.
# Corresponds to the JSON property `buildId`
# @return [Google::Apis::CloudtraceV2::TruncatableString]
attr_accessor :build_id
# Represents a string that might be shortened to a specified length.
# Corresponds to the JSON property `module`
# @return [Google::Apis::CloudtraceV2::TruncatableString]
attr_accessor :module
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@build_id = args[:build_id] if args.key?(:build_id)
@module = args[:module] if args.key?(:module)
end
end
# An event describing an RPC message sent or received on the network.
class NetworkEvent
include Google::Apis::Core::Hashable
# An identifier for the message, which must be unique in this span.
# Corresponds to the JSON property `messageId`
# @return [Fixnum]
attr_accessor :message_id
# The number of bytes sent or received.
# Corresponds to the JSON property `messageSize`
# @return [Fixnum]
attr_accessor :message_size
# For sent messages, this is the time at which the first bit was sent.
# For received messages, this is the time at which the last bit was
# received.
# Corresponds to the JSON property `time`
# @return [String]
attr_accessor :time
# Type of NetworkEvent. Indicates whether the RPC message was sent or
# received.
# Corresponds to the JSON property `type`
# @return [String]
attr_accessor :type
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@message_id = args[:message_id] if args.key?(:message_id)
@message_size = args[:message_size] if args.key?(:message_size)
@time = args[:time] if args.key?(:time)
@type = args[:type] if args.key?(:type)
end
end
# A span represents a single operation within a trace. Spans can be
# nested to form a trace tree. Often, a trace contains a root span
# that describes the end-to-end latency, and one or more subspans for
# its sub-operations. A trace can also contain multiple root spans,
# or none at all. Spans do not need to be contiguous&mdash;there may be
# gaps or overlaps between spans in a trace.
class Span
include Google::Apis::Core::Hashable
# A set of attributes, each in the format `[KEY]:[VALUE]`.
# Corresponds to the JSON property `attributes`
# @return [Google::Apis::CloudtraceV2::Attributes]
attr_accessor :attributes
# An optional number of child spans that were generated while this span
# was active. If set, allows implementation to detect missing child spans.
# Corresponds to the JSON property `childSpanCount`
# @return [Fixnum]
attr_accessor :child_span_count
# Represents a string that might be shortened to a specified length.
# Corresponds to the JSON property `displayName`
# @return [Google::Apis::CloudtraceV2::TruncatableString]
attr_accessor :display_name
# The end time of the span. On the client side, this is the time kept by
# the local machine where the span execution ends. On the server side, this
# is the time when the server application handler stops running.
# Corresponds to the JSON property `endTime`
# @return [String]
attr_accessor :end_time
# A collection of links, which are references from this span to a span
# in the same or different trace.
# Corresponds to the JSON property `links`
# @return [Google::Apis::CloudtraceV2::Links]
attr_accessor :links
# The resource name of the span in the following format:
# projects/[PROJECT_ID]traces/[TRACE_ID]/spans/SPAN_ID is a unique
# identifier for a trace within a project.
# [SPAN_ID] is a unique identifier for a span within a trace,
# assigned when the span is created.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# The [SPAN_ID] of this span's parent span. If this is a root span,
# then this field must be empty.
# Corresponds to the JSON property `parentSpanId`
# @return [String]
attr_accessor :parent_span_id
# A highly recommended but not required flag that identifies when a trace
# crosses a process boundary. True when the parent_span belongs to the
# same process as the current span.
# Corresponds to the JSON property `sameProcessAsParentSpan`
# @return [Boolean]
attr_accessor :same_process_as_parent_span
alias_method :same_process_as_parent_span?, :same_process_as_parent_span
# The [SPAN_ID] portion of the span's resource name.
# Corresponds to the JSON property `spanId`
# @return [String]
attr_accessor :span_id
# A call stack appearing in a trace.
# Corresponds to the JSON property `stackTrace`
# @return [Google::Apis::CloudtraceV2::StackTrace]
attr_accessor :stack_trace
# The start time of the span. On the client side, this is the time kept by
# the local machine where the span execution starts. On the server side, this
# is the time when the server's application handler starts running.
# Corresponds to the JSON property `startTime`
# @return [String]
attr_accessor :start_time
# 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 needs
# # Overview
# The `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 mapping
# The `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 uses
# The 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 `status`
# @return [Google::Apis::CloudtraceV2::Status]
attr_accessor :status
# A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation
# on the span, consisting of either user-supplied key:value pairs, or
# details of an RPC message sent/received on the network.
# Corresponds to the JSON property `timeEvents`
# @return [Google::Apis::CloudtraceV2::TimeEvents]
attr_accessor :time_events
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@attributes = args[:attributes] if args.key?(:attributes)
@child_span_count = args[:child_span_count] if args.key?(:child_span_count)
@display_name = args[:display_name] if args.key?(:display_name)
@end_time = args[:end_time] if args.key?(:end_time)
@links = args[:links] if args.key?(:links)
@name = args[:name] if args.key?(:name)
@parent_span_id = args[:parent_span_id] if args.key?(:parent_span_id)
@same_process_as_parent_span = args[:same_process_as_parent_span] if args.key?(:same_process_as_parent_span)
@span_id = args[:span_id] if args.key?(:span_id)
@stack_trace = args[:stack_trace] if args.key?(:stack_trace)
@start_time = args[:start_time] if args.key?(:start_time)
@status = args[:status] if args.key?(:status)
@time_events = args[:time_events] if args.key?(:time_events)
end
end
# Represents a single stack frame in a stack trace.
class StackFrame
include Google::Apis::Core::Hashable
# The column number where the function call appears, if available.
# This is important in JavaScript because of its anonymous functions.
# Corresponds to the JSON property `columnNumber`
# @return [Fixnum]
attr_accessor :column_number
# Represents a string that might be shortened to a specified length.
# Corresponds to the JSON property `fileName`
# @return [Google::Apis::CloudtraceV2::TruncatableString]
attr_accessor :file_name
# Represents a string that might be shortened to a specified length.
# Corresponds to the JSON property `functionName`
# @return [Google::Apis::CloudtraceV2::TruncatableString]
attr_accessor :function_name
# The line number in `file_name` where the function call appears.
# Corresponds to the JSON property `lineNumber`
# @return [Fixnum]
attr_accessor :line_number
# Binary module.
# Corresponds to the JSON property `loadModule`
# @return [Google::Apis::CloudtraceV2::Module]
attr_accessor :load_module
# Represents a string that might be shortened to a specified length.
# Corresponds to the JSON property `originalFunctionName`
# @return [Google::Apis::CloudtraceV2::TruncatableString]
attr_accessor :original_function_name
# Represents a string that might be shortened to a specified length.
# Corresponds to the JSON property `sourceVersion`
# @return [Google::Apis::CloudtraceV2::TruncatableString]
attr_accessor :source_version
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@column_number = args[:column_number] if args.key?(:column_number)
@file_name = args[:file_name] if args.key?(:file_name)
@function_name = args[:function_name] if args.key?(:function_name)
@line_number = args[:line_number] if args.key?(:line_number)
@load_module = args[:load_module] if args.key?(:load_module)
@original_function_name = args[:original_function_name] if args.key?(:original_function_name)
@source_version = args[:source_version] if args.key?(:source_version)
end
end
# A collection of stack frames, which can be truncated.
class StackFrames
include Google::Apis::Core::Hashable
# The number of stack frames that were dropped because there
# were too many stack frames.
# If this value is 0, then no stack frames were dropped.
# Corresponds to the JSON property `droppedFramesCount`
# @return [Fixnum]
attr_accessor :dropped_frames_count
# Stack frames in this call stack.
# Corresponds to the JSON property `frame`
# @return [Array<Google::Apis::CloudtraceV2::StackFrame>]
attr_accessor :frame
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@dropped_frames_count = args[:dropped_frames_count] if args.key?(:dropped_frames_count)
@frame = args[:frame] if args.key?(:frame)
end
end
# A call stack appearing in a trace.
class StackTrace
include Google::Apis::Core::Hashable
# A collection of stack frames, which can be truncated.
# Corresponds to the JSON property `stackFrames`
# @return [Google::Apis::CloudtraceV2::StackFrames]
attr_accessor :stack_frames
# The hash ID is used to conserve network bandwidth for duplicate
# stack traces within a single trace.
# Often multiple spans will have identical stack traces.
# The first occurrence of a stack trace should contain both the
# `stackFrame` content and a value in `stackTraceHashId`.
# Subsequent spans within the same request can refer
# to that stack trace by only setting `stackTraceHashId`.
# Corresponds to the JSON property `stackTraceHashId`
# @return [Fixnum]
attr_accessor :stack_trace_hash_id
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@stack_frames = args[:stack_frames] if args.key?(:stack_frames)
@stack_trace_hash_id = args[:stack_trace_hash_id] if args.key?(:stack_trace_hash_id)
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 needs
# # Overview
# The `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 mapping
# The `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 uses
# The 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<Hash<String,Object>>]
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 time-stamped annotation or network event in the Span.
class TimeEvent
include Google::Apis::Core::Hashable
# Text annotation with a set of attributes.
# Corresponds to the JSON property `annotation`
# @return [Google::Apis::CloudtraceV2::Annotation]
attr_accessor :annotation
# An event describing an RPC message sent or received on the network.
# Corresponds to the JSON property `networkEvent`
# @return [Google::Apis::CloudtraceV2::NetworkEvent]
attr_accessor :network_event
# The timestamp indicating the time the event occurred.
# Corresponds to the JSON property `time`
# @return [String]
attr_accessor :time
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@annotation = args[:annotation] if args.key?(:annotation)
@network_event = args[:network_event] if args.key?(:network_event)
@time = args[:time] if args.key?(:time)
end
end
# A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation
# on the span, consisting of either user-supplied key:value pairs, or
# details of an RPC message sent/received on the network.
class TimeEvents
include Google::Apis::Core::Hashable
# The number of dropped annotations in all the included time events.
# If the value is 0, then no annotations were dropped.
# Corresponds to the JSON property `droppedAnnotationsCount`
# @return [Fixnum]
attr_accessor :dropped_annotations_count
# The number of dropped network events in all the included time events.
# If the value is 0, then no network events were dropped.
# Corresponds to the JSON property `droppedNetworkEventsCount`
# @return [Fixnum]
attr_accessor :dropped_network_events_count
# A collection of `TimeEvent`s.
# Corresponds to the JSON property `timeEvent`
# @return [Array<Google::Apis::CloudtraceV2::TimeEvent>]
attr_accessor :time_event
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@dropped_annotations_count = args[:dropped_annotations_count] if args.key?(:dropped_annotations_count)
@dropped_network_events_count = args[:dropped_network_events_count] if args.key?(:dropped_network_events_count)
@time_event = args[:time_event] if args.key?(:time_event)
end
end
# A trace describes how long it takes for an application to perform some
# operations. It consists of a set of spans, each representing
# an operation and including time information and operation details.
class Trace
include Google::Apis::Core::Hashable
# The resource name of the trace in the following format:
# projects/[PROJECT_ID]/traces/TRACE_ID is a unique identifier for a trace
# within a project.
# The ID is assigned when the trace is created.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@name = args[:name] if args.key?(:name)
end
end
# Represents a string that might be shortened to a specified length.
class TruncatableString
include Google::Apis::Core::Hashable
# The number of bytes removed from the original string. If this
# value is 0, then the string was not shortened.
# Corresponds to the JSON property `truncatedByteCount`
# @return [Fixnum]
attr_accessor :truncated_byte_count
# The shortened string. For example, if the original string was 500
# bytes long and the limit of the string was 128 bytes, then this
# value contains the first 128 bytes of the 500-byte string. Note that
# truncation always happens on the character boundary, to ensure that
# truncated string is still valid UTF8. In case of multi-byte characters,
# size of truncated string can be less than truncation limit.
# Corresponds to the JSON property `value`
# @return [String]
attr_accessor :value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@truncated_byte_count = args[:truncated_byte_count] if args.key?(:truncated_byte_count)
@value = args[:value] if args.key?(:value)
end
end
end
end
end
@@ -0,0 +1,353 @@
# 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 CloudtraceV2
class Annotation
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class AttributeValue
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Attributes
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class BatchWriteSpansRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Empty
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Link
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Links
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListSpansResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListTracesResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Module
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class NetworkEvent
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Span
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class StackFrame
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class StackFrames
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class StackTrace
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Status
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class TimeEvent
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class TimeEvents
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Trace
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class TruncatableString
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Annotation
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :attributes, as: 'attributes', class: Google::Apis::CloudtraceV2::Attributes, decorator: Google::Apis::CloudtraceV2::Attributes::Representation
property :description, as: 'description', class: Google::Apis::CloudtraceV2::TruncatableString, decorator: Google::Apis::CloudtraceV2::TruncatableString::Representation
end
end
class AttributeValue
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :bool_value, as: 'boolValue'
property :int_value, :numeric_string => true, as: 'intValue'
property :string_value, as: 'stringValue', class: Google::Apis::CloudtraceV2::TruncatableString, decorator: Google::Apis::CloudtraceV2::TruncatableString::Representation
end
end
class Attributes
# @private
class Representation < Google::Apis::Core::JsonRepresentation
hash :attribute_map, as: 'attributeMap', class: Google::Apis::CloudtraceV2::AttributeValue, decorator: Google::Apis::CloudtraceV2::AttributeValue::Representation
property :dropped_attributes_count, as: 'droppedAttributesCount'
end
end
class BatchWriteSpansRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :spans, as: 'spans', class: Google::Apis::CloudtraceV2::Span, decorator: Google::Apis::CloudtraceV2::Span::Representation
end
end
class Empty
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class Link
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :attributes, as: 'attributes', class: Google::Apis::CloudtraceV2::Attributes, decorator: Google::Apis::CloudtraceV2::Attributes::Representation
property :span_id, as: 'spanId'
property :trace_id, as: 'traceId'
property :type, as: 'type'
end
end
class Links
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :dropped_links_count, as: 'droppedLinksCount'
collection :link, as: 'link', class: Google::Apis::CloudtraceV2::Link, decorator: Google::Apis::CloudtraceV2::Link::Representation
end
end
class ListSpansResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :next_page_token, as: 'nextPageToken'
collection :spans, as: 'spans', class: Google::Apis::CloudtraceV2::Span, decorator: Google::Apis::CloudtraceV2::Span::Representation
end
end
class ListTracesResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :next_page_token, as: 'nextPageToken'
collection :traces, as: 'traces', class: Google::Apis::CloudtraceV2::Trace, decorator: Google::Apis::CloudtraceV2::Trace::Representation
end
end
class Module
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :build_id, as: 'buildId', class: Google::Apis::CloudtraceV2::TruncatableString, decorator: Google::Apis::CloudtraceV2::TruncatableString::Representation
property :module, as: 'module', class: Google::Apis::CloudtraceV2::TruncatableString, decorator: Google::Apis::CloudtraceV2::TruncatableString::Representation
end
end
class NetworkEvent
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :message_id, :numeric_string => true, as: 'messageId'
property :message_size, :numeric_string => true, as: 'messageSize'
property :time, as: 'time'
property :type, as: 'type'
end
end
class Span
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :attributes, as: 'attributes', class: Google::Apis::CloudtraceV2::Attributes, decorator: Google::Apis::CloudtraceV2::Attributes::Representation
property :child_span_count, as: 'childSpanCount'
property :display_name, as: 'displayName', class: Google::Apis::CloudtraceV2::TruncatableString, decorator: Google::Apis::CloudtraceV2::TruncatableString::Representation
property :end_time, as: 'endTime'
property :links, as: 'links', class: Google::Apis::CloudtraceV2::Links, decorator: Google::Apis::CloudtraceV2::Links::Representation
property :name, as: 'name'
property :parent_span_id, as: 'parentSpanId'
property :same_process_as_parent_span, as: 'sameProcessAsParentSpan'
property :span_id, as: 'spanId'
property :stack_trace, as: 'stackTrace', class: Google::Apis::CloudtraceV2::StackTrace, decorator: Google::Apis::CloudtraceV2::StackTrace::Representation
property :start_time, as: 'startTime'
property :status, as: 'status', class: Google::Apis::CloudtraceV2::Status, decorator: Google::Apis::CloudtraceV2::Status::Representation
property :time_events, as: 'timeEvents', class: Google::Apis::CloudtraceV2::TimeEvents, decorator: Google::Apis::CloudtraceV2::TimeEvents::Representation
end
end
class StackFrame
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :column_number, :numeric_string => true, as: 'columnNumber'
property :file_name, as: 'fileName', class: Google::Apis::CloudtraceV2::TruncatableString, decorator: Google::Apis::CloudtraceV2::TruncatableString::Representation
property :function_name, as: 'functionName', class: Google::Apis::CloudtraceV2::TruncatableString, decorator: Google::Apis::CloudtraceV2::TruncatableString::Representation
property :line_number, :numeric_string => true, as: 'lineNumber'
property :load_module, as: 'loadModule', class: Google::Apis::CloudtraceV2::Module, decorator: Google::Apis::CloudtraceV2::Module::Representation
property :original_function_name, as: 'originalFunctionName', class: Google::Apis::CloudtraceV2::TruncatableString, decorator: Google::Apis::CloudtraceV2::TruncatableString::Representation
property :source_version, as: 'sourceVersion', class: Google::Apis::CloudtraceV2::TruncatableString, decorator: Google::Apis::CloudtraceV2::TruncatableString::Representation
end
end
class StackFrames
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :dropped_frames_count, as: 'droppedFramesCount'
collection :frame, as: 'frame', class: Google::Apis::CloudtraceV2::StackFrame, decorator: Google::Apis::CloudtraceV2::StackFrame::Representation
end
end
class StackTrace
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :stack_frames, as: 'stackFrames', class: Google::Apis::CloudtraceV2::StackFrames, decorator: Google::Apis::CloudtraceV2::StackFrames::Representation
property :stack_trace_hash_id, :numeric_string => true, as: 'stackTraceHashId'
end
end
class Status
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :code, as: 'code'
collection :details, as: 'details'
property :message, as: 'message'
end
end
class TimeEvent
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :annotation, as: 'annotation', class: Google::Apis::CloudtraceV2::Annotation, decorator: Google::Apis::CloudtraceV2::Annotation::Representation
property :network_event, as: 'networkEvent', class: Google::Apis::CloudtraceV2::NetworkEvent, decorator: Google::Apis::CloudtraceV2::NetworkEvent::Representation
property :time, as: 'time'
end
end
class TimeEvents
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :dropped_annotations_count, as: 'droppedAnnotationsCount'
property :dropped_network_events_count, as: 'droppedNetworkEventsCount'
collection :time_event, as: 'timeEvent', class: Google::Apis::CloudtraceV2::TimeEvent, decorator: Google::Apis::CloudtraceV2::TimeEvent::Representation
end
end
class Trace
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :name, as: 'name'
end
end
class TruncatableString
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :truncated_byte_count, as: 'truncatedByteCount'
property :value, as: 'value'
end
end
end
end
end
@@ -0,0 +1,238 @@
# 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 '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 CloudtraceV2
# Stackdriver Trace API
#
# Send and retrieve trace data from Stackdriver Trace. Data is generated and
# available by default for all App Engine applications. Data from other
# applications can be written to Stackdriver Trace for display, reporting, and
# analysis.
#
# @example
# require 'google/apis/cloudtrace_v2'
#
# Cloudtrace = Google::Apis::CloudtraceV2 # Alias the module
# service = Cloudtrace::CloudTraceService.new
#
# @see https://cloud.google.com/trace
class CloudTraceService < Google::Apis::Core::BaseService
# @return [String]
# API key. Your API key identifies your project and provides you with API access,
# quota, and reports. Required unless you provide an OAuth 2.0 token.
attr_accessor :key
# @return [String]
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
attr_accessor :quota_user
def initialize
super('https://cloudtrace.googleapis.com/', '')
@batch_path = 'batch'
end
# Sends new spans to Stackdriver Trace or updates existing traces. If the
# name of a trace that you send matches that of an existing trace, new spans
# are added to the existing trace. Attempt to update existing spans results
# undefined behavior. If the name does not match, a new trace is created
# with given set of spans.
# @param [String] name
# Required. Name of the project where the spans belong. The format is
# `projects/PROJECT_ID`.
# @param [Google::Apis::CloudtraceV2::BatchWriteSpansRequest] batch_write_spans_request_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::CloudtraceV2::Empty] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::CloudtraceV2::Empty]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def batch_trace_write_spans(name, batch_write_spans_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v2/{+name}/traces:batchWrite', options)
command.request_representation = Google::Apis::CloudtraceV2::BatchWriteSpansRequest::Representation
command.request_object = batch_write_spans_request_object
command.response_representation = Google::Apis::CloudtraceV2::Empty::Representation
command.response_class = Google::Apis::CloudtraceV2::Empty
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Returns of a list of traces that match the specified filter conditions.
# @param [String] parent
# Required. The project where the trace data is stored. The format
# is `projects/PROJECT_ID`.
# @param [String] end_time
# Optional. Do not return traces whose start time is later than this time.
# @param [String] filter
# Opional. Return only traces that match this
# [trace filter](/trace/docs/trace-filters). Example:
# "label:/http/url root:/_ah/background my_label:17"
# @param [String] order_by
# Optional. A single field used to sort the returned traces.
# Only the following field names can be used:
# * `trace_id`: the trace's ID field
# * `name`: the root span's resource name
# * `duration`: the difference between the root span's start time and end time
# * `start`: the start time of the root span
# Sorting is in ascending order unless `desc` is appended to the sort field name.
# Example: `"name desc"`).
# @param [Fixnum] page_size
# Optional. The maximum number of results to return from this request.
# Non-positive values are ignored. The presence of `next_page_token` in the
# response indicates that more results might be available, even if fewer than
# the maximum number of results is returned by this request.
# @param [String] page_token
# Optional. If present, then retrieve the next batch of results from the
# preceding call to this method. `page_token` must be the value of
# `next_page_token` from the previous response. The values of other method
# parameters should be identical to those in the previous call.
# @param [String] start_time
# Optional. Do not return traces whose end time is earlier than this time.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::CloudtraceV2::ListTracesResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::CloudtraceV2::ListTracesResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_project_traces(parent, end_time: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil, start_time: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v2/{+parent}/traces', options)
command.response_representation = Google::Apis::CloudtraceV2::ListTracesResponse::Representation
command.response_class = Google::Apis::CloudtraceV2::ListTracesResponse
command.params['parent'] = parent unless parent.nil?
command.query['endTime'] = end_time unless end_time.nil?
command.query['filter'] = filter unless filter.nil?
command.query['orderBy'] = order_by unless order_by.nil?
command.query['pageSize'] = page_size unless page_size.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['startTime'] = start_time unless start_time.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Returns a list of spans within a trace.
# @param [String] parent
# Required: The resource name of the trace containing the spans to list.
# The format is `projects/PROJECT_ID/traces/TRACE_ID`.
# @param [String] page_token
# Optional. If present, then retrieve the next batch of results from the
# preceding call to this method. `page_token` must be the value of
# `next_page_token` from the previous response. The values of other method
# parameters should be identical to those in the previous call.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::CloudtraceV2::ListSpansResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::CloudtraceV2::ListSpansResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_project_trace_spans(parent, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v2/{+parent}:listSpans', options)
command.response_representation = Google::Apis::CloudtraceV2::ListSpansResponse::Representation
command.response_class = Google::Apis::CloudtraceV2::ListSpansResponse
command.params['parent'] = parent unless parent.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Creates a new Span.
# @param [String] name
# The resource name of the span in the following format:
# projects/[PROJECT_ID]traces/[TRACE_ID]/spans/SPAN_ID is a unique
# identifier for a trace within a project.
# [SPAN_ID] is a unique identifier for a span within a trace,
# assigned when the span is created.
# @param [Google::Apis::CloudtraceV2::Span] span_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::CloudtraceV2::Span] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::CloudtraceV2::Span]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def create_project_trace_span(name, span_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:put, 'v2/{+name}', options)
command.request_representation = Google::Apis::CloudtraceV2::Span::Representation
command.request_object = span_object
command.response_representation = Google::Apis::CloudtraceV2::Span::Representation
command.response_class = Google::Apis::CloudtraceV2::Span
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
protected
def apply_command_defaults(command)
command.query['key'] = key unless key.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
end
end
end
end
end