Skip to content

Commit

Permalink
Merge pull request #112 from microsoft/users/pnechvatal/RegenerateMis…
Browse files Browse the repository at this point in the history
…singModels

Regenerated clients after updating the genclient
  • Loading branch information
nechvatalp authored Dec 2, 2021
2 parents 9269abb + 0e1d215 commit 0974d01
Show file tree
Hide file tree
Showing 124 changed files with 62,559 additions and 61,661 deletions.
81 changes: 40 additions & 41 deletions azuredevops/v6/accounts/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// --------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// --------------------------------------------------------------------------------------------
Expand All @@ -9,64 +9,63 @@
package accounts

import (
"context"
"github.com/google/uuid"
"github.com/microsoft/azure-devops-go-api/azuredevops/v6"
"net/http"
"net/url"
"context"
"github.com/google/uuid"
"github.com/microsoft/azure-devops-go-api/azuredevops/v6"
"net/http"
"net/url"
)

var ResourceAreaId, _ = uuid.Parse("0d55247a-1c47-4462-9b1f-5e2125590ee6")

type Client interface {
// Get a list of accounts for a specific owner or a specific member. One of the following parameters is required: ownerId, memberId.
GetAccounts(context.Context, GetAccountsArgs) (*[]Account, error)
// Get a list of accounts for a specific owner or a specific member. One of the following parameters is required: ownerId, memberId.
GetAccounts(context.Context, GetAccountsArgs) (*[]Account, error)
}

type ClientImpl struct {
Client azuredevops.Client
Client azuredevops.Client
}

func NewClient(ctx context.Context, connection *azuredevops.Connection) (Client, error) {
client, err := connection.GetClientByResourceAreaId(ctx, ResourceAreaId)
if err != nil {
return nil, err
}
return &ClientImpl{
Client: *client,
}, nil
client, err := connection.GetClientByResourceAreaId(ctx, ResourceAreaId)
if err != nil {
return nil, err
}
return &ClientImpl{
Client: *client,
}, nil
}

// Get a list of accounts for a specific owner or a specific member. One of the following parameters is required: ownerId, memberId.
func (client *ClientImpl) GetAccounts(ctx context.Context, args GetAccountsArgs) (*[]Account, error) {
queryParams := url.Values{}
if args.OwnerId != nil {
queryParams.Add("ownerId", (*args.OwnerId).String())
}
if args.MemberId != nil {
queryParams.Add("memberId", (*args.MemberId).String())
}
if args.Properties != nil {
queryParams.Add("properties", *args.Properties)
}
locationId, _ := uuid.Parse("229a6a53-b428-4ffb-a835-e8f36b5b4b1e")
resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "6.0", nil, queryParams, nil, "", "application/json", nil)
if err != nil {
return nil, err
}
queryParams := url.Values{}
if args.OwnerId != nil {
queryParams.Add("ownerId", (*args.OwnerId).String())
}
if args.MemberId != nil {
queryParams.Add("memberId", (*args.MemberId).String())
}
if args.Properties != nil {
queryParams.Add("properties", *args.Properties)
}
locationId, _ := uuid.Parse("229a6a53-b428-4ffb-a835-e8f36b5b4b1e")
resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "6.0", nil, queryParams, nil, "", "application/json", nil)
if err != nil {
return nil, err
}

var responseValue []Account
err = client.Client.UnmarshalCollectionBody(resp, &responseValue)
return &responseValue, err
var responseValue []Account
err = client.Client.UnmarshalCollectionBody(resp, &responseValue)
return &responseValue, err
}

// Arguments for the GetAccounts function
type GetAccountsArgs struct {
// (optional) ID for the owner of the accounts.
OwnerId *uuid.UUID
// (optional) ID for a member of the accounts.
MemberId *uuid.UUID
// (optional)
Properties *string
// (optional) ID for the owner of the accounts.
OwnerId *uuid.UUID
// (optional) ID for a member of the accounts.
MemberId *uuid.UUID
// (optional)
Properties *string
}

