Documentation
¶
Index ¶
- Variables
- func AllUsersQuery(pg string) string
- func GetUserGroups(userId int) string
- func GetUserRoles(userId int) string
- func GroupMembersQuery(groupID string) string
- func GroupsQuery(pg string) string
- func LicenseGrantQuery(licenseName string, pg string) string
- func RoleGrantQuery(roleID string, pg string) string
- func RolesQuery(pg string) string
- func WithBearerToken(token string) uhttp.RequestOption
- type Client
- func (c *Client) Initialize(ctx context.Context) error
- func (c *Client) Query(ctx context.Context, rawQuery string, target interface{}) (*http.Response, *v2.RateLimitDescription, error)
- func (c *Client) SetLicense(ctx context.Context, userId int, licenseId string, active bool) (*UserLicenseResponse, error)
- func (c *Client) SetRoles(ctx context.Context, userId int, roleNames []int) (*UserRolesPutResponse, *v2.RateLimitDescription, error)
- func (c *Client) SetUserGroups(ctx context.Context, userId int, groupIDs []int) (*UserGroupsApiResponse, *v2.RateLimitDescription, error)
- type Group
- type GroupMembersQueryResponse
- type GroupsQueryResponse
- type License
- type LicenseGrantsQueryResponse
- type Query
- type ResourceId
- type Role
- type RoleGrantsQueryResponse
- type RolesQueryResponse
- type User
- type UserGroups
- type UserGroupsApiResponse
- type UserGroupsResponse
- type UserLicenseResponse
- type UserRoles
- type UserRolesPutResponse
- type UserRolesResponse
- type UsersQueryResponse
Constants ¶
This section is empty.
Variables ¶
var ( ScopesReadOnly = []string{ "core.business_entity.read", "core.common.read", "core.user_group.read", "core.user.read", "email login", "openid", "profile", } ScopesReadWrite = append( ScopesReadOnly, "core.user_group.write", "core.user.write", ) )
Functions ¶
func AllUsersQuery ¶
func GetUserGroups ¶
func GetUserRoles ¶
func GroupMembersQuery ¶
func GroupsQuery ¶
func LicenseGrantQuery ¶
func RoleGrantQuery ¶
func RolesQuery ¶
func WithBearerToken ¶
func WithBearerToken(token string) uhttp.RequestOption
WithBearerToken - TODO(marcos): move this function to `baton-sdk`.
Types ¶
type Client ¶
type Client struct { ReadOnlyTokenSource oauth2.TokenSource // contains filtered or unexported fields }
func (*Client) SetLicense ¶
func (c *Client) SetLicense( ctx context.Context, userId int, licenseId string, active bool, ) (*UserLicenseResponse, error)
SetLicense sets the roles for a user. https://compass.coupa.com/en-us/products/product-documentation/integration-technical-documentation/the-coupa-core-api/resources/reference-data-resources/users-api-(users)
func (*Client) SetRoles ¶
func (c *Client) SetRoles( ctx context.Context, userId int, roleNames []int, ) ( *UserRolesPutResponse, *v2.RateLimitDescription, error, )
SetRoles sets the roles for a user. https://compass.coupa.com/en-us/products/product-documentation/integration-technical-documentation/the-coupa-core-api/resources/reference-data-resources/users-api-(users)
func (*Client) SetUserGroups ¶
func (c *Client) SetUserGroups( ctx context.Context, userId int, groupIDs []int, ) ( *UserGroupsApiResponse, *v2.RateLimitDescription, error, )
SetUserGroups sets the roles for a user. https://compass.coupa.com/en-us/products/product-documentation/integration-technical-documentation/the-coupa-core-api/resources/reference-data-resources/users-api-(users)
type GroupsQueryResponse ¶
type GroupsQueryResponse struct {
UserGroups []*Group `json:"userGroups"`
}
type LicenseGrantsQueryResponse ¶
type LicenseGrantsQueryResponse struct { Users []struct { Id int `json:"id"` } `json:"users"` }
type ResourceId ¶
type ResourceId struct {
Id int `json:"id"`
}
type RoleGrantsQueryResponse ¶
type RoleGrantsQueryResponse struct { Users []struct { Id int `json:"id"` } `json:"users"` }
type RolesQueryResponse ¶
type RolesQueryResponse struct {
Roles []*Role `json:"roles"`
}
type UserGroups ¶
type UserGroupsApiResponse ¶
type UserGroupsResponse ¶
type UserGroupsResponse struct {
Users []UserGroups `json:"users"`
}
type UserLicenseResponse ¶
type UserLicenseResponse struct { Id int `json:"id"` RiskAssessUser bool `json:"risk-assess-user"` AicUser bool `json:"aic-user"` PurchasingUser bool `json:"purchasing-user"` ExpenseUser bool `json:"expense-user"` SourcingUser bool `json:"sourcing-user"` InventoryUser bool `json:"inventory-user"` ContractsUser bool `json:"contracts-user"` AnalyticsUser bool `json:"analytics-user"` SpendGuardUser bool `json:"spend-guard-user"` CcwUser bool `json:"ccw-user"` SupplyChainUser bool `json:"supply-chain-user"` TravelUser bool `json:"travel-user"` TreasuryUser bool `json:"treasury-user"` }
type UserRolesPutResponse ¶
type UserRolesPutResponse struct { ResourceId Roles []Role `json:"roles"` }
type UserRolesResponse ¶
type UserRolesResponse struct {
Users []UserRoles `json:"users"`
}
type UsersQueryResponse ¶
type UsersQueryResponse struct {
Users []*User `json:"users"`
}