agones.dev/agones@v1.53.0/sdks/rust/proto/sdk/beta/beta.proto (about)

     1  // Copyright 2020 Google LLC All Rights Reserved.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  syntax = "proto3";
    16  
    17  package agones.dev.sdk.beta;
    18  option go_package = "./beta";
    19  
    20  import "google/api/annotations.proto";
    21  import "google/api/client.proto";
    22  import "google/api/field_behavior.proto";
    23  import "google/api/resource.proto";
    24  import "google/protobuf/empty.proto";
    25  import "google/protobuf/field_mask.proto";
    26  import "google/protobuf/wrappers.proto";
    27  import "protoc-gen-openapiv2/options/annotations.proto";
    28  
    29  option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
    30    info: {
    31      title: "beta.proto";
    32      version: "version not set";
    33    };
    34    schemes: HTTP;
    35    consumes: "application/json";
    36    produces: "application/json";
    37  };
    38  
    39  // SDK service to be used in the GameServer SDK to the Pod Sidecar
    40  service SDK {
    41      // Gets a Counter. Returns NOT_FOUND if the Counter does not exist.
    42      rpc GetCounter(GetCounterRequest) returns (Counter) {
    43        option (google.api.http) = {
    44          get: "/v1beta1/counters/{name}"
    45        };
    46        option (google.api.method_signature) = "name";
    47      }
    48  
    49      // UpdateCounter returns the updated Counter. Returns NOT_FOUND if the Counter does not exist (name cannot be updated).
    50      // Returns OUT_OF_RANGE if the Count is out of range [0,Capacity].
    51      rpc UpdateCounter(UpdateCounterRequest) returns (Counter) {
    52        option (google.api.http) = {
    53          patch: "/v1beta1/counters/{counterUpdateRequest.name}"
    54          body: "counterUpdateRequest"
    55        };
    56        option (google.api.method_signature) = "counterUpdateRequest";
    57      }
    58  
    59      // Gets a List. Returns NOT_FOUND if the List does not exist.
    60      rpc GetList(GetListRequest) returns (List) {
    61        option (google.api.http) = {
    62          get: "/v1beta1/lists/{name}"
    63        };
    64        option (google.api.method_signature) = "name";
    65      }
    66  
    67      // UpdateList returns the updated List. Returns NOT_FOUND if the List does not exist (name cannot be updated).
    68      // **THIS WILL OVERWRITE ALL EXISTING LIST.VALUES WITH ANY REQUEST LIST.VALUES**
    69      // Use AddListValue() or RemoveListValue() for modifying the List.Values field.
    70      // Returns INVALID_ARGUMENT if the field mask path(s) are not field(s) of the List.
    71      // If a field mask path(s) is specified, but the value is not set in the request List object,
    72      // then the default value for the variable will be set (i.e. 0 for "capacity", empty list for "values").
    73      rpc UpdateList(UpdateListRequest) returns (List) {
    74        option (google.api.http) = {
    75          patch: "/v1beta1/lists/{list.name}"
    76          body: "list"
    77        };
    78        option (google.api.method_signature) = "list,update_mask";
    79      }
    80  
    81      // Adds a value to a List and returns updated List. Returns NOT_FOUND if the List does not exist.
    82      // Returns ALREADY_EXISTS if the value is already in the List.
    83      // Returns OUT_OF_RANGE if the List is already at Capacity.
    84      rpc AddListValue(AddListValueRequest) returns (List) {
    85        option (google.api.http) = {
    86          post: "/v1beta1/lists/{name}:addValue"
    87          body: "*"
    88        };
    89      }
    90  
    91      // Removes a value from a List and returns updated List. Returns NOT_FOUND if the List does not exist.
    92      // Returns NOT_FOUND if the value is not in the List.
    93      rpc RemoveListValue(RemoveListValueRequest) returns (List) {
    94        option (google.api.http) = {
    95          post: "/v1beta1/lists/{name}:removeValue"
    96          body: "*"
    97        };
    98      }
    99  }
   100  
   101  // I am Empty
   102  message Empty {
   103  }
   104  
   105  // A representation of a Counter.
   106  message Counter {
   107    option (google.api.resource) = {
   108        type: "agones.dev/Counter"
   109        pattern: "counters/{counter}"
   110    };
   111    // The name of the Counter
   112    string name = 1;
   113    // The current count of the Counter
   114    int64 count = 2;
   115    // The maximum capacity of the Counter
   116    int64 capacity = 3;
   117  }
   118  
   119  // A representation of a Counter Update Request.
   120  message CounterUpdateRequest {
   121    option (google.api.resource) = {
   122        type: "agones.dev/CounterUpdateRequest"
   123        pattern: "counterUpdateRequests/{counterUpdateRequest}"
   124    };
   125    // The name of the Counter to update
   126    string name = 1;
   127    // The value to set the Counter Count
   128    google.protobuf.Int64Value count = 2;
   129    // The value to set the Counter Capacity
   130    google.protobuf.Int64Value capacity = 3;
   131    // countDiff tracks if a Counter Update Request is CountIncrement (positive), CountDecrement
   132    // (negative), 0 if a CountSet or CapacitySet request
   133    int64 countDiff = 4;
   134  }
   135  
   136  message GetCounterRequest {
   137    // The name of the Counter to get
   138    string name = 1 [
   139                    (google.api.field_behavior) = REQUIRED,
   140                    (google.api.resource_reference) = {
   141      type: "agones.dev/Counter"
   142    }];
   143  }
   144  
   145  message UpdateCounterRequest {
   146    // The requested update to make to the Counter
   147    CounterUpdateRequest counterUpdateRequest = 1 [
   148                    (google.api.field_behavior) = REQUIRED,
   149                    (google.api.resource_reference) = {
   150      type: "agones.dev/CounterUpdateRequest"
   151    }];
   152  }
   153  
   154  // A representation of a List.
   155  message List {
   156    option (google.api.resource) = {
   157        type: "agones.dev/List"
   158        pattern: "lists/{list}"
   159    };
   160    // The name of the List
   161    string name = 1;
   162    // The maximum capacity of the List
   163    int64 capacity = 2;
   164    // The array of items in the List ["v1", "v2", …]
   165    repeated string values = 3;
   166  }
   167  
   168  message GetListRequest {
   169    // The name of the List to get
   170    string name = 1 [
   171                    (google.api.field_behavior) = REQUIRED,
   172                    (google.api.resource_reference) = {
   173      type: "agones.dev/List"
   174    }];
   175  }
   176  
   177  message UpdateListRequest {
   178    // The List to update
   179    List list = 1 [
   180                    (google.api.field_behavior) = REQUIRED,
   181                    (google.api.resource_reference) = {
   182      type: "agones.dev/List"
   183    }];
   184  
   185    // Required. Mask (list) of fields to update.
   186    // Fields are specified relative to the List
   187    // (e.g. `capacity`, `values`; *not* `List.capacity` or `List.values`).
   188    google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
   189  }
   190  
   191  message AddListValueRequest {
   192    // The name of the List to add a value to.
   193    string name = 1 [
   194                    (google.api.field_behavior) = REQUIRED,
   195                    (google.api.resource_reference) = {
   196      type: "agones.dev/List"
   197    }];
   198  
   199    string value = 2 [(google.api.field_behavior) = REQUIRED];
   200  }
   201  
   202  message RemoveListValueRequest {
   203    // The name of the List to remove a value from.
   204    string name = 1 [
   205                    (google.api.field_behavior) = REQUIRED,
   206                    (google.api.resource_reference) = {
   207      type: "agones.dev/List"
   208    }];
   209  
   210    string value = 2 [(google.api.field_behavior) = REQUIRED];
   211  }