160 changes: 80 additions & 80 deletions azuredevops/v6/accounts/models.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// --------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// --------------------------------------------------------------------------------------------
Expand All @@ -9,116 +9,116 @@
package accounts

import (
"github.com/google/uuid"
"github.com/microsoft/azure-devops-go-api/azuredevops/v6"
"github.com/google/uuid"
"github.com/microsoft/azure-devops-go-api/azuredevops/v6"
)

type Account struct {
// Identifier for an Account
AccountId *uuid.UUID `json:"accountId,omitempty"`
// Name for an account
AccountName *string `json:"accountName,omitempty"`
// Owner of account
AccountOwner *uuid.UUID `json:"accountOwner,omitempty"`
// Current account status
AccountStatus *AccountStatus `json:"accountStatus,omitempty"`
// Type of account: Personal, Organization
AccountType *AccountType `json:"accountType,omitempty"`
// Uri for an account
AccountUri *string `json:"accountUri,omitempty"`
// Who created the account
CreatedBy *uuid.UUID `json:"createdBy,omitempty"`
// Date account was created
CreatedDate *azuredevops.Time `json:"createdDate,omitempty"`
HasMoved *bool `json:"hasMoved,omitempty"`
// Identity of last person to update the account
LastUpdatedBy *uuid.UUID `json:"lastUpdatedBy,omitempty"`
// Date account was last updated
LastUpdatedDate *azuredevops.Time `json:"lastUpdatedDate,omitempty"`
// Namespace for an account
NamespaceId *uuid.UUID `json:"namespaceId,omitempty"`
NewCollectionId *uuid.UUID `json:"newCollectionId,omitempty"`
// Organization that created the account
OrganizationName *string `json:"organizationName,omitempty"`
// Extended properties
Properties interface{} `json:"properties,omitempty"`
// Reason for current status
StatusReason *string `json:"statusReason,omitempty"`
// Identifier for an Account
AccountId *uuid.UUID `json:"accountId,omitempty"`
// Name for an account
AccountName *string `json:"accountName,omitempty"`
// Owner of account
AccountOwner *uuid.UUID `json:"accountOwner,omitempty"`
// Current account status
AccountStatus *AccountStatus `json:"accountStatus,omitempty"`
// Type of account: Personal, Organization
AccountType *AccountType `json:"accountType,omitempty"`
// Uri for an account
AccountUri *string `json:"accountUri,omitempty"`
// Who created the account
CreatedBy *uuid.UUID `json:"createdBy,omitempty"`
// Date account was created
CreatedDate *azuredevops.Time `json:"createdDate,omitempty"`
HasMoved *bool `json:"hasMoved,omitempty"`
// Identity of last person to update the account
LastUpdatedBy *uuid.UUID `json:"lastUpdatedBy,omitempty"`
// Date account was last updated
LastUpdatedDate *azuredevops.Time `json:"lastUpdatedDate,omitempty"`
// Namespace for an account
NamespaceId *uuid.UUID `json:"namespaceId,omitempty"`
NewCollectionId *uuid.UUID `json:"newCollectionId,omitempty"`
// Organization that created the account
OrganizationName *string `json:"organizationName,omitempty"`
// Extended properties
Properties interface{} `json:"properties,omitempty"`
// Reason for current status
StatusReason *string `json:"statusReason,omitempty"`
}

type AccountCreateInfoInternal struct {
AccountName *string `json:"accountName,omitempty"`
Creator *uuid.UUID `json:"creator,omitempty"`
Organization *string `json:"organization,omitempty"`
Preferences *AccountPreferencesInternal `json:"preferences,omitempty"`
Properties interface{} `json:"properties,omitempty"`
ServiceDefinitions *[]azuredevops.KeyValuePair `json:"serviceDefinitions,omitempty"`
AccountName *string `json:"accountName,omitempty"`
Creator *uuid.UUID `json:"creator,omitempty"`
Organization *string `json:"organization,omitempty"`
Preferences *AccountPreferencesInternal `json:"preferences,omitempty"`
Properties interface{} `json:"properties,omitempty"`
ServiceDefinitions *[]azuredevops.KeyValuePair `json:"serviceDefinitions,omitempty"`
}

type AccountPreferencesInternal struct {
Culture interface{} `json:"culture,omitempty"`
Language interface{} `json:"language,omitempty"`
TimeZone interface{} `json:"timeZone,omitempty"`
Culture interface{} `json:"culture,omitempty"`
Language interface{} `json:"language,omitempty"`
TimeZone interface{} `json:"timeZone,omitempty"`
}

type AccountStatus string

type accountStatusValuesType struct {
None AccountStatus
Enabled AccountStatus
Disabled AccountStatus
Deleted AccountStatus
Moved AccountStatus
None AccountStatus
Enabled AccountStatus
Disabled AccountStatus
Deleted AccountStatus
Moved AccountStatus
}

var AccountStatusValues = accountStatusValuesType{
None: "none",
// This hosting account is active and assigned to a customer.
Enabled: "enabled",
// This hosting account is disabled.
Disabled: "disabled",
// This account is part of deletion batch and scheduled for deletion.
Deleted: "deleted",
// This account is not mastered locally and has physically moved.
Moved: "moved",
None: "none",
// This hosting account is active and assigned to a customer.
Enabled: "enabled",
// This hosting account is disabled.
Disabled: "disabled",
// This account is part of deletion batch and scheduled for deletion.
Deleted: "deleted",
// This account is not mastered locally and has physically moved.
Moved: "moved",
}

type AccountType string

type accountTypeValuesType struct {
Personal AccountType
Organization AccountType
Personal AccountType
Organization AccountType
}

var AccountTypeValues = accountTypeValuesType{
Personal: "personal",
Organization: "organization",
Personal: "personal",
Organization: "organization",
}

type AccountUserStatus string

type accountUserStatusValuesType struct {
None AccountUserStatus
Active AccountUserStatus
Disabled AccountUserStatus
Deleted AccountUserStatus
Pending AccountUserStatus
Expired AccountUserStatus
PendingDisabled AccountUserStatus
None AccountUserStatus
Active AccountUserStatus
Disabled AccountUserStatus
Deleted AccountUserStatus
Pending AccountUserStatus
Expired AccountUserStatus
PendingDisabled AccountUserStatus
}

var AccountUserStatusValues = accountUserStatusValuesType{
None: "none",
// User has signed in at least once to the VSTS account
Active: "active",
// User cannot sign in; primarily used by admin to temporarily remove a user due to absence or license reallocation
Disabled: "disabled",
// User is removed from the VSTS account by the VSTS account admin
Deleted: "deleted",
// User is invited to join the VSTS account by the VSTS account admin, but has not signed up/signed in yet
Pending: "pending",
// User can sign in; primarily used when license is in expired state and we give a grace period
Expired: "expired",
// User is disabled; if reenabled, they will still be in the Pending state
PendingDisabled: "pendingDisabled",
None: "none",
// User has signed in at least once to the VSTS account
Active: "active",
// User cannot sign in; primarily used by admin to temporarily remove a user due to absence or license reallocation
Disabled: "disabled",
// User is removed from the VSTS account by the VSTS account admin
Deleted: "deleted",
// User is invited to join the VSTS account by the VSTS account admin, but has not signed up/signed in yet
Pending: "pending",
// User can sign in; primarily used when license is in expired state and we give a grace period
Expired: "expired",
// User is disabled; if reenabled, they will still be in the Pending state
PendingDisabled: "pendingDisabled",
}
Loading

0 comments on commit 0974d01

Please sign in to comment.