resourcemanagerpb

package
v0.0.0-...-8078c5c Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package resourcemanagerpb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	Project_LifecycleState_name = map[int32]string{
		0: "LIFECYCLE_STATE_UNSPECIFIED",
		1: "ACTIVE",
		2: "DELETE_REQUESTED",
		3: "DELETE_IN_PROGRESS",
	}
	Project_LifecycleState_value = map[string]int32{
		"LIFECYCLE_STATE_UNSPECIFIED": 0,
		"ACTIVE":                      1,
		"DELETE_REQUESTED":            2,
		"DELETE_IN_PROGRESS":          3,
	}
)

Enum value maps for Project_LifecycleState.

View Source
var File_mockgcp_cloud_resourcemanager_v1_projects_proto protoreflect.FileDescriptor
View Source
var Projects_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "mockgcp.cloud.resourcemanager.v1.Projects",
	HandlerType: (*ProjectsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetProject",
			Handler:    _Projects_GetProject_Handler,
		},
		{
			MethodName: "CreateProject",
			Handler:    _Projects_CreateProject_Handler,
		},
		{
			MethodName: "DeleteProject",
			Handler:    _Projects_DeleteProject_Handler,
		},
		{
			MethodName: "UpdateProject",
			Handler:    _Projects_UpdateProject_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "mockgcp/cloud/resourcemanager/v1/projects.proto",
}

Projects_ServiceDesc is the grpc.ServiceDesc for Projects service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterProjectsHandler

func RegisterProjectsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterProjectsHandler registers the http handlers for service Projects to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterProjectsHandlerClient

func RegisterProjectsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ProjectsClient) error

RegisterProjectsHandlerClient registers the http handlers for service Projects to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ProjectsClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ProjectsClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ProjectsClient" to call the correct interceptors.

func RegisterProjectsHandlerFromEndpoint

func RegisterProjectsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterProjectsHandlerFromEndpoint is same as RegisterProjectsHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterProjectsHandlerServer

func RegisterProjectsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ProjectsServer) error

RegisterProjectsHandlerServer registers the http handlers for service Projects to "mux". UnaryRPC :call ProjectsServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterProjectsHandlerFromEndpoint instead.

func RegisterProjectsServer

func RegisterProjectsServer(s grpc.ServiceRegistrar, srv ProjectsServer)

Types

type CreateProjectRequest

type CreateProjectRequest struct {

	// Required. The Project to create.
	//
	// Project ID is required. If the requested ID is unavailable, the request
	// fails.
	//
	// If the `parent` field is set, the `resourcemanager.projects.create`
	// permission is checked on the parent resource. If no parent is set and
	// the authorization credentials belong to an Organization, the parent
	// will be set to that Organization.
	Project *Project `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"`
	// contains filtered or unexported fields
}

The request sent to the [CreateProject][mockgcp.cloud.resourcemanager.v1.Projects.CreateProject] method.

func (*CreateProjectRequest) Descriptor deprecated

