github.com/cloudwan/edgelq-sdk@v1.15.4/iam/proto/v1alpha2/organization_service.proto (about) 1 syntax = "proto3"; 2 3 package ntt.iam.v1alpha2; 4 5 import "edgelq-sdk/iam/proto/v1alpha2/organization.proto"; 6 import "edgelq-sdk/iam/proto/v1alpha2/organization_change.proto"; 7 import "edgelq-sdk/iam/proto/v1alpha2/organization_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/organization;organization_client"; 17 option java_multiple_files = false; 18 option java_outer_classname = "OrganizationServiceProto"; 19 option java_package = "com.ntt.iam.pb.v1alpha2"; 20 21 // A request message of the GetOrganization method. 22 message GetOrganizationRequest { 23 // Name of ntt.iam.v1alpha2.Organization 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 BatchGetOrganizations method. 36 message BatchGetOrganizationsRequest { 37 // Names of Organizations 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 BatchGetOrganizations method. 52 message BatchGetOrganizationsResponse { 53 // found Organizations 54 repeated Organization organizations = 1; 55 56 // list of not found Organizations 57 repeated string missing = 2; 58 } 59 60 // A request message of the ListOrganizations method. 61 message ListOrganizationsRequest { 62 // Requested page size. Server may return fewer Organizations 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 // ListOrganizationsResponse.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 ListOrganizations method. 100 message ListOrganizationsResponse { 101 // The list of Organizations 102 repeated Organization organizations = 1; 103 104 // A token to retrieve previous page of results. 105 // 106 // Pass this value in the ListOrganizationsRequest.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 ListOrganizationsRequest.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 Organizations across all pages or 0, if there are no items, 121 // paging 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 WatchOrganization method. 126 message WatchOrganizationRequest { 127 // Name of ntt.iam.v1alpha2.Organization 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 WatchOrganization method. 140 message WatchOrganizationResponse { OrganizationChange change = 1; } 141 142 // A request message of the WatchOrganizations method. 143 message WatchOrganizationsRequest { 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 Organizations 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 Organization that don't 183 // affect any 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 // Organization 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 WatchOrganizations method. 200 message WatchOrganizationsResponse { 201 // Changes of Organizations 202 repeated OrganizationChange organization_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 Organizations 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 (Organizations will contains 250 // changes of type Current only). Any resume tokens should be discarded as 251 // well. This field should be checked only for stateless watch. In stateful 252 // those kind of errors are handled by the server side. Will never be sent 253 // along with 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 CreateOrganization method. 266 message CreateOrganizationRequest { 267 // Organization resource body 268 Organization organization = 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 UpdateOrganization method. 289 message UpdateOrganizationRequest { 290 // Organization resource body 291 Organization organization = 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 Organization 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 DeleteOrganization method. 347 message DeleteOrganizationRequest { 348 // Name of ntt.iam.v1alpha2.Organization 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 // Organization service API for IAM 357 service OrganizationService { 358 option (google.api.default_host) = "iam.edgelq.com"; 359 option (google.api.oauth_scopes) = "https://apis.edgelq.com"; 360 361 // GetOrganization 362 rpc GetOrganization(GetOrganizationRequest) returns (Organization) { 363 option (google.api.http) = { 364 get : "/v1alpha2/{name=organizations/*}" 365 }; 366 } 367 368 // BatchGetOrganizations 369 rpc BatchGetOrganizations(BatchGetOrganizationsRequest) 370 returns (BatchGetOrganizationsResponse) { 371 option (google.api.http) = { 372 get : "/v1alpha2/organizations:batchGet" 373 }; 374 } 375 376 // ListOrganizations 377 rpc ListOrganizations(ListOrganizationsRequest) 378 returns (ListOrganizationsResponse) { 379 option (google.api.http) = { 380 get : "/v1alpha2/organizations" 381 }; 382 } 383 384 // WatchOrganization 385 rpc WatchOrganization(WatchOrganizationRequest) 386 returns (stream WatchOrganizationResponse) { 387 option (google.api.http) = { 388 post : "/v1alpha2/{name=organizations/*}:watch" 389 }; 390 } 391 392 // WatchOrganizations 393 rpc WatchOrganizations(WatchOrganizationsRequest) 394 returns (stream WatchOrganizationsResponse) { 395 option (google.api.http) = { 396 post : "/v1alpha2/organizations:watch" 397 }; 398 } 399 400 // CreateOrganization 401 rpc CreateOrganization(CreateOrganizationRequest) returns (Organization) { 402 option (google.api.http) = { 403 post : "/v1alpha2/organizations" 404 body : "organization" 405 }; 406 } 407 408 // UpdateOrganization 409 rpc UpdateOrganization(UpdateOrganizationRequest) returns (Organization) { 410 option (google.api.http) = { 411 put : "/v1alpha2/{organization.name=organizations/*}" 412 body : "organization" 413 }; 414 } 415 416 // DeleteOrganization 417 rpc DeleteOrganization(DeleteOrganizationRequest) 418 returns (google.protobuf.Empty) { 419 option (google.api.http) = { 420 delete : "/v1alpha2/{name=organizations/*}" 421 }; 422 } 423 424 // ListMyOrganizations 425 rpc ListMyOrganizations(ListMyOrganizationsRequest) 426 returns (ListMyOrganizationsResponse) { 427 option (google.api.http) = { 428 post : "/v1alpha2/organizations:listMy" 429 }; 430 } 431 }