account

package
v1.0.0-beta.26 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 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 (
	// Creation date ascending.
	ListProjectsRequestOrderByCreatedAtAsc = ListProjectsRequestOrderBy("created_at_asc")
	// Creation date descending.
	ListProjectsRequestOrderByCreatedAtDesc = ListProjectsRequestOrderBy("created_at_desc")
	// Name ascending.
	ListProjectsRequestOrderByNameAsc = ListProjectsRequestOrderBy("name_asc")
	// Name descending.
	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
}

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 deprecated

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

Deprecated: CreateProject: Deprecated in favor of Account API v3. Generate a new Project for an Organization, specifying its configuration including name and description.

func (*API) DeleteProject deprecated

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

Deprecated: DeleteProject: Deprecated in favor of Account API v3. Delete an existing Project, specified by its Project ID. The Project needs to be empty (meaning there are no resources left in it) to be deleted effectively. Note that deleting a Project is permanent, and cannot be undone.

func (*API) GetProject deprecated

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

Deprecated: GetProject: Deprecated in favor of Account API v3. Retrieve information about an existing Project, specified by its Project ID. Its full details, including ID, name and description, are returned in the response object.

func (*API) ListProjects deprecated

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

Deprecated: ListProjects: Deprecated in favor of Account API v3. List all Projects of an Organization. The response will include the total number of Projects as well as their associated Organizations, names and IDs. Other information include the creation and update date of the Project.

func (*API) UpdateProject deprecated

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

Deprecated: UpdateProject: Deprecated in favor of Account API v3. Update the parameters of an existing Project, specified by its Project ID. These parameters include the name and description.

type CreateProjectRequest

type CreateProjectRequest struct {
	// Name: name of the Project.
	Name string `json:"name"`

	// OrganizationID: organization ID of the Project.
	OrganizationID string `json:"organization_id"`

	// Description: description of the Project.
	Description *string `json:"description,omitempty"`
}

CreateProjectRequest: create project request.

type DeleteProjectRequest

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

DeleteProjectRequest: delete project request.

type GetProjectRequest

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

GetProjectRequest: get project request.

type ListProjectsRequest

type ListProjectsRequest struct {
	// OrganizationID: organization ID of the Project.
	OrganizationID string `json:"-"`

	// Name: name of the Project.
	Name *string `json:"-"`

	// Page: page number for the returned Projects.
	Page *int32 `json:"-"`

	// PageSize: maximum number of Project per page.
	PageSize *uint32 `json:"-"`

	// OrderBy: sort order of the returned Projects.
	// Default value: created_at_asc
	OrderBy ListProjectsRequestOrderBy `json:"-"`

	// ProjectIDs: project IDs to filter for. The results will be limited to any Projects with an ID in this array.
	ProjectIDs []string `json:"-"`
}

ListProjectsRequest: list projects request.

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: total number of Projects.
	TotalCount uint32 `json:"total_count"`

	// Projects: 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: ID of the Project.
	ID string `json:"id"`

	// Name: name of the Project.
	Name string `json:"name"`

	// OrganizationID: organization ID of the Project.
	OrganizationID string `json:"organization_id"`

	// CreatedAt: creation date of the Project.
	CreatedAt *time.Time `json:"created_at"`

	// UpdatedAt: update date of the Project.
	UpdatedAt *time.Time `json:"updated_at"`

	// Description: description of the Project.
	Description string `json:"description"`
}

Project: project.

type UpdateProjectRequest

type UpdateProjectRequest struct {
	// ProjectID: project ID of the Project.
	ProjectID string `json:"-"`

	// Name: name of the Project.
	Name *string `json:"name,omitempty"`

	// Description: description of the Project.
	Description *string `json:"description,omitempty"`
}

UpdateProjectRequest: update project request.

Jump to

Keyboard shortcuts

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