order

package
v0.0.0-...-3d84a2e Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: MIT-0 Imports: 11 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_mikebway_order_item_proto protoreflect.FileDescriptor
View Source
var File_mikebway_order_order_api_proto protoreflect.FileDescriptor
View Source
var File_mikebway_order_order_proto protoreflect.FileDescriptor
View Source
var OrderAPI_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "mikebway.order.OrderAPI",
	HandlerType: (*OrderAPIServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetOrderByID",
			Handler:    _OrderAPI_GetOrderByID_Handler,
		},
		{
			MethodName: "GetOrders",
			Handler:    _OrderAPI_GetOrders_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "mikebway/order/order_api.proto",
}

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

Functions

func RegisterOrderAPIServer

func RegisterOrderAPIServer(s grpc.ServiceRegistrar, srv OrderAPIServer)

Types

type GetOrderByIDRequest

type GetOrderByIDRequest struct {

	// REQUIRED. The UUID ID of the order to be retrieved
	OrderId string `protobuf:"bytes,1,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
	// contains filtered or unexported fields
}

Request parameters for the GetOrderByID API

func (*GetOrderByIDRequest) Descriptor deprecated

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

Deprecated: Use GetOrderByIDRequest.ProtoReflect.Descriptor instead.

func (*GetOrderByIDRequest) GetOrderId

func (x *GetOrderByIDRequest) GetOrderId() string

func (*GetOrderByIDRequest) ProtoMessage

func (*GetOrderByIDRequest) ProtoMessage()

func (*GetOrderByIDRequest) ProtoReflect

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

func (*GetOrderByIDRequest) Reset

func (x *GetOrderByIDRequest) Reset()

func (*GetOrderByIDRequest) String

func (x *GetOrderByIDRequest) String() string

type GetOrderByIDResponse

type GetOrderByIDResponse struct {

	// The order requested
	Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"`
	// contains filtered or unexported fields
}

Response parameters for the GetOrderByID API

func (*GetOrderByIDResponse) Descriptor deprecated

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

Deprecated: Use GetOrderByIDResponse.ProtoReflect.Descriptor instead.

func (*GetOrderByIDResponse) GetOrder

func (x *GetOrderByIDResponse) GetOrder() *Order

func (*GetOrderByIDResponse) ProtoMessage

func (*GetOrderByIDResponse) ProtoMessage()

func (*GetOrderByIDResponse) ProtoReflect

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

func (*GetOrderByIDResponse) Reset

func (x *GetOrderByIDResponse) Reset()

func (*GetOrderByIDResponse) String

func (x *GetOrderByIDResponse) String() string

type GetOrdersRequest

type GetOrdersRequest struct {

	// REQUIRED. The earliest order submission time for which orders are to be returned.
	// Submission times may be equal to or greater than this.
	StartTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	// REQUIRED. The order submission time after which orders are not to be returned
	// Submission times must be less than this.
	EndTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
	// REQUIRED. The maximum number of result to be returned in a single response.
	//
	// Must be between 1 and 100.
	PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// OPTIONAL. Required for second and subsequent requests, a marker token used to identify where the
	// next page of results should begin within the overall result set.
	//
	// All other parameters should be the same as in previous requests otherwise the results shall
	// be no deterministic.
	PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
	// OPTIONAL. The family name of the person that entered the order
	FamilyName string `protobuf:"bytes,5,opt,name=family_name,json=familyName,proto3" json:"family_name,omitempty"`
	// OPTIONAL. The given name of the person that entered the order
	GivenName string `protobuf:"bytes,6,opt,name=given_name,json=givenName,proto3" json:"given_name,omitempty"`
	// contains filtered or unexported fields
}

Request parameters for the GetOrders API

See https://cloud.google.com/apis/design/design_patterns

func (*GetOrdersRequest) Descriptor deprecated

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

Deprecated: Use GetOrdersRequest.ProtoReflect.Descriptor instead.

func (*GetOrdersRequest) GetEndTime

func (x *GetOrdersRequest) GetEndTime() *timestamppb.Timestamp

func (*GetOrdersRequest) GetFamilyName

func (x *GetOrdersRequest) GetFamilyName() string

func (*GetOrdersRequest) GetGivenName

func (x *GetOrdersRequest) GetGivenName() string

func (*GetOrdersRequest) GetPageSize

func (x *GetOrdersRequest) GetPageSize() int32

func (*GetOrdersRequest) GetPageToken

func (x *GetOrdersRequest) GetPageToken() string

func (*GetOrdersRequest) GetStartTime

func (x *GetOrdersRequest) GetStartTime() *timestamppb.Timestamp

func (*GetOrdersRequest) ProtoMessage

func (*GetOrdersRequest) ProtoMessage()

func (*GetOrdersRequest) ProtoReflect

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

func (*GetOrdersRequest) Reset

func (x *GetOrdersRequest) Reset()

func (*GetOrdersRequest) String

func (x *GetOrdersRequest) String() string

type GetOrdersResponse

type GetOrdersResponse struct {

	// OPTIONAL. May not be present if the result set was empty.
	//
	// The list of orders in the current page of results.
	Orders []*Order `protobuf:"bytes,1,rep,name=orders,proto3" json:"orders,omitempty"`
	// OPTIONAL. May not be present if the result set was empty
	//
	// The token to be included to request the next page of results.
	NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
	// contains filtered or unexported fields
}

Response parameters for the GetOrders API.

func (*GetOrdersResponse) Descriptor deprecated

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

