metering

package
v0.0.0-...-204702d Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ImageProductUsageService_Write_FullMethodName = "/yandex.cloud.marketplace.metering.v1.ImageProductUsageService/Write"
)

Variables

View Source
var (
	RejectedUsageRecord_Reason_name = map[int32]string{
		0: "REASON_UNSPECIFIED",
		1: "DUPLICATE",
		2: "EXPIRED",
		3: "INVALID_TIMESTAMP",
		4: "INVALID_SKU_ID",
		5: "INVALID_PRODUCT_ID",
		6: "INVALID_QUANTITY",
		7: "INVALID_ID",
	}
	RejectedUsageRecord_Reason_value = map[string]int32{
		"REASON_UNSPECIFIED": 0,
		"DUPLICATE":          1,
		"EXPIRED":            2,
		"INVALID_TIMESTAMP":  3,
		"INVALID_SKU_ID":     4,
		"INVALID_PRODUCT_ID": 5,
		"INVALID_QUANTITY":   6,
		"INVALID_ID":         7,
	}
)

Enum value maps for RejectedUsageRecord_Reason.

View Source
var File_yandex_cloud_marketplace_metering_v1_image_product_usage_service_proto protoreflect.FileDescriptor
View Source
var File_yandex_cloud_marketplace_metering_v1_usage_record_proto protoreflect.FileDescriptor
View Source
var ImageProductUsageService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.marketplace.metering.v1.ImageProductUsageService",
	HandlerType: (*ImageProductUsageServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Write",
			Handler:    _ImageProductUsageService_Write_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/marketplace/metering/v1/image_product_usage_service.proto",
}

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

Functions

func RegisterImageProductUsageServiceServer

func RegisterImageProductUsageServiceServer(s grpc.ServiceRegistrar, srv ImageProductUsageServiceServer)

Types

type AcceptedUsageRecord

type AcceptedUsageRecord struct {

	// Unique identifier of the usage record (UUID format).
	Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	// contains filtered or unexported fields
}

func (*AcceptedUsageRecord) Descriptor deprecated

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

Deprecated: Use AcceptedUsageRecord.ProtoReflect.Descriptor instead.

func (*AcceptedUsageRecord) GetUuid

func (x *AcceptedUsageRecord) GetUuid() string

func (*AcceptedUsageRecord) ProtoMessage

func (*AcceptedUsageRecord) ProtoMessage()

func (*AcceptedUsageRecord) ProtoReflect

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

func (*AcceptedUsageRecord) Reset

func (x *AcceptedUsageRecord) Reset()

func (*AcceptedUsageRecord) SetUuid

func (m *AcceptedUsageRecord) SetUuid(v string)

func (*AcceptedUsageRecord) String

func (x *AcceptedUsageRecord) String() string

type ImageProductUsageServiceClient

type ImageProductUsageServiceClient interface {
	// Writes image product's usage. Authentication is by user's service account.
	Write(ctx context.Context, in *WriteImageProductUsageRequest, opts ...grpc.CallOption) (*WriteImageProductUsageResponse, error)
}

ImageProductUsageServiceClient is the client API for ImageProductUsageService 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.

A set of methods for managing image product's usage.

type ImageProductUsageServiceServer

type ImageProductUsageServiceServer interface {
	// Writes image product's usage. Authentication is by user's service account.
	Write(context.Context, *WriteImageProductUsageRequest) (*WriteImageProductUsageResponse, error)
}

ImageProductUsageServiceServer is the server API for ImageProductUsageService service. All implementations should embed UnimplementedImageProductUsageServiceServer for forward compatibility.

A set of methods for managing image product's usage.

type RejectedUsageRecord

