agones.dev/agones@v1.54.0/sdks/csharp/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  
    28  
    29  
    30  
    31  
    32  
    33  
    34  
    35  
    36  
    37  // SDK service to be used in the GameServer SDK to the Pod Sidecar
    38  service SDK {
    39      // Gets a Counter. Returns NOT_FOUND if the Counter does not exist.
    40      rpc GetCounter(GetCounterRequest) returns (Counter) {
    41        option (google.api.http) = {
    42          get: "/v1beta1/counters/{name}"
    43        };
    44        option (google.api.method_signature) = "name";
    45      }
    46  
    47      // UpdateCounter returns the updated Counter. Returns NOT_FOUND if the Counter does not exist (name cannot be updated).
    48      // Returns OUT_OF_RANGE if the Count is out of range [0,Capacity].
    49      rpc UpdateCounter(UpdateCounterRequest) returns (Counter) {
    50        option (google.api.http) = {
    51          patch: "/v1beta1/counters/{counterUpdateRequest.name}"
    52          body: "counterUpdateRequest"
    53        };
    54        option (google.api.method_signature) = "counterUpdateRequest";
    55      }
    56  
    57      // Gets a List. Returns NOT_FOUND if the List does not exist.
    58      rpc GetList(GetListRequest) returns (List) {
    59        option (google.api.http) = {
    60          get: "/v1beta1/lists/{name}"
    61        };
    62        option (google.api.method_signature) = "name";
    63      }
    64  
    65      // UpdateList returns the updated List. Returns NOT_FOUND if the List does not exist (name cannot be updated).
    66      // **THIS WILL OVERWRITE ALL EXISTING LIST.VALUES WITH ANY REQUEST LIST.VALUES**
    67      // Use AddListValue() or RemoveListValue() for modifying the List.Values field.
    68      // Returns INVALID_ARGUMENT if the field mask path(s) are not field(s) of the List.
    69      // If a field mask path(s) is specified, but the value is not set in the request List object,
    70      // then the default value for the variable will be set (i.e. 0 for "capacity", empty list for "values").
    71      rpc UpdateList(UpdateListRequest) returns (List) {
    72        option (google.api.http) = {
    73          patch: "/v1beta1/lists/{list.name}"
    74          body: "list"
    75        };
    76        option (google.api.method_signature) = "list,update_mask";
    77      }
    78  
    79      // Adds a value to a List and returns updated List. Returns NOT_FOUND if the List does not exist.
    80      // Returns ALREADY_EXISTS if the value is already in the List.
    81      // Returns OUT_OF_RANGE if the List is already at Capacity.
    82      rpc AddListValue(AddListValueRequest) returns (List) {
    83        option (google.api.http) = {
    84          post: "/v1beta1/lists/{name}:addValue"
    85          body: "*"
    86        };
    87      }
    88  
    89      // Removes a value from a List and returns updated List. Returns NOT_FOUND if the List does not exist.
    90      // Returns NOT_FOUND if the value is not in the List.
    91      rpc RemoveListValue(RemoveListValueRequest) returns (List) {
    92        option (google.api.http) = {
    93          post: "/v1beta1/lists/{name}:removeValue"
    94          body: "*"
    95        };
    96      }
    97  }
    98  
    99  // I am Empty
   100  message Empty {
   101  }
   102  
   103  // A representation of a Counter.
   104  message Counter {
   105    option (google.api.resource) = {
   106        type: "agones.dev/Counter"
   107        pattern: "counters/{counter}"
   108    };
   109    // The name of the Counter
   110    string name = 1;
   111    // The current count of the Counter
   112    int64 count = 2;
   113    // The maximum capacity of the Counter
   114    int64 capacity = 3;
   115  }
   116  
   117  // A representation of a Counter Update Request.
   118  message CounterUpdateRequest {
   119    option (google.api.resource) = {
   120        type: "agones.dev/CounterUpdateRequest"
   121        pattern: "counterUpdateRequests/{counterUpdateRequest}"
   122    };
   123    // The name of the Counter to update
   124    string name = 1;
   125    // The value to set the Counter Count
   126    google.protobuf.Int64Value count = 2;
   127    // The value to set the Counter Capacity
   128    google.protobuf.Int64Value capacity = 3;
   129    // countDiff tracks if a Counter Update Request is CountIncrement (positive), CountDecrement
   130    // (negative), 0 if a CountSet or CapacitySet request
   131    int64 countDiff = 4;
   132  }
   133  
   134  message GetCounterRequest {
   135    // The name of the Counter to get
   136    string name = 1 [
   137                    (google.api.field_behavior) = REQUIRED,
   138                    (google.api.resource_reference) = {
   139      type: "agones.dev/Counter"
   140    }];
   141  }
   142  
   143  message UpdateCounterRequest {
   144    // The requested update to make to the Counter
   145    CounterUpdateRequest counterUpdateRequest = 1 [
   146                    (google.api.field_behavior) = REQUIRED,
   147                    (google.api.resource_reference) = {
   148      type: "agones.dev/CounterUpdateRequest"
   149    }];
   150  }
   151  
   152  // A representation of a List.
   153  message List {
   154    option (google.api.resource) = {
   155        type: "agones.dev/List"
   156        pattern: "lists/{list}"
   157    };
   158    // The name of the List
   159    string name = 1;
   160    // The maximum capacity of the List
   161    int64 capacity = 2;
   162    // The array of items in the List ["v1", "v2", …]
   163    repeated string values = 3;
   164  }
   165  
   166  message GetListRequest {
   167    // The name of the List to get
   168    string name = 1 [
   169                    (google.api.field_behavior) = REQUIRED,
   170                    (google.api.resource_reference) = {
   171      type: "agones.dev/List"
   172    }];
   173  }
   174  
   175  message UpdateListRequest {
   176    // The List to update
   177    List list = 1 [
   178                    (google.api.field_behavior) = REQUIRED,
   179                    (google.api.resource_reference) = {
   180      type: "agones.dev/List"
   181    }];
   182  
   183    // Required. Mask (list) of fields to update.
   184    // Fields are specified relative to the List
   185    // (e.g. `capacity`, `values`; *not* `List.capacity` or `List.values`).
   186    google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
   187  }
   188  
   189  message AddListValueRequest {
   190    // The name of the List to add a value to.
   191    string name = 1 [
   192                    (google.api.field_behavior) = REQUIRED,
   193                    (google.api.resource_reference) = {
   194      type: "agones.dev/List"
   195    }];
   196  
   197    string value = 2 [(google.api.field_behavior) = REQUIRED];
   198  }
   199  
   200  message RemoveListValueRequest {
   201    // The name of the List to remove a value from.
   202    string name = 1 [
   203                    (google.api.field_behavior) = REQUIRED,
   204                    (google.api.resource_reference) = {
   205      type: "agones.dev/List"
   206    }];
   207  
   208    string value = 2 [(google.api.field_behavior) = REQUIRED];
   209  }