Deprecated: Use GetOrdersResponse.ProtoReflect.Descriptor instead.

func (*GetOrdersResponse) GetNextPageToken

func (x *GetOrdersResponse) GetNextPageToken() string

func (*GetOrdersResponse) GetOrders

func (x *GetOrdersResponse) GetOrders() []*Order

func (*GetOrdersResponse) ProtoMessage

func (*GetOrdersResponse) ProtoMessage()

func (*GetOrdersResponse) ProtoReflect

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

func (*GetOrdersResponse) Reset

func (x *GetOrdersResponse) Reset()

func (*GetOrdersResponse) String

func (x *GetOrdersResponse) String() string

type Order

type Order struct {

	// A UUID ID in hexadecimal string form - a unique ID for this order.
	// This will be set by the cart when the order is submitted.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The time at which cart checkout was completed and the order was submitted for payment
	SubmissionTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=submission_time,json=submissionTime,proto3" json:"submission_time,omitempty"`
	// The person who submitted the order
	OrderedBy *types.Person `protobuf:"bytes,3,opt,name=ordered_by,json=orderedBy,proto3" json:"ordered_by,omitempty"`
	// The delivery address for the order
	DeliveryAddress *types.PostalAddress `protobuf:"bytes,4,opt,name=delivery_address,json=deliveryAddress,proto3" json:"delivery_address,omitempty"`
	// Order items is the list of one to many items that make up the order
	OrderItems []*OrderItem `protobuf:"bytes,5,rep,name=order_items,json=orderItems,proto3" json:"order_items,omitempty"`
	// contains filtered or unexported fields
}

An order represents the permanent record of what a customer has purchased. An order is derived from a shopping cart upon checkout.

func (*Order) Descriptor deprecated

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

Deprecated: Use Order.ProtoReflect.Descriptor instead.

func (*Order) GetDeliveryAddress

func (x *Order) GetDeliveryAddress() *types.PostalAddress

func (*Order) GetId

func (x *Order) GetId() string

func (*Order) GetOrderItems

func (x *Order) GetOrderItems() []*OrderItem

func (*Order) GetOrderedBy

func (x *Order) GetOrderedBy() *types.Person

func (*Order) GetSubmissionTime

func (x *Order) GetSubmissionTime() *timestamppb.Timestamp

func (*Order) ProtoMessage

func (*Order) ProtoMessage()

func (*Order) ProtoReflect

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

func (*Order) Reset

func (x *Order) Reset()

func (*Order) String

func (x *Order) String() string

type OrderAPIClient

type OrderAPIClient interface {
	// Get a specified order
	GetOrderByID(ctx context.Context, in *GetOrderByIDRequest, opts ...grpc.CallOption) (*GetOrderByIDResponse, error)
	// Get a list of orders matching some criteria
	GetOrders(ctx context.Context, in *GetOrdersRequest, opts ...grpc.CallOption) (*GetOrdersResponse, error)
}

OrderAPIClient is the client API for OrderAPI 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 NewOrderAPIClient

func NewOrderAPIClient(cc grpc.ClientConnInterface) OrderAPIClient

type OrderAPIServer

type OrderAPIServer interface {
	// Get a specified order
	GetOrderByID(context.Context, *GetOrderByIDRequest) (*GetOrderByIDResponse, error)
	// Get a list of orders matching some criteria
	GetOrders(context.Context, *GetOrdersRequest) (*GetOrdersResponse, error)
	// contains filtered or unexported methods
}

OrderAPIServer is the server API for OrderAPI service. All implementations must embed UnimplementedOrderAPIServer for forward compatibility

type OrderItem

type OrderItem struct {

	// A UUID ID in hexadecimal string form - a unique ID for this item.
	// This will be set by the cart when the item is added to the shopper's cart
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Product code is the equivalent of a SKU code identifying the type of
	// product or service being ordered.
	ProductCode string `protobuf:"bytes,2,opt,name=product_code,json=productCode,proto3" json:"product_code,omitempty"`
	// Quantity is the number of this item type that is being ordered.
	Quantity int32 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"`
	// The unit price is the price that the customer was shown for a single item
	// when they selected the item for their cart.
	UnitPrice *money.Money `protobuf:"bytes,4,opt,name=unit_price,json=unitPrice,proto3" json:"unit_price,omitempty"`
	// contains filtered or unexported fields
}

OrderItem represents a single entry in an order. An order will contain one to many order items.

func (*OrderItem) Descriptor deprecated

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

Deprecated: Use OrderItem.ProtoReflect.Descriptor instead.

func (*OrderItem) GetId

func (x *OrderItem) GetId() string

func (*OrderItem) GetProductCode

func (x *OrderItem) GetProductCode() string

func (*OrderItem) GetQuantity

func (x *OrderItem) GetQuantity() int32

func (*OrderItem) GetUnitPrice

func (x *OrderItem) GetUnitPrice() *money.Money

func (*OrderItem) ProtoMessage

func (*OrderItem) ProtoMessage()

func (*OrderItem) ProtoReflect

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

func (*OrderItem) Reset

func (x *OrderItem) Reset()

func (*OrderItem) String

func (x *OrderItem) String() string

type UnimplementedOrderAPIServer

type UnimplementedOrderAPIServer struct {
}

UnimplementedOrderAPIServer must be embedded to have forward compatible implementations.

func (UnimplementedOrderAPIServer) GetOrderByID

func (UnimplementedOrderAPIServer) GetOrders

type UnsafeOrderAPIServer

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

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

Jump to

Keyboard shortcuts

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