account

package
v1.0.0-beta.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2023 License: Apache-2.0 Imports: 13 Imported by: 3

Documentation

Overview

Package account provides methods and message types of the account v2 API.

Index

Constants

View Source
const (
	// ListProjectsRequestOrderByCreatedAtAsc is [insert doc].
	ListProjectsRequestOrderByCreatedAtAsc = ListProjectsRequestOrderBy("created_at_asc")
	// ListProjectsRequestOrderByCreatedAtDesc is [insert doc].
	ListProjectsRequestOrderByCreatedAtDesc = ListProjectsRequestOrderBy("created_at_desc")
	// ListProjectsRequestOrderByNameAsc is [insert doc].
	ListProjectsRequestOrderByNameAsc = ListProjectsRequestOrderBy("name_asc")
	// ListProjectsRequestOrderByNameDesc is [insert doc].
	ListProjectsRequestOrderByNameDesc = ListProjectsRequestOrderBy("name_desc")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

API: user related data

This API allows you to manage projects.

func NewAPI

func NewAPI(client *scw.Client) *API

NewAPI returns a API object from a Scaleway client.

func (*API) CreateProject

func (s *API) CreateProject(req *CreateProjectRequest, opts ...scw.RequestOption) (*Project, error)

CreateProject: create project

func (*API) DeleteProject

func (s *API) DeleteProject(req *DeleteProjectRequest, opts ...scw.RequestOption) error

DeleteProject: delete project

func (*API) GetProject

func (s *API) GetProject(req *GetProjectRequest, opts ...scw.RequestOption) (*Project, error)

GetProject: get project

func (*API) ListProjects

func (s *API) ListProjects(req *ListProjectsRequest, opts ...scw.RequestOption) (*ListProjectsResponse, error)

ListProjects: list projects

func (*API) UpdateProject

func (s *API) UpdateProject(req *UpdateProjectRequest, opts ...scw.RequestOption) (*Project, error)

UpdateProject: update project

type CreateProjectRequest

type CreateProjectRequest struct {
	// Name: the name of the project
	Name string `json:"name"`
	// OrganizationID: the organization ID of the project
	OrganizationID string `json:"organization_id"`
	// Description: the description of the project
	Description *string `json:"description"`
}

type DeleteProjectRequest

type DeleteProjectRequest struct {
	// ProjectID: the project ID of the project
	ProjectID string `json:"-"`
}

type GetProjectRequest

type GetProjectRequest struct {
	// ProjectID: the project ID of the project
	ProjectID string `json:"-"`
}

type ListProjectsRequest

type ListProjectsRequest struct {
	// OrganizationID: the organization ID of the project
	OrganizationID string `json:"-"`
	// Name: the name of the project
	Name *string `json:"-"`
	// Page: the page number for the returned projects
	Page *int32 `json:"-"`
	// PageSize: the maximum number of project per page
	PageSize *uint32 `json:"-"`
	// OrderBy: the sort order of the returned projects
	//
	// Default value: created_at_asc
	OrderBy ListProjectsRequestOrderBy `json:"-"`
	// ProjectIDs: filter out by a list of project ID
	ProjectIDs []string `json:"-"`
}

type ListProjectsRequestOrderBy

type ListProjectsRequestOrderBy string

func (ListProjectsRequestOrderBy) MarshalJSON

func (enum ListProjectsRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListProjectsRequestOrderBy) String

func (enum ListProjectsRequestOrderBy) String() string

func (*ListProjectsRequestOrderBy) UnmarshalJSON

func (enum *ListProjectsRequestOrderBy) UnmarshalJSON(data []byte) error

type ListProjectsResponse

type ListProjectsResponse struct {
	// TotalCount: the total number of projects
	TotalCount uint32 `json:"total_count"`
	// Projects: the paginated returned projects
	Projects []*Project `json:"projects"`
}

ListProjectsResponse: list projects response

func (*ListProjectsResponse) UnsafeAppend

func (r *ListProjectsResponse) UnsafeAppend(res interface{}) (uint32, error)

UnsafeAppend should not be used Internal usage only

func (*ListProjectsResponse) UnsafeGetTotalCount

func (r *ListProjectsResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type Project

type Project struct {
	// ID: the ID of the project
	ID string `json:"id"`
	// Name: the name of the project
	Name string `json:"name"`
	// OrganizationID: the organization ID of the project
	OrganizationID string `json:"organization_id"`
	// CreatedAt: the creation date of the project
	CreatedAt *time.Time `json:"created_at"`
	// UpdatedAt: the update date of the project
	UpdatedAt *time.Time `json:"updated_at"`
	// Description: the description of the project
	Description string `json:"description"`
}

Project: project

type UpdateProjectRequest

type UpdateProjectRequest struct {
	// ProjectID: the project ID of the project
	ProjectID string `json:"-"`
	// Name: the name of the project
	Name *string `json:"name"`
	// Description: the description of the project
	Description *string `json:"description"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL