Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Automated regeneration of AndroidEnterprise client #10869

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,80 @@ defmodule GoogleApi.AndroidEnterprise.V1.Api.Enterprises do
|> Response.decode(opts ++ [struct: %GoogleApi.AndroidEnterprise.V1.Model.Enterprise{}])
end

@doc """
Returns a token for device enrollment. The DPC can encode this token within the QR/NFC/zero-touch enrollment payload or fetch it before calling the on-device API to authenticate the user. The token can be generated for each device or reused across multiple devices.

## Parameters

* `connection` (*type:* `GoogleApi.AndroidEnterprise.V1.Connection.t`) - Connection to server
* `enterprise_id` (*type:* `String.t`) - The ID of the enterprise.
* `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").
* `:deviceType` (*type:* `String.t`) - Whether it’s a dedicated device or a knowledge worker device.
* `opts` (*type:* `keyword()`) - Call options

## Returns

* `{:ok, %GoogleApi.AndroidEnterprise.V1.Model.CreateEnrollmentTokenResponse{}}` on success
* `{:error, info}` on failure
"""
@spec androidenterprise_enterprises_create_enrollment_token(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.AndroidEnterprise.V1.Model.CreateEnrollmentTokenResponse.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def androidenterprise_enterprises_create_enrollment_token(
connection,
enterprise_id,
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,
:deviceType => :query
}

request =
Request.new()
|> Request.method(:post)
|> Request.url("/androidenterprise/v1/enterprises/{enterpriseId}/createEnrollmentToken", %{
"enterpriseId" => URI.encode(enterprise_id, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)

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

@doc """
Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the managed Google Play javascript API. Each token may only be used to start one UI session. See the javascript API documentation for further information.

Expand Down Expand Up @@ -637,7 +711,7 @@ defmodule GoogleApi.AndroidEnterprise.V1.Api.Enterprises do
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:requestMode` (*type:* `String.t`) - The request mode for pulling notifications. Specifying waitForNotifications will cause the request to block and wait until one or more notifications are present, or return an empty notification list if no notifications are present after some time. Speciying returnImmediately will cause the request to immediately return the pending notifications, or an empty list if no notifications are present. If omitted, defaults to waitForNotifications.
* `:requestMode` (*type:* `String.t`) - The request mode for pulling notifications. Specifying waitForNotifications will cause the request to block and wait until one or more notifications are present, or return an empty notification list if no notifications are present after some time. Specifying returnImmediately will cause the request to immediately return the pending notifications, or an empty list if no notifications are present. If omitted, defaults to waitForNotifications.
* `opts` (*type:* `keyword()`) - Call options

## Returns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ defmodule GoogleApi.AndroidEnterprise.V1.Api.Installs do
@library_version Mix.Project.config() |> Keyword.get(:version, "")

@doc """
Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed.
Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed. A successful response indicates that a removal request has been sent to the device. The call will be considered successful even if the app is not present on the device (e.g. it was never installed, or was removed by the user).

## Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.AndroidEnterprise.V1 do
API client metadata for GoogleApi.AndroidEnterprise.V1.
"""

@discovery_revision "20221025"
@discovery_revision "20240307"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ defmodule GoogleApi.AndroidEnterprise.V1.Model.AppVersion do
## Attributes

* `isProduction` (*type:* `boolean()`, *default:* `nil`) - True if this version is a production APK.
* `targetSdkVersion` (*type:* `integer()`, *default:* `nil`) - The SDK version this app targets, as specified in the manifest of the APK. See http://developer.android.com/guide/topics/manifest/uses-sdk-element.html
* `track` (*type:* `String.t`, *default:* `nil`) - Deprecated, use trackId instead.
* `trackId` (*type:* `list(String.t)`, *default:* `nil`) - Track ids that the app version is published in. Replaces the track field (deprecated), but doesn't include the production track (see isProduction instead).
* `versionCode` (*type:* `integer()`, *default:* `nil`) - Unique increasing identifier for the app version.
Expand All @@ -32,13 +33,15 @@ defmodule GoogleApi.AndroidEnterprise.V1.Model.AppVersion do

@type t :: %__MODULE__{
:isProduction => boolean() | nil,
:targetSdkVersion => integer() | nil,
:track => String.t() | nil,
:trackId => list(String.t()) | nil,
:versionCode => integer() | nil,
:versionString => String.t() | nil
}

field(:isProduction)
field(:targetSdkVersion)
field(:track)
field(:trackId, type: :list)
field(:versionCode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ defmodule GoogleApi.AndroidEnterprise.V1.Model.AutoInstallPolicy do
## Attributes

* `autoInstallConstraint` (*type:* `list(GoogleApi.AndroidEnterprise.V1.Model.AutoInstallConstraint.t)`, *default:* `nil`) - The constraints for auto-installing the app. You can specify a maximum of one constraint.
* `autoInstallMode` (*type:* `String.t`, *default:* `nil`) - The auto-install mode. If unset defaults to "doNotAutoInstall".
* `autoInstallMode` (*type:* `String.t`, *default:* `nil`) - The auto-install mode. If unset, defaults to "doNotAutoInstall". An app is automatically installed regardless of a set maintenance window.
* `autoInstallPriority` (*type:* `integer()`, *default:* `nil`) - The priority of the install, as an unsigned integer. A lower number means higher priority.
* `minimumVersionCode` (*type:* `integer()`, *default:* `nil`) - The minimum version of the app. If a lower version of the app is installed, then the app will be auto-updated according to the auto-install constraints, instead of waiting for the regular auto-update. You can set a minimum version code for at most 20 apps per device.
"""
Expand Down
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.AndroidEnterprise.V1.Model.CreateEnrollmentTokenResponse do
@moduledoc """
Response message for create enrollment token.

## Attributes

* `enrollmentToken` (*type:* `String.t`, *default:* `nil`) - Enrollment token.
"""

use GoogleApi.Gax.ModelBase

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

field(:enrollmentToken)
end

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

defimpl Poison.Encoder, for: GoogleApi.AndroidEnterprise.V1.Model.CreateEnrollmentTokenResponse 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 @@ -22,24 +22,45 @@ defmodule GoogleApi.AndroidEnterprise.V1.Model.Device do
## Attributes

* `androidId` (*type:* `String.t`, *default:* `nil`) - The Google Play Services Android ID for the device encoded as a lowercase hex string. For example, "123456789abcdef0".
* `device` (*type:* `String.t`, *default:* `nil`) - The internal hardware codename of the device. This comes from android.os.Build.DEVICE. (field named "device" per logs/wireless/android/android_checkin.proto)
* `latestBuildFingerprint` (*type:* `String.t`, *default:* `nil`) - The build fingerprint of the device if known.
* `maker` (*type:* `String.t`, *default:* `nil`) - The manufacturer of the device. This comes from android.os.Build.MANUFACTURER.
* `managementType` (*type:* `String.t`, *default:* `nil`) - Identifies the extent to which the device is controlled by a managed Google Play EMM in various deployment configurations. Possible values include: - "managedDevice", a device that has the EMM's device policy controller (DPC) as the device owner. - "managedProfile", a device that has a profile managed by the DPC (DPC is profile owner) in addition to a separate, personal profile that is unavailable to the DPC. - "containerApp", no longer used (deprecated). - "unmanagedProfile", a device that has been allowed (by the domain's admin, using the Admin Console to enable the privilege) to use managed Google Play, but the profile is itself not owned by a DPC.
* `model` (*type:* `String.t`, *default:* `nil`) - The model name of the device. This comes from android.os.Build.MODEL.
* `policy` (*type:* `GoogleApi.AndroidEnterprise.V1.Model.Policy.t`, *default:* `nil`) - The policy enforced on the device.
* `product` (*type:* `String.t`, *default:* `nil`) - The product name of the device. This comes from android.os.Build.PRODUCT.
* `report` (*type:* `GoogleApi.AndroidEnterprise.V1.Model.DeviceReport.t`, *default:* `nil`) - The device report updated with the latest app states.
* `retailBrand` (*type:* `String.t`, *default:* `nil`) - Retail brand for the device, if set. See android.os.Build.BRAND
* `sdkVersion` (*type:* `integer()`, *default:* `nil`) - API compatibility version.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:androidId => String.t() | nil,
:device => String.t() | nil,
:latestBuildFingerprint => String.t() | nil,
:maker => String.t() | nil,
:managementType => String.t() | nil,
:model => String.t() | nil,
:policy => GoogleApi.AndroidEnterprise.V1.Model.Policy.t() | nil,
:report => GoogleApi.AndroidEnterprise.V1.Model.DeviceReport.t() | nil
:product => String.t() | nil,
:report => GoogleApi.AndroidEnterprise.V1.Model.DeviceReport.t() | nil,
:retailBrand => String.t() | nil,
:sdkVersion => integer() | nil
}

field(:androidId)
field(:device)
field(:latestBuildFingerprint)
field(:maker)
field(:managementType)
field(:model)
field(:policy, as: GoogleApi.AndroidEnterprise.V1.Model.Policy)
field(:product)
field(:report, as: GoogleApi.AndroidEnterprise.V1.Model.DeviceReport)
field(:retailBrand)
field(:sdkVersion)
end

defimpl Poison.Decoder, for: GoogleApi.AndroidEnterprise.V1.Model.Device do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ defmodule GoogleApi.AndroidEnterprise.V1.Model.Enterprise do
## Attributes

* `administrator` (*type:* `list(GoogleApi.AndroidEnterprise.V1.Model.Administrator.t)`, *default:* `nil`) - Admins of the enterprise. This is only supported for enterprises created via the EMM-initiated flow.
* `googleAuthenticationSettings` (*type:* `GoogleApi.AndroidEnterprise.V1.Model.GoogleAuthenticationSettings.t`, *default:* `nil`) - Output only. Settings for Google-provided user authentication.
* `id` (*type:* `String.t`, *default:* `nil`) - The unique ID for the enterprise.
* `name` (*type:* `String.t`, *default:* `nil`) - The name of the enterprise, for example, "Example, Inc".
* `primaryDomain` (*type:* `String.t`, *default:* `nil`) - The enterprise's primary domain, such as "example.com".
Expand All @@ -31,12 +32,19 @@ defmodule GoogleApi.AndroidEnterprise.V1.Model.Enterprise do

@type t :: %__MODULE__{
:administrator => list(GoogleApi.AndroidEnterprise.V1.Model.Administrator.t()) | nil,
:googleAuthenticationSettings =>
GoogleApi.AndroidEnterprise.V1.Model.GoogleAuthenticationSettings.t() | nil,
:id => String.t() | nil,
:name => String.t() | nil,
:primaryDomain => String.t() | nil
}

field(:administrator, as: GoogleApi.AndroidEnterprise.V1.Model.Administrator, type: :list)

field(:googleAuthenticationSettings,
as: GoogleApi.AndroidEnterprise.V1.Model.GoogleAuthenticationSettings
)

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

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

defmodule GoogleApi.AndroidEnterprise.V1.Model.GoogleAuthenticationSettings do
@moduledoc """
Contains settings for Google-provided user authentication.

## Attributes

* `dedicatedDevicesAllowed` (*type:* `String.t`, *default:* `nil`) - Whether dedicated devices are allowed.
* `googleAuthenticationRequired` (*type:* `String.t`, *default:* `nil`) - Whether Google authentication is required.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:dedicatedDevicesAllowed => String.t() | nil,
:googleAuthenticationRequired => String.t() | nil
}

field(:dedicatedDevicesAllowed)
field(:googleAuthenticationRequired)
end

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

defimpl Poison.Encoder, for: GoogleApi.AndroidEnterprise.V1.Model.GoogleAuthenticationSettings 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,7 +21,7 @@ defmodule GoogleApi.AndroidEnterprise.V1.Model.Policy do

## Attributes

* `autoUpdatePolicy` (*type:* `String.t`, *default:* `nil`) - Recommended alternative: autoUpdateMode which is set per app, provides greater flexibility around update frequency. When autoUpdateMode is set to AUTO_UPDATE_POSTPONED or AUTO_UPDATE_HIGH_PRIORITY, this field has no effect. "choiceToTheUser" allows the device's user to configure the app update policy. "always" enables auto updates. "never" disables auto updates. "wifiOnly" enables auto updates only when the device is connected to wifi.
* `autoUpdatePolicy` (*type:* `String.t`, *default:* `nil`) - Controls when automatic app updates on the device can be applied. Recommended alternative: autoUpdateMode which is set per app, provides greater flexibility around update frequency. When autoUpdateMode is set to AUTO_UPDATE_POSTPONED or AUTO_UPDATE_HIGH_PRIORITY, autoUpdatePolicy has no effect. "choiceToTheUser" allows the device's user to configure the app update policy. "always" enables auto updates. "never" disables auto updates. "wifiOnly" enables auto updates only when the device is connected to wifi.
* `deviceReportPolicy` (*type:* `String.t`, *default:* `nil`) - Whether the device reports app states to the EMM. The default value is "deviceReportDisabled".
* `maintenanceWindow` (*type:* `GoogleApi.AndroidEnterprise.V1.Model.MaintenanceWindow.t`, *default:* `nil`) - The maintenance window defining when apps running in the foreground should be updated.
* `productAvailabilityPolicy` (*type:* `String.t`, *default:* `nil`) - The availability granted to the device for the specified products. "all" gives the device access to all products, regardless of approval status. "all" does not enable automatic visibility of "alpha" or "beta" tracks. "whitelist" grants the device access the products specified in productPolicy[]. Only products that are approved or products that were previously approved (products with revoked approval) by the enterprise can be whitelisted. If no value is provided, the availability set at the user level is applied by default.
Expand Down
Loading
Loading