服務帳戶
建立服務帳戶
client.Organization.ServiceAccounts.New(ctx, body) (*ServiceAccount, error)需要具有 org:admin 範圍的 OAuth 存取權杖,可透過 ant auth login --scope org:admin 或工作負載身分聯合(workload identity federation)規則取得;不接受 Admin API 金鑰。請參閱使用 Admin API 管理 WIF。
列出服務帳戶
client.Organization.ServiceAccounts.List(ctx, query) (*PageCursor[ServiceAccount], error)需要具有 org:admin 範圍的 OAuth 存取權杖,可透過 ant auth login --scope org:admin 或工作負載身分聯合(workload identity federation)規則取得;不接受 Admin API 金鑰。請參閱使用 Admin API 管理 WIF。
取得服務帳戶
client.Organization.ServiceAccounts.Get(ctx, serviceAccountID) (*ServiceAccount, error)需要具有 org:admin 範圍的 OAuth 存取權杖,可透過 ant auth login --scope org:admin 或工作負載身分聯合(workload identity federation)規則取得;不接受 Admin API 金鑰。請參閱使用 Admin API 管理 WIF。
更新服務帳戶
client.Organization.ServiceAccounts.Update(ctx, serviceAccountID, body) (*ServiceAccount, error)需要具有 org:admin 範圍的 OAuth 存取權杖,可透過 ant auth login --scope org:admin 或工作負載身分聯合(workload identity federation)規則取得;不接受 Admin API 金鑰。請參閱使用 Admin API 管理 WIF。
封存服務帳戶
client.Organization.ServiceAccounts.Archive(ctx, serviceAccountID) (*ServiceAccount, error)需要具有 org:admin 範圍的 OAuth 存取權杖,可透過 ant auth login --scope org:admin 或工作負載身分聯合(workload identity federation)規則取得;不接受 Admin API 金鑰。請參閱使用 Admin API 管理 WIF。
Models
服務帳戶工作區
將工作區新增至服務帳戶
client.Organization.ServiceAccounts.Workspaces.Add(ctx, serviceAccountID, body) (*ServiceAccountWorkspaceMember, error)需要具有 org:admin 範圍的 OAuth 存取權杖,可透過 ant auth login --scope org:admin 或工作負載身分聯合(workload identity federation)規則取得;不接受 Admin API 金鑰。請參閱使用 Admin API 管理 WIF。
列出服務帳戶的工作區
client.Organization.ServiceAccounts.Workspaces.List(ctx, serviceAccountID, query) (*PageCursor[ServiceAccountWorkspaceMember], error)需要具有 org:admin 範圍的 OAuth 存取權杖,可透過 ant auth login --scope org:admin 或工作負載身分聯合(workload identity federation)規則取得;不接受 Admin API 金鑰。請參閱使用 Admin API 管理 WIF。
從服務帳戶移除工作區
client.Organization.ServiceAccounts.Workspaces.Remove(ctx, workspaceID, body) (*OrganizationServiceAccountWorkspaceRemoveResponse, error)需要具有 org:admin 範圍的 OAuth 存取權杖,可透過 ant auth login --scope org:admin 或工作負載身分聯合(workload identity federation)規則取得;不接受 Admin API 金鑰。請參閱使用 Admin API 管理 WIF。