Skip to content

Commit

Permalink
feat: Automated regeneration of ChromeUXReport client (#10807)
Browse files Browse the repository at this point in the history
Auto-created at 2024-03-12 01:16:30 +0000 using the toys pull request generator.
  • Loading branch information
yoshi-code-bot authored Mar 12, 2024
1 parent 9595e4b commit 7ad2cfb
Show file tree
Hide file tree
Showing 12 changed files with 477 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,67 @@ defmodule GoogleApi.ChromeUXReport.V1.Api.Records do

@library_version Mix.Project.config() |> Keyword.get(:version, "")

@doc """
Queries the Chrome User Experience Report for a timeseries `history record` for a given site. Returns a `history record` that contains one or more `metric timeseries` corresponding to performance data about the requested site.
## Parameters
* `connection` (*type:* `GoogleApi.ChromeUXReport.V1.Connection.t`) - Connection to server
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - 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.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:body` (*type:* `GoogleApi.ChromeUXReport.V1.Model.QueryHistoryRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.ChromeUXReport.V1.Model.QueryHistoryResponse{}}` on success
* `{:error, info}` on failure
"""
@spec chromeuxreport_records_query_history_record(Tesla.Env.client(), keyword(), keyword()) ::
{:ok, GoogleApi.ChromeUXReport.V1.Model.QueryHistoryResponse.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def chromeuxreport_records_query_history_record(connection, optional_params \\ [], opts \\ []) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:body => :body
}

request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/records:queryHistoryRecord", %{})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)

connection
|> Connection.execute(request)
|> Response.decode(
opts ++ [struct: %GoogleApi.ChromeUXReport.V1.Model.QueryHistoryResponse{}]
)
end

@doc """
Queries the Chrome User Experience for a single `record` for a given site. Returns a `record` that contains one or more `metrics` corresponding to performance data about the requested site.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.ChromeUXReport.V1 do
API client metadata for GoogleApi.ChromeUXReport.V1.
"""

@discovery_revision "20220919"
@discovery_revision "20240307"

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

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

defmodule GoogleApi.ChromeUXReport.V1.Model.FractionTimeseries do
@moduledoc """
For enum metrics, provides fraction timeseries which add up to approximately 1.0 per entry (k-th element into the repeated fractions field for any k <= len) across fraction_timeseries.
## Attributes
* `fractions` (*type:* `list(float())`, *default:* `nil`) - Values between 0.0 and 1.0 (inclusive) and NaN.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:fractions => list(float()) | nil
}

field(:fractions, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.ChromeUXReport.V1.Model.FractionTimeseries do
def decode(value, options) do
GoogleApi.ChromeUXReport.V1.Model.FractionTimeseries.decode(value, options)
end
end

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

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

defmodule GoogleApi.ChromeUXReport.V1.Model.HistoryKey do
@moduledoc """
Key defines all the dimensions that identify this record as unique.
## Attributes
* `formFactor` (*type:* `String.t`, *default:* `nil`) - The form factor is the device class that all users used to access the site for this record. If the form factor is unspecified, then aggregated data over all form factors will be returned.
* `origin` (*type:* `String.t`, *default:* `nil`) - Origin specifies the origin that this record is for. Note: When specifying an origin, data for loads under this origin over all pages are aggregated into origin level user experience data.
* `url` (*type:* `String.t`, *default:* `nil`) - Url specifies a specific url that this record is for. This url should be normalized, following the normalization actions taken in the request to increase the chances of successful lookup. Note: When specifying a "url" only data for that specific url will be aggregated.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:formFactor => String.t() | nil,
:origin => String.t() | nil,
:url => String.t() | nil
}

field(:formFactor)
field(:origin)
field(:url)
end

defimpl Poison.Decoder, for: GoogleApi.ChromeUXReport.V1.Model.HistoryKey do
def decode(value, options) do
GoogleApi.ChromeUXReport.V1.Model.HistoryKey.decode(value, options)
end
end

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

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

