Class: Google::Apis::IamV1::ServiceAccount

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/iam_v1/classes.rb,
generated/google/apis/iam_v1/representations.rb,
generated/google/apis/iam_v1/representations.rb

Overview

A service account in the Identity and Access Management API. To create a service account, specify the project_id and the account_id for the account. The account_id is unique within the project, and is used to generate the service account email address and a stable unique_id. If the account already exists, the account's resource name is returned in the format of projects/PROJECT_ID/serviceAccounts/ACCOUNT. The caller can use the name in other methods to access the account. All other methods can identify the service account using the format projects/PROJECT_ID/serviceAccounts/ACCOUNT`. Using-as a wildcard for thePROJECT_IDwill infer the project from the account. TheACCOUNTvalue can be theemailaddress or the unique_id` of the service account.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ ServiceAccount

Returns a new instance of ServiceAccount.



1332
1333
1334
# File 'generated/google/apis/iam_v1/classes.rb', line 1332

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#descriptionString

Optional. A user-specified opaque description of the service account. Must be less than or equal to 256 UTF-8 bytes. Corresponds to the JSON property description

Returns:

  • (String)


1277
1278
1279
# File 'generated/google/apis/iam_v1/classes.rb', line 1277

def description
  @description
end

#disabledBoolean Also known as: disabled?

The field is currently in alpha phase. Corresponds to the JSON property disabled

Returns:

  • (Boolean)


1283
1284
1285
# File 'generated/google/apis/iam_v1/classes.rb', line 1283

def disabled
  @disabled
end

#display_nameString

Optional. A user-specified name for the service account. Must be less than or equal to 100 UTF-8 bytes. Corresponds to the JSON property displayName

Returns:

  • (String)


1290
1291
1292
# File 'generated/google/apis/iam_v1/classes.rb', line 1290

def display_name
  @display_name
end

#emailString

Corresponds to the JSON property email

Returns:

  • (String)


1295
1296
1297
# File 'generated/google/apis/iam_v1/classes.rb', line 1295

def email
  @email
end

#etagString

Optional. Note: etag is an inoperable legacy field that is only returned for backwards compatibility. Corresponds to the JSON property etag NOTE: Values are automatically base64 encoded/decoded in the client library.

Returns:

  • (String)


1302
1303
1304
# File 'generated/google/apis/iam_v1/classes.rb', line 1302

def etag
  @etag
end

#nameString

The resource name of the service account in the following format: projects/PROJECT_ID/serviceAccounts/ACCOUNT. Requests using `-` as a wildcard for the `PROJECT_ID` will infer the project from the `account` and the `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. In responses the resource name will always be in the format `projects/`PROJECT_ID`/serviceAccounts/`ACCOUNT. Corresponds to the JSON property name

Returns:

  • (String)


1313
1314
1315
# File 'generated/google/apis/iam_v1/classes.rb', line 1313

def name
  @name
end

#oauth2_client_idString

This is used in conjunction with the OAuth2 clientconfig API to make three legged OAuth2 (3LO) flows to access the data of Google users. Corresponds to the JSON property oauth2ClientId

Returns:

  • (String)


1320
1321
1322
# File 'generated/google/apis/iam_v1/classes.rb', line 1320

def oauth2_client_id
  @oauth2_client_id
end

#project_idString

Corresponds to the JSON property projectId

Returns:

  • (String)


1325
1326
1327
# File 'generated/google/apis/iam_v1/classes.rb', line 1325

def project_id
  @project_id
end

#unique_idString

Corresponds to the JSON property uniqueId

Returns:

  • (String)


1330
1331
1332
# File 'generated/google/apis/iam_v1/classes.rb', line 1330

def unique_id
  @unique_id
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
# File 'generated/google/apis/iam_v1/classes.rb', line 1337

def update!(**args)
  @description = args[:description] if args.key?(:description)
  @disabled = args[:disabled] if args.key?(:disabled)
  @display_name = args[:display_name] if args.key?(:display_name)
  @email = args[:email] if args.key?(:email)
  @etag = args[:etag] if args.key?(:etag)
  @name = args[:name] if args.key?(:name)
  @oauth2_client_id = args[:oauth2_client_id] if args.key?(:oauth2_client_id)
  @project_id = args[:project_id] if args.key?(:project_id)
  @unique_id = args[:unique_id] if args.key?(:unique_id)
end