type RejectedUsageRecord struct {

	// Unique identifier of the usage record (UUID format).
	Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	// The reason of rejection.
	Reason RejectedUsageRecord_Reason `` /* 135-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*RejectedUsageRecord) Descriptor deprecated

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

Deprecated: Use RejectedUsageRecord.ProtoReflect.Descriptor instead.

func (*RejectedUsageRecord) GetReason

func (*RejectedUsageRecord) GetUuid

func (x *RejectedUsageRecord) GetUuid() string

func (*RejectedUsageRecord) ProtoMessage

func (*RejectedUsageRecord) ProtoMessage()

func (*RejectedUsageRecord) ProtoReflect

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

func (*RejectedUsageRecord) Reset

func (x *RejectedUsageRecord) Reset()

func (*RejectedUsageRecord) SetReason

func (*RejectedUsageRecord) SetUuid

func (m *RejectedUsageRecord) SetUuid(v string)

func (*RejectedUsageRecord) String

func (x *RejectedUsageRecord) String() string

type RejectedUsageRecord_Reason

type RejectedUsageRecord_Reason int32
const (
	RejectedUsageRecord_REASON_UNSPECIFIED RejectedUsageRecord_Reason = 0
	RejectedUsageRecord_DUPLICATE          RejectedUsageRecord_Reason = 1
	RejectedUsageRecord_EXPIRED            RejectedUsageRecord_Reason = 2
	RejectedUsageRecord_INVALID_TIMESTAMP  RejectedUsageRecord_Reason = 3
	RejectedUsageRecord_INVALID_SKU_ID     RejectedUsageRecord_Reason = 4
	RejectedUsageRecord_INVALID_PRODUCT_ID RejectedUsageRecord_Reason = 5
	RejectedUsageRecord_INVALID_QUANTITY   RejectedUsageRecord_Reason = 6
	RejectedUsageRecord_INVALID_ID         RejectedUsageRecord_Reason = 7
)

func (RejectedUsageRecord_Reason) Descriptor

func (RejectedUsageRecord_Reason) Enum

func (RejectedUsageRecord_Reason) EnumDescriptor deprecated

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

Deprecated: Use RejectedUsageRecord_Reason.Descriptor instead.

func (RejectedUsageRecord_Reason) Number

func (RejectedUsageRecord_Reason) String

func (RejectedUsageRecord_Reason) Type

type UnimplementedImageProductUsageServiceServer

type UnimplementedImageProductUsageServiceServer struct{}

UnimplementedImageProductUsageServiceServer should be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

type UnsafeImageProductUsageServiceServer

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

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

type UsageRecord

type UsageRecord struct {

	// Unique identifier of the usage record (UUID format).
	Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	// Consumed Marketplace SKU ID, linked to `UsageRecord.product_id`.
	SkuId string `protobuf:"bytes,2,opt,name=sku_id,json=skuId,proto3" json:"sku_id,omitempty"`
	// Quantity of SKU consumed, measured in `sku.usage_unit` units (e.g. bytes).
	Quantity int64 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"`
	// Timestamp in UTC for which the usage is being reported.
	Timestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

func (*UsageRecord) Descriptor deprecated

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

Deprecated: Use UsageRecord.ProtoReflect.Descriptor instead.

func (*UsageRecord) GetQuantity

func (x *UsageRecord) GetQuantity() int64

func (*UsageRecord) GetSkuId

func (x *UsageRecord) GetSkuId() string

func (*UsageRecord) GetTimestamp

func (x *UsageRecord) GetTimestamp() *timestamppb.Timestamp

func (*UsageRecord) GetUuid

func (x *UsageRecord) GetUuid() string

func (*UsageRecord) ProtoMessage

func (*UsageRecord) ProtoMessage()

func (*UsageRecord) ProtoReflect

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

func (*UsageRecord) Reset

func (x *UsageRecord) Reset()

func (*UsageRecord) SetQuantity

func (m *UsageRecord) SetQuantity(v int64)

func (*UsageRecord) SetSkuId

func (m *UsageRecord) SetSkuId(v string)

func (*UsageRecord) SetTimestamp

func (m *UsageRecord) SetTimestamp(v *timestamppb.Timestamp)

func (*UsageRecord) SetUuid

func (m *UsageRecord) SetUuid(v string)

func (*UsageRecord) String

func (x *UsageRecord) String() string

type WriteImageProductUsageRequest

type WriteImageProductUsageRequest struct {

	// Checks whether you have the access required for the emit usage.
	ValidateOnly bool `protobuf:"varint,1,opt,name=validate_only,json=validateOnly,proto3" json:"validate_only,omitempty"`
	// Marketplace Product's ID.
	ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"`
	// List of product usage records (up to 25 per request).
	UsageRecords []*UsageRecord `protobuf:"bytes,3,rep,name=usage_records,json=usageRecords,proto3" json:"usage_records,omitempty"`
	// contains filtered or unexported fields
}

func (*WriteImageProductUsageRequest) Descriptor deprecated

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

Deprecated: Use WriteImageProductUsageRequest.ProtoReflect.Descriptor instead.

func (*WriteImageProductUsageRequest) GetProductId

func (x *WriteImageProductUsageRequest) GetProductId() string

func (*WriteImageProductUsageRequest) GetUsageRecords

func (x *WriteImageProductUsageRequest) GetUsageRecords() []*UsageRecord

func (*WriteImageProductUsageRequest) GetValidateOnly

func (x *WriteImageProductUsageRequest) GetValidateOnly() bool

func (*WriteImageProductUsageRequest) ProtoMessage

func (*WriteImageProductUsageRequest) ProtoMessage()

func (*WriteImageProductUsageRequest) ProtoReflect

func (*WriteImageProductUsageRequest) Reset

func (x *WriteImageProductUsageRequest) Reset()

func (*WriteImageProductUsageRequest) SetProductId

func (m *WriteImageProductUsageRequest) SetProductId(v string)

func (*WriteImageProductUsageRequest) SetUsageRecords

func (m *WriteImageProductUsageRequest) SetUsageRecords(v []*UsageRecord)

func (*WriteImageProductUsageRequest) SetValidateOnly

func (m *WriteImageProductUsageRequest) SetValidateOnly(v bool)

func (*WriteImageProductUsageRequest) String

type WriteImageProductUsageResponse

type WriteImageProductUsageResponse struct {

	// List of accepted product usage records.
	Accepted []*AcceptedUsageRecord `protobuf:"bytes,1,rep,name=accepted,proto3" json:"accepted,omitempty"`
	// List of rejected product usage records (with reason).
	Rejected []*RejectedUsageRecord `protobuf:"bytes,2,rep,name=rejected,proto3" json:"rejected,omitempty"`
	// contains filtered or unexported fields
}

func (*WriteImageProductUsageResponse) Descriptor deprecated

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

Deprecated: Use WriteImageProductUsageResponse.ProtoReflect.Descriptor instead.

func (*WriteImageProductUsageResponse) GetAccepted

func (*WriteImageProductUsageResponse) GetRejected

func (*WriteImageProductUsageResponse) ProtoMessage

func (*WriteImageProductUsageResponse) ProtoMessage()

func (*WriteImageProductUsageResponse) ProtoReflect

func (*WriteImageProductUsageResponse) Reset

func (x *WriteImageProductUsageResponse) Reset()

func (*WriteImageProductUsageResponse) SetAccepted

func (*WriteImageProductUsageResponse) SetRejected

func (*WriteImageProductUsageResponse) String

Jump to

Keyboard shortcuts

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