github.com/cloudwan/edgelq-sdk@v1.15.4/iam/proto/v1alpha2/user_service.proto (about)

     1  syntax = "proto3";
     2  
     3  package ntt.iam.v1alpha2;
     4  
     5  import "edgelq-sdk/iam/proto/v1alpha2/user.proto";
     6  import "edgelq-sdk/iam/proto/v1alpha2/user_change.proto";
     7  import "edgelq-sdk/iam/proto/v1alpha2/user_custom.proto";
     8  import "google/api/annotations.proto";
     9  import "google/api/client.proto";
    10  import "google/protobuf/empty.proto";
    11  import "google/protobuf/field_mask.proto";
    12  import "google/protobuf/timestamp.proto";
    13  import "goten-sdk/types/view.proto";
    14  import "goten-sdk/types/watch_type.proto";
    15  
    16  option go_package = "github.com/cloudwan/edgelq-sdk/iam/client/v1alpha2/user;user_client";
    17  option java_multiple_files = false;
    18  option java_outer_classname = "UserServiceProto";
    19  option java_package = "com.ntt.iam.pb.v1alpha2";
    20  
    21  // A request message of the GetUser method.
    22  message GetUserRequest {
    23    // Name of ntt.iam.v1alpha2.User
    24    string name = 1;
    25  
    26    // A list of extra fields to be obtained for each response item on top of
    27    // fields defined by request field view
    28    google.protobuf.FieldMask field_mask = 3;
    29  
    30    // View defines list of standard response fields present in response items.
    31    // Additional fields can be amended by request field field_mask
    32    goten.types.View view = 4;
    33  }
    34  
    35  // A request message of the BatchGetUsers method.
    36  message BatchGetUsersRequest {
    37    // Names of Users
    38    repeated string names = 2;
    39  
    40    // A list of extra fields to be obtained for each response item on top of
    41    // fields defined by request field view
    42    google.protobuf.FieldMask field_mask = 3;
    43  
    44    // View defines list of standard response fields present in response items.
    45    // Additional fields can be amended by request field field_mask
    46    goten.types.View view = 4;
    47  
    48    reserved 1;
    49  }
    50  
    51  // A response message of the BatchGetUsers method.
    52  message BatchGetUsersResponse {
    53    // found Users
    54    repeated User users = 1;
    55  
    56    // list of not found Users
    57    repeated string missing = 2;
    58  }
    59  
    60  // A request message of the ListUsers method.
    61  message ListUsersRequest {
    62    // Requested page size. Server may return fewer Users than requested.
    63    // If unspecified, server will pick an appropriate default.
    64    int32 page_size = 2;
    65  
    66    // A token identifying a page of results the server should return.
    67    // Typically, this is the value of
    68    // ListUsersResponse.next_page_token.
    69    string page_token = 3;
    70  
    71    // Order By -
    72    // https://cloud.google.com/apis/design/design_patterns#list_pagination list
    73    // of field path with order directive, either 'asc' or 'desc'. If direction is
    74    // not provided, 'asc' is assumed. e.g. "state.nested_field asc,
    75    // state.something.else desc, theme"
    76    string order_by = 4;
    77  
    78    // Filter - filter results by field criteria. Simplified SQL-like syntax with
    79    // following operators:
    80    // <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS
    81    // [NOT] NULL | NaN . Combine conditions with OR | AND example: 'meta.labels
    82    // CONTAINS "severity:important" OR (state.last_error_time >
    83    // "2018-11-15T10:00:00Z" AND state.status = "ERROR")'
    84    string filter = 5;
    85  
    86    // A list of extra fields to be obtained for each response item on top of
    87    // fields defined by request field view
    88    google.protobuf.FieldMask field_mask = 6;
    89  
    90    // View defines list of standard response fields present in response items.
    91    // Additional fields can be amended by request field field_mask
    92    goten.types.View view = 7;
    93  
    94    // Indicates if list response should contain total count and offset (fields
    95    // current_offset and total_results_count).
    96    bool include_paging_info = 8;
    97  }
    98  
    99  // A response message of the ListUsers method.
   100  message ListUsersResponse {
   101    // The list of Users
   102    repeated User users = 1;
   103  
   104    // A token to retrieve previous page of results.
   105    //
   106    // Pass this value in the ListUsersRequest.page_token.
   107    string prev_page_token = 3;
   108  
   109    // A token to retrieve next page of results.
   110    //
   111    // Pass this value in the ListUsersRequest.page_token.
   112    string next_page_token = 4;
   113  
   114    // Current offset from the first page or 0 if no page tokens were given,
   115    // paging info was not requested or there was an error while trying to get
   116    // it). Page index can be computed from offset and limit provided in a
   117    // request.
   118    int32 current_offset = 5;
   119  
   120    // Number of total Users across all pages or 0, if there are no items, paging
   121    // info was not requested or there was an error while trying to get it.
   122    int32 total_results_count = 6;
   123  }
   124  
   125  // A request message of the WatchUser method.
   126  message WatchUserRequest {
   127    // Name of ntt.iam.v1alpha2.User
   128    string name = 1;
   129  
   130    // A list of extra fields to be obtained for each response item on top of
   131    // fields defined by request field view
   132    google.protobuf.FieldMask field_mask = 2;
   133  
   134    // View defines list of standard response fields present in response items.
   135    // Additional fields can be amended by request field field_mask
   136    goten.types.View view = 4;
   137  }
   138  
   139  // A response message of the WatchUser method.
   140  message WatchUserResponse { UserChange change = 1; }
   141  
   142  // A request message of the WatchUsers method.
   143  message WatchUsersRequest {
   144    // Type of a watch. Identifies how server stream data to a client, which
   145    // fields in a request are allowed and which fields in response are relevant.
   146    goten.types.WatchType type = 9;
   147  
   148    // Requested page size. Server may return fewer Users than requested.
   149    // If unspecified, server will pick an appropriate default.
   150    // Can be populated only for stateful watch type.
   151    int32 page_size = 2;
   152  
   153    // A token identifying a page of results the server should return.
   154    // Can be populated only for stateful watch type.
   155    string page_token = 3;
   156  
   157    // Order By -
   158    // https://cloud.google.com/apis/design/design_patterns#list_pagination Can be
   159    // populated only for stateful watch type.
   160    string order_by = 4;
   161  
   162    // A token identifying watch resume point from previous session.
   163    // Can be populated only for stateless watch type.
   164    string resume_token = 10;
   165  
   166    // Point in the time from which we want to start getting updates. This field
   167    // can be populated only for stateless watch type and if resume token is not
   168    // known yet. If specified, initial snapshot will NOT be provided. It is
   169    // assumed client can obtain it using separate means. Watch responses will
   170    // contain resume tokens which should be used to resume broken connection.
   171    google.protobuf.Timestamp starting_time = 12;
   172  
   173    // Filter - filter results by field criteria. Simplified SQL-like syntax with
   174    // following operators:
   175    // <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS
   176    // [NOT] NULL | NaN . Combine conditions with OR | AND example: 'meta.labels
   177    // CONTAINS "severity:important" OR (state.last_error_time >
   178    // "2018-11-15T10:00:00Z" AND state.status = "ERROR")'
   179    string filter = 5;
   180  
   181    // A list of extra fields to be obtained for each response item on top of
   182    // fields defined by request field view Changes to User that don't affect any
   183    // of masked fields won't be sent back.
   184    google.protobuf.FieldMask field_mask = 6;
   185  
   186    // View defines list of standard response fields present in response items.
   187    // Additional fields can be amended by request field field_mask Changes to
   188    // User that don't affect any of masked fields won't be sent back.
   189    goten.types.View view = 8;
   190  
   191    // Maximum amount of changes in each response message. Query result response
   192    // is divided on the server side into chunks with size of a specified amount
   193    // to limit memory footprint of each message. Responses will hold information
   194    // whether more elements will continue for the actual change. If unspecified,
   195    // server will pick an appropriate default.
   196    int32 max_chunk_size = 11;
   197  }
   198  
   199  // A response message of the WatchUsers method.
   200  message WatchUsersResponse {
   201    // Changes of Users
   202    repeated UserChange user_changes = 2;
   203  
   204    // If request specified max_chunk_size (or this limit was enforced if
   205    // stateless watch has been chosen), then responses with "full changeset" will
   206    // be divided into chunks. Client should keep receiving messages and, once
   207    // is_current has value true, combine this recent message with all previous
   208    // ones where is_current is false. If this is the first is_current in a whole
   209    // watch stream, then it means that client should have, at this moment,
   210    // contain snapshot of the current situation (or more accurately, snapshot of
   211    // situation at the moment of request). All Users will be of type
   212    // Added/Current (depending on watch_type specified in the request). Further
   213    // responses will be incremental - however messages may still be chunked and
   214    // is_current logic still applies. is_current is always true for stateful
   215    // watch if max_chunk_size was left to 0.
   216    bool is_current = 4;
   217  
   218    // When present, PageTokens used for page navigation should be updated.
   219    // Present only if is_current is true (last chunk).
   220    PageTokenChange page_token_change = 3;
   221  
   222    // Token that can be used if current connection drops and client needs to
   223    // reconnect. Populated only for stateless watch type. Present only if
   224    // is_current is true (last chunk).
   225    string resume_token = 5;
   226  
   227    // Server may occasionally send information how many resources should client
   228    // have in its state so far (response message without any changes, but with
   229    // snapshot_size field specified). If client has different value than the one
   230    // sent by the server, then it should be treated by a client as an error and
   231    // should reconnect. If value is smaller then 0, then client should ignore
   232    // this field as unpopulated. This field should be checked only for stateless
   233    // watch. In stateful those kind of errors are handled by the server side.
   234    // Will be never sent together with is_current, is_soft_reset and
   235    // is_hard_reset flags.
   236    int64 snapshot_size = 6;
   237  
   238    // In case of internal issue server may send response message with this flag.
   239    // It indicates that client should drop all changes from recent responses
   240    // where is_current is false only! If last message had is_current set to true,
   241    // client should do nothing and process normally. Resume token received before
   242    // is still valid. This field should be checked only for stateless watch. In
   243    // stateful those kind of errors are handled by the server side. Will never be
   244    // sent along with is_current, is_hard_reset or snapshot_size.
   245    bool is_soft_reset = 7;
   246  
   247    // In case of internal issue server may send response message with this flag.
   248    // After receiving, client should clear whole state (drop all changes received
   249    // so far) as server will send new snapshot (Users will contains changes of
   250    // type Current only). Any resume tokens should be discarded as well. This
   251    // field should be checked only for stateless watch. In stateful those kind of
   252    // errors are handled by the server side. Will never be sent along with
   253    // is_current, is_soft_reset or snapshot_size.
   254    bool is_hard_reset = 8;
   255  
   256    message PageTokenChange {
   257      // New token to retrieve previous page of results.
   258      string prev_page_token = 1;
   259  
   260      // New token to retrieve next page of results.
   261      string next_page_token = 2;
   262    }
   263  }
   264  
   265  // A request message of the CreateUser method.
   266  message CreateUserRequest {
   267    // User resource body
   268    User user = 2;
   269  
   270    // Optional masking applied to response object to reduce message response
   271    // size.
   272    ResponseMask response_mask = 3;
   273  
   274    // ResponseMask allows client to reduce response message size.
   275    message ResponseMask {
   276      oneof masking {
   277        // If this flag has value true, then response will contain just empty
   278        // resource without any fields populated.
   279        bool skip_entire_response_body = 1;
   280  
   281        // If this field is populated, then resource in response will contain only
   282        // specific fields.
   283        google.protobuf.FieldMask body_mask = 2;
   284      }
   285    }
   286  }
   287  
   288  // A request message of the UpdateUser method.
   289  message UpdateUserRequest {
   290    // User resource body
   291    User user = 2;
   292  
   293    // FieldMask applied to request - change will be applied only for fields in
   294    // the mask
   295    google.protobuf.FieldMask update_mask = 3;
   296  
   297    // Conditional update applied to request if update should be executed only for
   298    // specific resource state. If this field is populated, then server will fetch
   299    // existing resource, compare with the one stored in the cas field (after
   300    // applying field mask) and proceed with update only and only if they match.
   301    // Otherwise RPC error Aborted will be returned.
   302    CAS cas = 4;
   303  
   304    // If set to true, and the resource is not found,
   305    // a new resource will be created.  In this situation,
   306    // 'field_mask' is ignored.
   307    //
   308    // https://google.aip.dev/134#create-or-update
   309    bool allow_missing = 5; // Optional masking applied to response object to
   310  
   311    // reduce message response size.
   312    ResponseMask response_mask = 6;
   313  
   314    // CAS - Compare and Swap. This object is used if user wants to make update
   315    // conditional based upon previous resource version.
   316    message CAS {
   317      // Conditional desired state of a resource before update.
   318      User conditional_state = 1;
   319  
   320      // Field paths from conditional state of resource server should check and
   321      // compare.
   322      google.protobuf.FieldMask field_mask = 2;
   323    }
   324  
   325    // ResponseMask allows client to reduce response message size.
   326    message ResponseMask {
   327      oneof masking {
   328        // If this flag has value true, then response will contain just empty
   329        // resource without any fields populated. Field body_mask is ignored if
   330        // set.
   331        bool skip_entire_response_body = 1;
   332  
   333        // Include all fields that were actually updated during processing. Note
   334        // this may be larger than update mask if some fields were computed
   335        // additionally. Name is added as well.
   336        bool updated_fields_only = 2;
   337  
   338        // If this field is populated, then resource in response will contain only
   339        // specific fields. If skip_entire_response_body is true, this field is
   340        // ignored.
   341        google.protobuf.FieldMask body_mask = 3;
   342      }
   343    }
   344  }
   345  
   346  // A request message of the DeleteUser method.
   347  message DeleteUserRequest {
   348    // Name of ntt.iam.v1alpha2.User
   349    string name = 1;
   350  
   351    // If set to true, and the resource is not found, method will be successful
   352    // and will not return NotFound error.
   353    bool allow_missing = 2;
   354  }
   355  
   356  // User service API for IAM
   357  service UserService {
   358    option (google.api.default_host) = "iam.edgelq.com";
   359    option (google.api.oauth_scopes) = "https://apis.edgelq.com";
   360  
   361    // GetUser
   362    rpc GetUser(GetUserRequest) returns (User) {
   363      option (google.api.http) = {
   364        get : "/v1alpha2/{name=users/*}"
   365      };
   366    }
   367  
   368    // BatchGetUsers
   369    rpc BatchGetUsers(BatchGetUsersRequest) returns (BatchGetUsersResponse) {
   370      option (google.api.http) = {
   371        get : "/v1alpha2/users:batchGet"
   372      };
   373    }
   374  
   375    // ListUsers
   376    rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) {
   377      option (google.api.http) = {
   378        get : "/v1alpha2/users"
   379      };
   380    }
   381  
   382    // WatchUser
   383    rpc WatchUser(WatchUserRequest) returns (stream WatchUserResponse) {
   384      option (google.api.http) = {
   385        post : "/v1alpha2/{name=users/*}:watch"
   386      };
   387    }
   388  
   389    // WatchUsers
   390    rpc WatchUsers(WatchUsersRequest) returns (stream WatchUsersResponse) {
   391      option (google.api.http) = {
   392        post : "/v1alpha2/users:watch"
   393      };
   394    }
   395  
   396    // CreateUser
   397    rpc CreateUser(CreateUserRequest) returns (User) {
   398      option (google.api.http) = {
   399        post : "/v1alpha2/users"
   400        body : "user"
   401      };
   402    }
   403  
   404    // UpdateUser
   405    rpc UpdateUser(UpdateUserRequest) returns (User) {
   406      option (google.api.http) = {
   407        put : "/v1alpha2/{user.name=users/*}"
   408        body : "user"
   409      };
   410    }
   411  
   412    // DeleteUser
   413    rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) {
   414      option (google.api.http) = {
   415        delete : "/v1alpha2/{name=users/*}"
   416      };
   417    }
   418  
   419    // GetUserByEmail
   420    rpc GetUserByEmail(GetUserByEmailRequest) returns (User) {
   421      option (google.api.http) = {
   422        post : "/v1alpha2:getByEmail"
   423      };
   424    }
   425  
   426    // BatchGetUsersByEmail
   427    rpc BatchGetUsersByEmail(BatchGetUsersByEmailRequest)
   428        returns (BatchGetUsersByEmailResponse) {
   429      option (google.api.http) = {
   430        post : "/v1alpha2/users:batchGetByEmail"
   431      };
   432    }
   433  
   434    // GetMySettings
   435    rpc GetMySettings(GetMySettingsRequest) returns (GetMySettingsResponse) {
   436      option (google.api.http) = {
   437        post : "/v1alpha2/users:getMySettings"
   438      };
   439    }
   440  
   441    // SetMySettings
   442    rpc SetMySettings(SetMySettingsRequest) returns (google.protobuf.Empty) {
   443      option (google.api.http) = {
   444        post : "/v1alpha2/users:setMySettings"
   445      };
   446    }
   447  
   448    // RefreshUserFromIdToken
   449    rpc RefreshUserFromIdToken(RefreshUserFromIdTokenRequest)
   450        returns (RefreshUserFromIdTokenResponse) {
   451      option (google.api.http) = {
   452        post : "/v1alpha2/users:refreshUserFromIdToken"
   453      };
   454    }
   455  
   456    // ResendVerificationEmail
   457    rpc ResendVerificationEmail(ResendVerificationEmailRequest)
   458        returns (google.protobuf.Empty) {
   459      option (google.api.http) = {
   460        post : "/v1alpha2/users:resendVerificationEmail"
   461      };
   462    }
   463  
   464    // IsUserVerified
   465    rpc IsUserVerified(IsUserVerifiedRequest) returns (google.protobuf.Empty) {
   466      option (google.api.http) = {
   467        post : "/v1alpha2/users:isUserVerified"
   468      };
   469    }
   470  
   471    // ResetMFAIfRecoveryKeyUsed
   472    rpc ResetMFAIfRecoveryKeyUsed(ResetMFAIfRecoveryKeyUsedRequest)
   473        returns (google.protobuf.Empty) {
   474      option (google.api.http) = {
   475        post : "/v1alpha2/users:resetMFAIfRecoveryKeyUsed"
   476      };
   477    }
   478  
   479    // SetUsersNameInAuth0
   480    rpc SetUsersNameInAuth0(SetUsersNameInAuth0Request)
   481        returns (google.protobuf.Empty) {
   482      option (google.api.http) = {
   483        post : "/v1alpha2/users:setUsersNameInAuth0"
   484      };
   485    }
   486  }