func (*CreateProjectRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateProjectRequest.ProtoReflect.Descriptor instead.

func (*CreateProjectRequest) GetProject

func (x *CreateProjectRequest) GetProject() *Project

func (*CreateProjectRequest) ProtoMessage

func (*CreateProjectRequest) ProtoMessage()

func (*CreateProjectRequest) ProtoReflect

func (x *CreateProjectRequest) ProtoReflect() protoreflect.Message

func (*CreateProjectRequest) Reset

func (x *CreateProjectRequest) Reset()

func (*CreateProjectRequest) String

func (x *CreateProjectRequest) String() string

type DeleteProjectRequest

type DeleteProjectRequest struct {

	// Required. The name of the Project (for example, `projects/415104041262`).
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

[DeleteProject][mockgcp.cloud.resourcemanager.v1.Projects.DeleteProject] method.

func (*DeleteProjectRequest) Descriptor deprecated

func (*DeleteProjectRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeleteProjectRequest.ProtoReflect.Descriptor instead.

func (*DeleteProjectRequest) GetName

func (x *DeleteProjectRequest) GetName() string

func (*DeleteProjectRequest) ProtoMessage

func (*DeleteProjectRequest) ProtoMessage()

func (*DeleteProjectRequest) ProtoReflect

func (x *DeleteProjectRequest) ProtoReflect() protoreflect.Message

func (*DeleteProjectRequest) Reset

func (x *DeleteProjectRequest) Reset()

func (*DeleteProjectRequest) String

func (x *DeleteProjectRequest) String() string

type GetProjectRequest

type GetProjectRequest struct {

	// Required. The name of the project (for example, `projects/415104041262`).
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

The request sent to the [GetProject][mockgcp.cloud.resourcemanager.v1.Projects.GetProject] method.

func (*GetProjectRequest) Descriptor deprecated

func (*GetProjectRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetProjectRequest.ProtoReflect.Descriptor instead.

func (*GetProjectRequest) GetName

func (x *GetProjectRequest) GetName() string

func (*GetProjectRequest) ProtoMessage

func (*GetProjectRequest) ProtoMessage()

func (*GetProjectRequest) ProtoReflect

func (x *GetProjectRequest) ProtoReflect() protoreflect.Message

func (*GetProjectRequest) Reset

func (x *GetProjectRequest) Reset()

func (*GetProjectRequest) String

func (x *GetProjectRequest) String() string

type Project

type Project struct {

	// Output only. The unique resource name of the project. It is an int64
	// generated number.
	//
	// Example: `415104041262`
	ProjectNumber int64 `protobuf:"varint,1,opt,name=project_number,json=projectNumber,proto3" json:"project_number,omitempty"`
	// Optional. A reference to a parent Resource. eg., `organizations/123` or
	// `folders/876`.
	Parent *ResourceId `protobuf:"bytes,2,opt,name=parent,proto3" json:"parent,omitempty"`
	// Immutable. The unique, user-assigned id of the project.
	// It must be 6 to 30 lowercase ASCII letters, digits, or hyphens.
	// It must start with a letter.
	// Trailing hyphens are prohibited.
	//
	// Example: `tokyo-rain-123`
	ProjectId string `protobuf:"bytes,3,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"`
	// Output only. The project lifecycle state.
	LifecycleState Project_LifecycleState `` /* 165-byte string literal not displayed */
	// Optional. A user-assigned display name of the project.
	// When present it must be between 4 to 30 characters.
	// Allowed characters are: lowercase and uppercase letters, numbers,
	// hyphen, single-quote, double-quote, space, and exclamation point.
	//
	// Example: `My Project`
	Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"`
	// Output only. Creation time.
	CreateTime *timestamp.Timestamp `protobuf:"bytes,6,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
	// Optional. The labels associated with this project.
	//
	// Label keys must be between 1 and 63 characters long and must conform
	// to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?.
	//
	// Label values must be between 0 and 63 characters long and must conform
	// to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?.
	//
	// No more than 64 labels can be associated with a given resource.
	//
	// Clients should store labels in a representation such as JSON that does not
	// depend on specific characters being disallowed.
	//
	// Example: `"myBusinessDimension" : "businessValue"`
	Labels map[string]string `` /* 154-byte string literal not displayed */
	// contains filtered or unexported fields
}

A project is a high-level Google Cloud entity. It is a container for ACLs, APIs, App Engine Apps, VMs, and other Google Cloud Platform resources.

func (*Project) Descriptor deprecated

func (*Project) Descriptor() ([]byte, []int)

Deprecated: Use Project.ProtoReflect.Descriptor instead.

func (*Project) GetCreateTime

func (x *Project) GetCreateTime() *timestamp.Timestamp

func (*Project) GetLabels

func (x *Project) GetLabels() map[string]string

func (*Project) GetLifecycleState

func (x *Project) GetLifecycleState() Project_LifecycleState

func (*Project) GetName

func (x *Project) GetName() string

func (*Project) GetParent

func (x *Project) GetParent() *ResourceId

func (*Project) GetProjectId

func (x *Project) GetProjectId() string

func (*Project) GetProjectNumber

func (x *Project) GetProjectNumber() int64

func (*Project) ProtoMessage

func (*Project) ProtoMessage()

func (*Project) ProtoReflect

func (x *Project) ProtoReflect() protoreflect.Message

func (*Project) Reset

func (x *Project) Reset()

func (*Project) String

func (x *Project) String() string

type Project_LifecycleState

type Project_LifecycleState int32

Project lifecycle states.

const (
	// Unspecified state.  This is only used/useful for distinguishing
	// unset values.
	Project_LIFECYCLE_STATE_UNSPECIFIED Project_LifecycleState = 0
	// The normal and active state.
	Project_ACTIVE Project_LifecycleState = 1
	// The project has been marked for deletion by the user
	// (by invoking
	// [DeleteProject][mockgcp.cloud.resourcemanager.v1.Projects.DeleteProject])
	// or by the system (Google Cloud Platform).
	// This can generally be reversed by invoking [UndeleteProject]
	// [mockgcp.cloud.resourcemanager.v1.Projects.UndeleteProject].
	Project_DELETE_REQUESTED Project_LifecycleState = 2
	// This lifecycle state is no longer used and not returned by the API.
	Project_DELETE_IN_PROGRESS Project_LifecycleState = 3
)

func (Project_LifecycleState) Descriptor

func (Project_LifecycleState) Enum

func (Project_LifecycleState) EnumDescriptor deprecated

func (Project_LifecycleState) EnumDescriptor() ([]byte, []int)

Deprecated: Use Project_LifecycleState.Descriptor instead.

func (Project_LifecycleState) Number

func (Project_LifecycleState) String

func (x Project_LifecycleState) String() string

func (Project_LifecycleState) Type

type ProjectsClient

type ProjectsClient interface {
	// Retrieves the project identified by the specified `name` (for example,
	// `projects/415104041262`).
	//
	// The caller must have `resourcemanager.projects.get` permission
	// for this project.
	GetProject(ctx context.Context, in *GetProjectRequest, opts ...grpc.CallOption) (*Project, error)
	// Request that a new project be created. The result is an `Operation` which
	// can be used to track the creation process. This process usually takes a few
	// seconds, but can sometimes take much longer. The tracking `Operation` is
	// automatically deleted after a few hours, so there is no need to call
	// `DeleteOperation`.
	CreateProject(ctx context.Context, in *CreateProjectRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error)
	// Marks the project identified by the specified
	// `name` (for example, `projects/415104041262`) for deletion.
	//
	// This method will only affect the project if it has a lifecycle state of
	// [ACTIVE][mockgcp.cloud.resourcemanager.v1.Project.State.ACTIVE].
	//
	// This method changes the Project's lifecycle state from
	// [ACTIVE][mockgcp.cloud.resourcemanager.v1.Project.State.ACTIVE]
	// to
	// [DELETE_REQUESTED][mockgcp.cloud.resourcemanager.v1.Project.State.DELETE_REQUESTED].
	// The deletion starts at an unspecified time,
	// at which point the Project is no longer accessible.
	//
	// Until the deletion completes, you can check the lifecycle state
	// checked by retrieving the project with [GetProject]
	// [mockgcp.cloud.resourcemanager.v1.Projects.GetProject],
	// and the project remains visible to [ListProjects]
	// [mockgcp.cloud.resourcemanager.v1.Projects.ListProjects].
	// However, you cannot update the project.
	//
	// After the deletion completes, the project is not retrievable by
	// the  [GetProject]
	// [mockgcp.cloud.resourcemanager.v1.Projects.GetProject],
	// [ListProjects]
	// [mockgcp.cloud.resourcemanager.v1.Projects.ListProjects], and
	// [SearchProjects][mockgcp.cloud.resourcemanager.v1.Projects.SearchProjects]
	// methods.
	//
	// This method behaves idempotently, such that deleting a `DELETE_REQUESTED`
	// project will not cause an error, but also won't do anything.
	//
	// The caller must have `resourcemanager.projects.delete` permissions for this
	// project.
	DeleteProject(ctx context.Context, in *DeleteProjectRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error)
	// Updates the `display_name` and labels of the project identified by the
	// specified `name` (for example, `projects/415104041262`). Deleting all
	// labels requires an update mask for labels field.
	//
	// The caller must have `resourcemanager.projects.update` permission for this
	// project.
	UpdateProject(ctx context.Context, in *UpdateProjectRequest, opts ...grpc.CallOption) (*Project, error)
}

ProjectsClient is the client API for Projects service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewProjectsClient

func NewProjectsClient(cc grpc.ClientConnInterface) ProjectsClient

type ProjectsServer

type ProjectsServer interface {
	// Retrieves the project identified by the specified `name` (for example,
	// `projects/415104041262`).
	//
	// The caller must have `resourcemanager.projects.get` permission
	// for this project.
	GetProject(context.Context, *GetProjectRequest) (*Project, error)
	// Request that a new project be created. The result is an `Operation` which
	// can be used to track the creation process. This process usually takes a few
	// seconds, but can sometimes take much longer. The tracking `Operation` is
	// automatically deleted after a few hours, so there is no need to call
	// `DeleteOperation`.
	CreateProject(context.Context, *CreateProjectRequest) (*longrunningpb.Operation, error)
	// Marks the project identified by the specified
	// `name` (for example, `projects/415104041262`) for deletion.
	//
	// This method will only affect the project if it has a lifecycle state of
	// [ACTIVE][mockgcp.cloud.resourcemanager.v1.Project.State.ACTIVE].
	//
	// This method changes the Project's lifecycle state from
	// [ACTIVE][mockgcp.cloud.resourcemanager.v1.Project.State.ACTIVE]
	// to
	// [DELETE_REQUESTED][mockgcp.cloud.resourcemanager.v1.Project.State.DELETE_REQUESTED].
	// The deletion starts at an unspecified time,
	// at which point the Project is no longer accessible.
	//
	// Until the deletion completes, you can check the lifecycle state
	// checked by retrieving the project with [GetProject]
	// [mockgcp.cloud.resourcemanager.v1.Projects.GetProject],
	// and the project remains visible to [ListProjects]
	// [mockgcp.cloud.resourcemanager.v1.Projects.ListProjects].
	// However, you cannot update the project.
	//
	// After the deletion completes, the project is not retrievable by
	// the  [GetProject]
	// [mockgcp.cloud.resourcemanager.v1.Projects.GetProject],
	// [ListProjects]
	// [mockgcp.cloud.resourcemanager.v1.Projects.ListProjects], and
	// [SearchProjects][mockgcp.cloud.resourcemanager.v1.Projects.SearchProjects]
	// methods.
	//
	// This method behaves idempotently, such that deleting a `DELETE_REQUESTED`
	// project will not cause an error, but also won't do anything.
	//
	// The caller must have `resourcemanager.projects.delete` permissions for this
	// project.
	DeleteProject(context.Context, *DeleteProjectRequest) (*longrunningpb.Operation, error)
	// Updates the `display_name` and labels of the project identified by the
	// specified `name` (for example, `projects/415104041262`). Deleting all
	// labels requires an update mask for labels field.
	//
	// The caller must have `resourcemanager.projects.update` permission for this
	// project.
	UpdateProject(context.Context, *UpdateProjectRequest) (*Project, error)
	// contains filtered or unexported methods
}

ProjectsServer is the server API for Projects service. All implementations must embed UnimplementedProjectsServer for forward compatibility

type ResourceId

type ResourceId struct {

	// The resource type this id is for. At present, the valid types are: "organization", "folder", and "project".
	Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	// The type-specific id. This should correspond to the id used in the type-specific API's.
	Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

ResourceId is just replaced with a string in version 3

func (*ResourceId) Descriptor deprecated

func (*ResourceId) Descriptor() ([]byte, []int)

Deprecated: Use ResourceId.ProtoReflect.Descriptor instead.

func (*ResourceId) GetId

func (x *ResourceId) GetId() string

func (*ResourceId) GetType

func (x *ResourceId) GetType() string

func (*ResourceId) ProtoMessage

func (*ResourceId) ProtoMessage()

func (*ResourceId) ProtoReflect

func (x *ResourceId) ProtoReflect() protoreflect.Message

func (*ResourceId) Reset

func (x *ResourceId) Reset()

func (*ResourceId) String

func (x *ResourceId) String() string

type UnimplementedProjectsServer

type UnimplementedProjectsServer struct {
}

UnimplementedProjectsServer must be embedded to have forward compatible implementations.

func (UnimplementedProjectsServer) CreateProject

func (UnimplementedProjectsServer) DeleteProject

func (UnimplementedProjectsServer) GetProject

func (UnimplementedProjectsServer) UpdateProject

type UnsafeProjectsServer

type UnsafeProjectsServer interface {
	// contains filtered or unexported methods
}

UnsafeProjectsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ProjectsServer will result in compilation errors.

type UpdateProjectRequest

type UpdateProjectRequest struct {

	// Required. The new definition of the project.
	Project *Project `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"`
	// Optional. An update mask to selectively update fields.
	UpdateMask *field_mask.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
	// contains filtered or unexported fields
}

The request sent to the [UpdateProject][mockgcp.cloud.resourcemanager.v1.Projects.UpdateProject] method.

Only the `display_name` and `labels` fields can be change. Use the [MoveProject][mockgcp.cloud.resourcemanager.v1.Projects.MoveProject] method to change the `parent` field.

func (*UpdateProjectRequest) Descriptor deprecated

func (*UpdateProjectRequest) Descriptor() ([]byte, []int)

Deprecated: Use UpdateProjectRequest.ProtoReflect.Descriptor instead.

func (*UpdateProjectRequest) GetProject

func (x *UpdateProjectRequest) GetProject() *Project

func (*UpdateProjectRequest) GetUpdateMask

func (x *UpdateProjectRequest) GetUpdateMask() *field_mask.FieldMask

func (*UpdateProjectRequest) ProtoMessage

func (*UpdateProjectRequest) ProtoMessage()

func (*UpdateProjectRequest) ProtoReflect

func (x *UpdateProjectRequest) ProtoReflect() protoreflect.Message

func (*UpdateProjectRequest) Reset

func (x *UpdateProjectRequest) Reset()

func (*UpdateProjectRequest) String

func (x *UpdateProjectRequest) String() string

Jump to

Keyboard shortcuts

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