defmodule GoogleApi.ChromeUXReport.V1.Model.HistoryRecord do
@moduledoc """
HistoryRecord is a timeseries of Chrome UX Report data. It contains user experience statistics for a single url pattern and a set of dimensions.
## Attributes
* `collectionPeriods` (*type:* `list(GoogleApi.ChromeUXReport.V1.Model.CollectionPeriod.t)`, *default:* `nil`) - The collection periods indicate when each of the data points reflected in the time series data in metrics was collected. Note that all the time series share the same collection periods, and it is enforced in the CrUX pipeline that every time series has the same number of data points.
* `key` (*type:* `GoogleApi.ChromeUXReport.V1.Model.HistoryKey.t`, *default:* `nil`) - Key defines all of the unique querying parameters needed to look up a user experience history record.
* `metrics` (*type:* `%{optional(String.t) => GoogleApi.ChromeUXReport.V1.Model.MetricTimeseries.t}`, *default:* `nil`) - Metrics is the map of user experience time series data available for the record defined in the key field. Metrics are keyed on the metric name. Allowed key values: ["first_contentful_paint", "first_input_delay", "largest_contentful_paint", "cumulative_layout_shift", "experimental_time_to_first_byte", "experimental_interaction_to_next_paint"]
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:collectionPeriods =>
list(GoogleApi.ChromeUXReport.V1.Model.CollectionPeriod.t()) | nil,
:key => GoogleApi.ChromeUXReport.V1.Model.HistoryKey.t() | nil,
:metrics =>
%{optional(String.t()) => GoogleApi.ChromeUXReport.V1.Model.MetricTimeseries.t()}
| nil
}

field(:collectionPeriods, as: GoogleApi.ChromeUXReport.V1.Model.CollectionPeriod, type: :list)
field(:key, as: GoogleApi.ChromeUXReport.V1.Model.HistoryKey)
field(:metrics, as: GoogleApi.ChromeUXReport.V1.Model.MetricTimeseries, type: :map)
end

defimpl Poison.Decoder, for: GoogleApi.ChromeUXReport.V1.Model.HistoryRecord do
def decode(value, options) do
GoogleApi.ChromeUXReport.V1.Model.HistoryRecord.decode(value, options)
end
end

defimpl Poison.Encoder, for: GoogleApi.ChromeUXReport.V1.Model.HistoryRecord do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,20 @@ defmodule GoogleApi.ChromeUXReport.V1.Model.Metric do
## Attributes
* `fractions` (*type:* `map()`, *default:* `nil`) - For enum metrics, provides fractions which add up to approximately 1.0.
* `histogram` (*type:* `list(GoogleApi.ChromeUXReport.V1.Model.Bin.t)`, *default:* `nil`) - The histogram of user experiences for a metric. The histogram will have at least one bin and the densities of all bins will add up to ~1.
* `percentiles` (*type:* `GoogleApi.ChromeUXReport.V1.Model.Percentiles.t`, *default:* `nil`) - Common useful percentiles of the Metric. The value type for the percentiles will be the same as the value types given for the Histogram bins.
* `percentiles` (*type:* `GoogleApi.ChromeUXReport.V1.Model.Percentiles.t`, *default:* `nil`) - Commonly useful percentiles of the Metric. The value type for the percentiles will be the same as the value types given for the Histogram bins.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:fractions => map() | nil,
:histogram => list(GoogleApi.ChromeUXReport.V1.Model.Bin.t()) | nil,
:percentiles => GoogleApi.ChromeUXReport.V1.Model.Percentiles.t() | nil
}

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

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

defmodule GoogleApi.ChromeUXReport.V1.Model.MetricTimeseries do
@moduledoc """
A `metric timeseries` is a set of user experience data for a single web performance metric, like "first contentful paint". It contains a summary histogram of real world Chrome usage as a series of `bins`, where each bin has density values for a particular time period.
## Attributes
* `fractionTimeseries` (*type:* `%{optional(String.t) => GoogleApi.ChromeUXReport.V1.Model.FractionTimeseries.t}`, *default:* `nil`) - Mapping from labels to timeseries of fractions attributed to this label.
* `histogramTimeseries` (*type:* `list(GoogleApi.ChromeUXReport.V1.Model.TimeseriesBin.t)`, *default:* `nil`) - The histogram of user experiences for a metric. The histogram will have at least one bin and the densities of all bins will add up to ~1, for each timeseries entry.
* `percentilesTimeseries` (*type:* `GoogleApi.ChromeUXReport.V1.Model.TimeseriesPercentiles.t`, *default:* `nil`) - Commonly useful percentiles of the Metric. The value type for the percentiles will be the same as the value types given for the Histogram bins.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:fractionTimeseries =>
%{optional(String.t()) => GoogleApi.ChromeUXReport.V1.Model.FractionTimeseries.t()}
| nil,
:histogramTimeseries => list(GoogleApi.ChromeUXReport.V1.Model.TimeseriesBin.t()) | nil,
:percentilesTimeseries =>
GoogleApi.ChromeUXReport.V1.Model.TimeseriesPercentiles.t() | nil
}

field(:fractionTimeseries, as: GoogleApi.ChromeUXReport.V1.Model.FractionTimeseries, type: :map)
field(:histogramTimeseries, as: GoogleApi.ChromeUXReport.V1.Model.TimeseriesBin, type: :list)
field(:percentilesTimeseries, as: GoogleApi.ChromeUXReport.V1.Model.TimeseriesPercentiles)
end

defimpl Poison.Decoder, for: GoogleApi.ChromeUXReport.V1.Model.MetricTimeseries do
def decode(value, options) do
GoogleApi.ChromeUXReport.V1.Model.MetricTimeseries.decode(value, options)
end
end

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

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

defmodule GoogleApi.ChromeUXReport.V1.Model.QueryHistoryRequest do
@moduledoc """
Request payload sent by a physical web client. This request includes all necessary context to load a particular user experience history record.
## Attributes
* `formFactor` (*type:* `String.t`, *default:* `nil`) - The form factor is a query dimension that specifies the device class that the record's data should belong to. Note: If no form factor is specified, then a special record with aggregated data over all form factors will be returned.
* `metrics` (*type:* `list(String.t)`, *default:* `nil`) - The metrics that should be included in the response. If none are specified then any metrics found will be returned. Allowed values: ["first_contentful_paint", "first_input_delay", "largest_contentful_paint", "cumulative_layout_shift", "experimental_time_to_first_byte", "experimental_interaction_to_next_paint"]
* `origin` (*type:* `String.t`, *default:* `nil`) - The url pattern "origin" refers to a url pattern that is the origin of a website. Examples: "https://example.com", "https://cloud.google.com"
* `url` (*type:* `String.t`, *default:* `nil`) - The url pattern "url" refers to a url pattern that is any arbitrary url. Examples: "https://example.com/", "https://cloud.google.com/why-google-cloud/"
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:formFactor => String.t() | nil,
:metrics => list(String.t()) | nil,
:origin => String.t() | nil,
:url => String.t() | nil
}

field(:formFactor)
field(:metrics, type: :list)
field(:origin)
field(:url)
end

defimpl Poison.Decoder, for: GoogleApi.ChromeUXReport.V1.Model.QueryHistoryRequest do
def decode(value, options) do
GoogleApi.ChromeUXReport.V1.Model.QueryHistoryRequest.decode(value, options)
end
end

defimpl Poison.Encoder, for: GoogleApi.ChromeUXReport.V1.Model.QueryHistoryRequest do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Loading

0 comments on commit 7ad2cfb

Please sign in to comment.