strongdm 1.0.2 → 1.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +28 -6
  3. data/doc/LICENSE.html +6 -11
  4. data/doc/Object.html +6 -361
  5. data/doc/README_md.html +37 -19
  6. data/doc/SDM.html +6 -3
  7. data/doc/SDM/AKS.html +45 -6
  8. data/doc/SDM/AKSBasicAuth.html +45 -6
  9. data/doc/SDM/AKSServiceAccount.html +45 -6
  10. data/doc/SDM/AccountAttachment.html +8 -5
  11. data/doc/SDM/AccountAttachmentCreateOptions.html +6 -3
  12. data/doc/SDM/AccountAttachmentCreateResponse.html +8 -5
  13. data/doc/SDM/AccountAttachmentDeleteResponse.html +8 -5
  14. data/doc/SDM/AccountAttachmentGetResponse.html +8 -5
  15. data/doc/SDM/AccountAttachments.html +27 -26
  16. data/doc/SDM/AccountCreateResponse.html +8 -5
  17. data/doc/SDM/AccountDeleteResponse.html +8 -5
  18. data/doc/SDM/AccountGetResponse.html +8 -5
  19. data/doc/SDM/AccountGrant.html +8 -5
  20. data/doc/SDM/AccountGrantCreateResponse.html +8 -5
  21. data/doc/SDM/AccountGrantDeleteResponse.html +8 -5
  22. data/doc/SDM/AccountGrantGetResponse.html +8 -5
  23. data/doc/SDM/AccountGrants.html +29 -26
  24. data/doc/SDM/AccountUpdateResponse.html +8 -5
  25. data/doc/SDM/Accounts.html +35 -32
  26. data/doc/SDM/AlreadyExistsError.html +6 -3
  27. data/doc/SDM/AmazonEKS.html +45 -6
  28. data/doc/SDM/AmazonES.html +27 -6
  29. data/doc/SDM/Athena.html +27 -6
  30. data/doc/SDM/AuroraMysql.html +27 -6
  31. data/doc/SDM/AuroraPostgres.html +27 -6
  32. data/doc/SDM/AuthenticationError.html +6 -3
  33. data/doc/SDM/BadRequestError.html +6 -3
  34. data/doc/SDM/BigQuery.html +27 -6
  35. data/doc/SDM/Cassandra.html +27 -6
  36. data/doc/SDM/Citus.html +409 -0
  37. data/doc/SDM/Client.html +7 -4
  38. data/doc/SDM/Clustrix.html +27 -6
  39. data/doc/SDM/Cockroach.html +27 -6
  40. data/doc/SDM/CreateResponseMetadata.html +6 -3
  41. data/doc/SDM/DB2.html +391 -0
  42. data/doc/SDM/DB2LUW.html +391 -0
  43. data/doc/SDM/DB2i.html +391 -0
  44. data/doc/SDM/DeadlineExceededError.html +6 -3
  45. data/doc/SDM/DeleteResponseMetadata.html +6 -3
  46. data/doc/SDM/Druid.html +27 -6
  47. data/doc/SDM/DynamoDB.html +27 -6
  48. data/doc/SDM/Elastic.html +27 -6
  49. data/doc/SDM/ElasticacheRedis.html +27 -6
  50. data/doc/SDM/Gateway.html +27 -6
  51. data/doc/SDM/GetResponseMetadata.html +6 -3
  52. data/doc/SDM/GoogleGKE.html +45 -6
  53. data/doc/SDM/Greenplum.html +27 -6
  54. data/doc/SDM/HTTPAuth.html +27 -6
  55. data/doc/SDM/HTTPBasicAuth.html +27 -6
  56. data/doc/SDM/HTTPNoAuth.html +27 -6
  57. data/doc/SDM/InternalError.html +6 -3
  58. data/doc/SDM/Kubernetes.html +45 -6
  59. data/doc/SDM/KubernetesBasicAuth.html +45 -6
  60. data/doc/SDM/KubernetesServiceAccount.html +45 -6
  61. data/doc/SDM/Maria.html +27 -6
  62. data/doc/SDM/Memcached.html +27 -6
  63. data/doc/SDM/Memsql.html +27 -6
  64. data/doc/SDM/MongoHost.html +27 -6
  65. data/doc/SDM/MongoLegacyHost.html +27 -6
  66. data/doc/SDM/MongoLegacyReplicaset.html +27 -6
  67. data/doc/SDM/MongoReplicaSet.html +27 -6
  68. data/doc/SDM/Mysql.html +27 -6
  69. data/doc/SDM/NodeCreateResponse.html +8 -5
  70. data/doc/SDM/NodeDeleteResponse.html +8 -5
  71. data/doc/SDM/NodeGetResponse.html +8 -5
  72. data/doc/SDM/NodeUpdateResponse.html +8 -5
  73. data/doc/SDM/Nodes.html +35 -32
  74. data/doc/SDM/NotFoundError.html +6 -3
  75. data/doc/SDM/Oracle.html +27 -6
  76. data/doc/SDM/PermissionError.html +6 -3
  77. data/doc/SDM/Plumbing.html +4351 -3569
  78. data/doc/SDM/Postgres.html +27 -6
  79. data/doc/SDM/Presto.html +27 -6
  80. data/doc/SDM/RDP.html +27 -6
  81. data/doc/SDM/RPCError.html +6 -3
  82. data/doc/SDM/RateLimitError.html +6 -3
  83. data/doc/SDM/RateLimitMetadata.html +6 -3
  84. data/doc/SDM/Redis.html +27 -6
  85. data/doc/SDM/Redshift.html +27 -6
  86. data/doc/SDM/Relay.html +28 -7
  87. data/doc/SDM/ResourceCreateResponse.html +8 -5
  88. data/doc/SDM/ResourceDeleteResponse.html +8 -5
  89. data/doc/SDM/ResourceGetResponse.html +8 -5
  90. data/doc/SDM/ResourceUpdateResponse.html +8 -5
  91. data/doc/SDM/Resources.html +34 -31
  92. data/doc/SDM/Role.html +27 -6
  93. data/doc/SDM/RoleAttachment.html +8 -5
  94. data/doc/SDM/RoleAttachmentCreateResponse.html +8 -5
  95. data/doc/SDM/RoleAttachmentDeleteResponse.html +8 -5
  96. data/doc/SDM/RoleAttachmentGetResponse.html +8 -5
  97. data/doc/SDM/RoleAttachments.html +28 -25
  98. data/doc/SDM/RoleCreateResponse.html +8 -5
  99. data/doc/SDM/RoleDeleteResponse.html +8 -5
  100. data/doc/SDM/RoleGetResponse.html +8 -5
  101. data/doc/SDM/RoleGrant.html +8 -5
  102. data/doc/SDM/RoleGrantCreateResponse.html +8 -5
  103. data/doc/SDM/RoleGrantDeleteResponse.html +8 -5
  104. data/doc/SDM/RoleGrantGetResponse.html +8 -5
  105. data/doc/SDM/RoleGrants.html +28 -25
  106. data/doc/SDM/RoleUpdateResponse.html +8 -5
  107. data/doc/SDM/Roles.html +34 -31
  108. data/doc/SDM/SQLServer.html +27 -6
  109. data/doc/SDM/SSH.html +45 -6
  110. data/doc/SDM/SSHCert.html +373 -0
  111. data/doc/SDM/Service.html +27 -6
  112. data/doc/SDM/Snowflake.html +27 -6
  113. data/doc/SDM/Sybase.html +27 -6
  114. data/doc/SDM/SybaseIQ.html +27 -6
  115. data/doc/SDM/Teradata.html +27 -6
  116. data/doc/SDM/UpdateResponseMetadata.html +6 -3
  117. data/doc/SDM/User.html +27 -6
  118. data/doc/V1.html +36 -8
  119. data/doc/V1/AccountAttachments.html +6 -3
  120. data/doc/V1/AccountAttachments/Service.html +6 -3
  121. data/doc/V1/AccountGrants.html +6 -3
  122. data/doc/V1/AccountGrants/Service.html +7 -4
  123. data/doc/V1/Accounts.html +6 -3
  124. data/doc/V1/Accounts/Service.html +6 -3
  125. data/doc/V1/Nodes.html +6 -3
  126. data/doc/V1/Nodes/Service.html +6 -3
  127. data/doc/V1/Resources.html +6 -3
  128. data/doc/V1/Resources/Service.html +6 -3
  129. data/doc/V1/RoleAttachments.html +6 -3
  130. data/doc/V1/RoleAttachments/Service.html +6 -3
  131. data/doc/V1/RoleGrants.html +6 -3
  132. data/doc/V1/RoleGrants/Service.html +6 -3
  133. data/doc/V1/Roles.html +6 -3
  134. data/doc/V1/Roles/Service.html +6 -3
  135. data/doc/V1/Tags.html +113 -0
  136. data/doc/created.rid +38 -41
  137. data/doc/css/rdoc.css +22 -1
  138. data/doc/examples/Gemfile.html +6 -11
  139. data/doc/examples/Gemfile_lock.html +6 -3
  140. data/doc/examples/README_md.html +6 -3
  141. data/doc/examples/okta-sync/Gemfile.html +6 -3
  142. data/doc/examples/okta-sync/Gemfile_lock.html +6 -3
  143. data/doc/index.html +16 -13
  144. data/doc/js/darkfish.js +22 -99
  145. data/doc/js/navigation.js +4 -40
  146. data/doc/js/navigation.js.gz +0 -0
  147. data/doc/js/search.js +32 -31
  148. data/doc/js/search_index.js +1 -1
  149. data/doc/js/search_index.js.gz +0 -0
  150. data/doc/js/searcher.js +6 -6
  151. data/doc/js/searcher.js.gz +0 -0
  152. data/doc/lib/version.html +8 -13
  153. data/doc/strongdm_gemspec.html +6 -11
  154. data/doc/table_of_contents.html +1035 -932
  155. data/examples/Gemfile +2 -2
  156. data/examples/listUsers.rb +8 -8
  157. data/lib/errors/errors.rb +53 -55
  158. data/lib/grpc/account_attachments_pb.rb +9 -14
  159. data/lib/grpc/account_attachments_services_pb.rb +8 -7
  160. data/lib/grpc/account_grants_pb.rb +10 -10
  161. data/lib/grpc/account_grants_services_pb.rb +9 -8
  162. data/lib/grpc/accounts_pb.rb +12 -9
  163. data/lib/grpc/accounts_services_pb.rb +8 -7
  164. data/lib/grpc/drivers_pb.rb +117 -7
  165. data/lib/grpc/nodes_pb.rb +12 -9
  166. data/lib/grpc/nodes_services_pb.rb +8 -7
  167. data/lib/grpc/options_pb.rb +16 -5
  168. data/lib/grpc/plumbing.rb +4426 -4085
  169. data/lib/grpc/protoc-gen-swagger/options/annotations_pb.rb +4 -4
  170. data/lib/grpc/resources_pb.rb +9 -9
  171. data/lib/grpc/resources_services_pb.rb +8 -7
  172. data/lib/grpc/role_attachments_pb.rb +9 -9
  173. data/lib/grpc/role_attachments_services_pb.rb +8 -7
  174. data/lib/grpc/role_grants_pb.rb +9 -9
  175. data/lib/grpc/role_grants_services_pb.rb +8 -7
  176. data/lib/grpc/roles_pb.rb +11 -9
  177. data/lib/grpc/roles_services_pb.rb +8 -7
  178. data/lib/grpc/spec_pb.rb +7 -8
  179. data/lib/grpc/tags_pb.rb +36 -0
  180. data/lib/models/porcelain.rb +5348 -4415
  181. data/lib/strongdm.rb +95 -94
  182. data/lib/svc.rb +1222 -1202
  183. data/lib/version +16 -2
  184. data/lib/version.rb +1 -1
  185. data/strongdm.gemspec +10 -10
  186. metadata +9 -9
  187. data/examples/Gemfile.lock +0 -14
  188. data/examples/README.md +0 -5
  189. data/examples/okta-sync/Gemfile +0 -4
  190. data/examples/okta-sync/Gemfile.lock +0 -38
  191. data/examples/okta-sync/matchers.yml +0 -11
  192. data/examples/okta-sync/oktaSync.rb +0 -215
  193. data/examples/panicButton.rb +0 -180
@@ -1,17 +1,17 @@
1
1
  # Copyright 2020 StrongDM Inc
2
- #
2
+ #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
5
5
  # You may obtain a copy of the License at
6
- #
6
+ #
7
7
  # http://www.apache.org/licenses/LICENSE-2.0
8
- #
8
+ #
9
9
  # Unless required by applicable law or agreed to in writing, software
10
10
  # distributed under the License is distributed on an "AS IS" BASIS,
11
11
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
- #
14
+ #
15
15
 
16
16
  # This file was generated by protogen. DO NOT EDIT.
17
17
 
@@ -25,103 +25,104 @@ DEFAULT_MAX_RETRY_DELAY = 300 # 300 seconds
25
25
 
26
26
  module SDM
27
27
 
28
- # Client bundles all the services together and initializes them.
29
- class Client
30
- # Creates a new strongDM API client.
31
- def initialize(api_access_key, api_secret_key, host: "api.strongdm.com:443", insecure: false)
32
- @api_access_key = api_access_key
33
- @api_secret_key = Base64.strict_decode64(api_secret_key)
34
- @max_retries = DEFAULT_MAX_RETRIES
35
- @base_retry_delay = DEFAULT_BASE_RETRY_DELAY
36
- @max_retry_delay = DEFAULT_MAX_RETRY_DELAY
37
- @account_attachments = AccountAttachments.new(host, insecure, self)
38
- @account_grants = AccountGrants.new(host, insecure, self)
39
- @accounts = Accounts.new(host, insecure, self)
40
- @nodes = Nodes.new(host, insecure, self)
41
- @resources = Resources.new(host, insecure, self)
42
- @role_attachments = RoleAttachments.new(host, insecure, self)
43
- @role_grants = RoleGrants.new(host, insecure, self)
44
- @roles = Roles.new(host, insecure, self)
45
- @_test_options = Hash.new
46
- end
28
+ # Client bundles all the services together and initializes them.
29
+ class Client
30
+ # Creates a new strongDM API client.
31
+ def initialize(api_access_key, api_secret_key, host:"api.strongdm.com:443", insecure:false)
32
+ @api_access_key = api_access_key
33
+ @api_secret_key = Base64.strict_decode64(api_secret_key)
34
+ @max_retries = DEFAULT_MAX_RETRIES
35
+ @base_retry_delay = DEFAULT_BASE_RETRY_DELAY
36
+ @max_retry_delay = DEFAULT_MAX_RETRY_DELAY
37
+ @account_attachments = AccountAttachments.new(host, insecure, self)
38
+ @account_grants = AccountGrants.new(host, insecure, self)
39
+ @accounts = Accounts.new(host, insecure, self)
40
+ @nodes = Nodes.new(host, insecure, self)
41
+ @resources = Resources.new(host, insecure, self)
42
+ @role_attachments = RoleAttachments.new(host, insecure, self)
43
+ @role_grants = RoleGrants.new(host, insecure, self)
44
+ @roles = Roles.new(host, insecure, self)
45
+ @_test_options = Hash.new
46
+ end
47
47
 
48
- def get_metadata(method_name, req)
49
- return { 'x-sdm-authentication': @api_access_key, 'x-sdm-signature': self.sign(method_name, req.to_proto) }
50
- end
48
+ def get_metadata(method_name, req)
49
+ return { 'x-sdm-authentication': @api_access_key,'x-sdm-signature': self.sign(method_name, req.to_proto)}
50
+ end
51
51
 
52
- def sign(method_name, msg_bytes)
53
- current_utc_date = Time.now.utc
54
- date = sprintf("%04d-%02d-%02d", current_utc_date.year, current_utc_date.month, current_utc_date.day)
52
+ def sign(method_name, msg_bytes)
53
+ current_utc_date = Time.now.utc
54
+ date = sprintf("%04d-%02d-%02d",current_utc_date.year, current_utc_date.month, current_utc_date.day)
55
55
 
56
- signing_key = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, @api_secret_key, date)
57
- signing_key = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, signing_key, "sdm_api_v1")
56
+ signing_key = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, @api_secret_key, date)
57
+ signing_key = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, signing_key, 'sdm_api_v1')
58
58
 
59
- sha_req = Digest::SHA256.new
60
- sha_req << method_name
61
- sha_req << "\n"
62
- sha_req << msg_bytes
63
- request_hash = sha_req.digest
59
+ sha_req = Digest::SHA256.new
60
+ sha_req << method_name
61
+ sha_req << "\n"
62
+ sha_req << msg_bytes
63
+ request_hash = sha_req.digest
64
64
 
65
- return Base64.strict_encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, signing_key, request_hash))
66
- end
65
+ return Base64.strict_encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, signing_key, request_hash))
66
+ end
67
67
 
68
- def jitterSleep(iter)
69
- dur_max = @base_retry_delay * 2 ** iter
70
- if (dur_max > @max_retry_delay)
71
- dur_max = @max_retry_delay
72
- end
73
- dur = rand() * dur_max
74
- sleep(dur)
75
- end
68
+ def jitterSleep(iter)
69
+ dur_max = @base_retry_delay * 2**iter
70
+ if (dur_max > @max_retry_delay)
71
+ dur_max = @max_retry_delay
72
+ end
73
+ dur = rand() * dur_max
74
+ sleep(dur)
75
+ end
76
+
77
+ def shouldRetry(iter, err)
78
+ if (iter >= @max_retries-1)
79
+ return false
80
+ end
81
+ if not err .is_a? GRPC::BadStatus
82
+ return true
83
+ end
84
+ return err.code() == 13
85
+ end
86
+
87
+ attr_reader :max_retries
88
+ attr_reader :base_retry_delay
89
+ attr_reader :max_retry_delay
90
+
91
+ # API authentication token (read-only).
92
+ attr_reader :api_access_key
93
+ # AccountAttachments assign an account to a role.
94
+ attr_reader :account_attachments
95
+ # AccountGrants assign a resource directly to an account, giving the account the permission to connect to that resource.
96
+ attr_reader :account_grants
97
+ # Accounts are users that have access to strongDM.
98
+ # There are two types of accounts:
99
+ # 1. **Regular users:** humans who are authenticated through username and password or SSO
100
+ # 2. **Service users:** machines that are authneticated using a service token
101
+ attr_reader :accounts
102
+ # Nodes make up the strongDM network, and allow your users to connect securely to your resources.
103
+ # There are two types of nodes:
104
+ # 1. **Relay:** creates connectivity to your datasources, while maintaining the egress-only nature of your firewall
105
+ # 1. **Gateways:** a relay that also listens for connections from strongDM clients
106
+ attr_reader :nodes
76
107
 
77
- def shouldRetry(iter, err)
78
- if (iter >= @max_retries - 1)
79
- return false
80
- end
81
- if not err.is_a? GRPC::BadStatus
82
- return true
83
- end
84
- return err.code() == 13
108
+ attr_reader :resources
109
+ # RoleAttachments represent relationships between composite roles and the roles
110
+ # that make up those composite roles. When a composite role is attached to another
111
+ # role, the permissions granted to members of the composite role are augmented to
112
+ # include the permissions granted to members of the attached role.
113
+ attr_reader :role_attachments
114
+ # RoleGrants represent relationships between composite roles and the roles
115
+ # that make up those composite roles. When a composite role is attached to another
116
+ # role, the permissions granted to members of the composite role are augmented to
117
+ # include the permissions granted to members of the attached role.
118
+ attr_reader :role_grants
119
+ # Roles are tools for controlling user access to resources. Each Role holds a
120
+ # list of resources which they grant access to. Composite roles are a special
121
+ # type of Role which have no resource associations of their own, but instead
122
+ # grant access to the combined resources associated with a set of child roles.
123
+ # Each user can be a member of one Role or composite role.
124
+ attr_reader :roles
125
+ attr_reader :_test_options
85
126
  end
86
127
 
87
- attr_reader :max_retries
88
- attr_reader :base_retry_delay
89
- attr_reader :max_retry_delay
90
-
91
- # API authentication token (read-only).
92
- attr_reader :api_access_key
93
- # AccountAttachments assign an account to a role.
94
- attr_reader :account_attachments
95
- # AccountGrants connect a resource directly to an account, giving the account the permission to connect to that resource.
96
- attr_reader :account_grants
97
- # Accounts are users that have access to strongDM.
98
- # There are two types of accounts:
99
- # 1. **Regular users:** humans who are authenticated through username and password or SSO
100
- # 2. **Service users:** machines that are authneticated using a service token
101
- attr_reader :accounts
102
- # Nodes make up the strongDM network, and allow your users to connect securely to your resources.
103
- # There are two types of nodes:
104
- # 1. **Relay:** creates connectivity to your datasources, while maintaining the egress-only nature of your firewall
105
- # 1. **Gateways:** a relay that also listens for connections from strongDM clients
106
- attr_reader :nodes
107
-
108
- attr_reader :resources
109
- # RoleAttachments represent relationships between composite roles and the roles
110
- # that make up those composite roles. When a composite role is attached to another
111
- # role, the permissions granted to members of the composite role are augmented to
112
- # include the permissions granted to members of the attached role.
113
- attr_reader :role_attachments
114
- # RoleGrants represent relationships between composite roles and the roles
115
- # that make up those composite roles. When a composite role is attached to another
116
- # role, the permissions granted to members of the composite role are augmented to
117
- # include the permissions granted to members of the attached role.
118
- attr_reader :role_grants
119
- # Roles are tools for controlling user access to resources. Each Role holds a
120
- # list of resources which they grant access to. Composite roles are a special
121
- # type of Role which have no resource associations of their own, but instead
122
- # grant access to the combined resources associated with a set of child roles.
123
- # Each user can be a member of one Role or composite role.
124
- attr_reader :roles
125
- attr_reader :_test_options
126
- end
127
128
  end
data/lib/svc.rb CHANGED
@@ -1,1309 +1,1329 @@
1
1
  # Copyright 2020 StrongDM Inc
2
- #
2
+ #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
5
5
  # You may obtain a copy of the License at
6
- #
6
+ #
7
7
  # http://www.apache.org/licenses/LICENSE-2.0
8
- #
8
+ #
9
9
  # Unless required by applicable law or agreed to in writing, software
10
10
  # distributed under the License is distributed on an "AS IS" BASIS,
11
11
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
- #
14
+ #
15
15
 
16
16
  # This file was generated by protogen. DO NOT EDIT.
17
17
 
18
18
  this_dir = File.expand_path(File.dirname(__FILE__))
19
- lib_dir = File.join(this_dir, "grpc")
19
+ lib_dir = File.join(this_dir, 'grpc')
20
20
  $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
21
- require "grpc"
22
- require "enumerator"
23
- Dir[File.join(__dir__, "grpc", "*.rb")].each { |file| require file }
24
- Dir[File.join(__dir__, "models", "*.rb")].each { |file| require file }
21
+ require 'grpc'
22
+ require 'enumerator'
23
+ Dir[File.join(__dir__, 'grpc', '*.rb')].each {|file| require file }
24
+ Dir[File.join(__dir__, 'models', '*.rb')].each {|file| require file }
25
25
 
26
26
  module SDM
27
- # AccountAttachments assign an account to a role.
28
- class AccountAttachments
29
- def initialize(host, insecure, parent)
30
- begin
31
- if insecure
32
- @stub = V1::AccountAttachments::Stub.new(host, :this_channel_is_insecure)
33
- else
34
- cred = GRPC::Core::ChannelCredentials.new()
35
- @stub = V1::AccountAttachments::Stub.new(host, cred)
27
+ # AccountAttachments assign an account to a role.
28
+ class AccountAttachments
29
+ def initialize(host, insecure, parent)
30
+ begin
31
+ if insecure
32
+ @stub = V1::AccountAttachments::Stub.new(host, :this_channel_is_insecure)
33
+ else
34
+ cred = GRPC::Core::ChannelCredentials.new()
35
+ @stub = V1::AccountAttachments::Stub.new(host, cred)
36
+ end
37
+ rescue => exception
38
+ raise Plumbing::convert_error_to_porcelain(exception)
39
+ end
40
+ @parent = parent
36
41
  end
37
- rescue => exception
38
- raise Plumbing::error_to_porcelain(exception)
39
- end
40
- @parent = parent
41
- end
42
-
43
- # Create registers a new AccountAttachment.
44
- def create(
45
- account_attachment,
46
- options: nil,
47
- deadline: nil
48
- )
49
- req = V1::AccountAttachmentCreateRequest.new()
42
+ # Create registers a new AccountAttachment.
43
+ def create(
44
+ account_attachment \
45
+ ,
46
+ deadline:nil)
47
+ req = V1::AccountAttachmentCreateRequest.new()
48
+
49
+ req.account_attachment = Plumbing::convert_account_attachment_to_plumbing(account_attachment)
50
+ tries = 0
51
+ plumbing_response = nil
52
+ loop do
53
+ begin
54
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata('AccountAttachments.Create', req), deadline:deadline)
55
+ rescue => exception
56
+ if (@parent.shouldRetry(tries, exception))
57
+ tries++
58
+ @parent.jitterSleep(tries)
59
+ next
60
+ end
61
+ raise Plumbing::convert_error_to_porcelain(exception)
62
+ end
63
+ break
64
+ end
50
65
 
51
- req.account_attachment = Plumbing::account_attachment_to_plumbing(account_attachment)
52
- req.options = Plumbing::account_attachment_create_options_to_plumbing(options)
53
- tries = 0
54
- plumbing_response = nil
55
- loop do
56
- begin
57
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata("AccountAttachments.Create", req), deadline: deadline)
58
- rescue => exception
59
- if (@parent.shouldRetry(tries, exception))
60
- tries + +@parent.jitterSleep(tries)
61
- next
62
- end
63
- raise Plumbing::error_to_porcelain(exception)
66
+
67
+ resp = AccountAttachmentCreateResponse.new()
68
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
69
+ resp.account_attachment = Plumbing::convert_account_attachment_to_porcelain(plumbing_response.account_attachment)
70
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
71
+ resp
64
72
  end
65
- break
66
- end
67
-
68
- resp = AccountAttachmentCreateResponse.new()
69
- resp.meta = Plumbing::create_response_metadata_to_porcelain(plumbing_response.meta)
70
- resp.account_attachment = Plumbing::account_attachment_to_porcelain(plumbing_response.account_attachment)
71
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
72
- resp
73
- end
74
-
75
- # Get reads one AccountAttachment by ID.
76
- def get(
77
- id,
78
- deadline: nil
79
- )
80
- req = V1::AccountAttachmentGetRequest.new()
73
+ # Get reads one AccountAttachment by ID.
74
+ def get(
75
+ id \
76
+ ,
77
+ deadline:nil)
78
+ req = V1::AccountAttachmentGetRequest.new()
79
+
80
+ req.id = (id)
81
+ tries = 0
82
+ plumbing_response = nil
83
+ loop do
84
+ begin
85
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata('AccountAttachments.Get', req), deadline:deadline)
86
+ rescue => exception
87
+ if (@parent.shouldRetry(tries, exception))
88
+ tries++
89
+ @parent.jitterSleep(tries)
90
+ next
91
+ end
92
+ raise Plumbing::convert_error_to_porcelain(exception)
93
+ end
94
+ break
95
+ end
81
96
 
82
- req.id = id
83
- tries = 0
84
- plumbing_response = nil
85
- loop do
86
- begin
87
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata("AccountAttachments.Get", req), deadline: deadline)
88
- rescue => exception
89
- if (@parent.shouldRetry(tries, exception))
90
- tries + +@parent.jitterSleep(tries)
91
- next
92
- end
93
- raise Plumbing::error_to_porcelain(exception)
97
+
98
+ resp = AccountAttachmentGetResponse.new()
99
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
100
+ resp.account_attachment = Plumbing::convert_account_attachment_to_porcelain(plumbing_response.account_attachment)
101
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
102
+ resp
94
103
  end
95
- break
96
- end
97
-
98
- resp = AccountAttachmentGetResponse.new()
99
- resp.meta = Plumbing::get_response_metadata_to_porcelain(plumbing_response.meta)
100
- resp.account_attachment = Plumbing::account_attachment_to_porcelain(plumbing_response.account_attachment)
101
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
102
- resp
103
- end
104
-
105
- # Delete removes a AccountAttachment by ID.
106
- def delete(
107
- id,
108
- deadline: nil
109
- )
110
- req = V1::AccountAttachmentDeleteRequest.new()
104
+ # Delete removes a AccountAttachment by ID.
105
+ def delete(
106
+ id \
107
+ ,
108
+ deadline:nil)
109
+ req = V1::AccountAttachmentDeleteRequest.new()
110
+
111
+ req.id = (id)
112
+ tries = 0
113
+ plumbing_response = nil
114
+ loop do
115
+ begin
116
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('AccountAttachments.Delete', req), deadline:deadline)
117
+ rescue => exception
118
+ if (@parent.shouldRetry(tries, exception))
119
+ tries++
120
+ @parent.jitterSleep(tries)
121
+ next
122
+ end
123
+ raise Plumbing::convert_error_to_porcelain(exception)
124
+ end
125
+ break
126
+ end
111
127
 
112
- req.id = id
113
- tries = 0
114
- plumbing_response = nil
115
- loop do
116
- begin
117
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("AccountAttachments.Delete", req), deadline: deadline)
118
- rescue => exception
119
- if (@parent.shouldRetry(tries, exception))
120
- tries + +@parent.jitterSleep(tries)
121
- next
122
- end
123
- raise Plumbing::error_to_porcelain(exception)
128
+
129
+ resp = AccountAttachmentDeleteResponse.new()
130
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
131
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
132
+ resp
124
133
  end
125
- break
126
- end
127
-
128
- resp = AccountAttachmentDeleteResponse.new()
129
- resp.meta = Plumbing::delete_response_metadata_to_porcelain(plumbing_response.meta)
130
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
131
- resp
132
- end
133
-
134
- # List gets a list of AccountAttachments matching a given set of criteria.
135
- def list(
136
- filter,
137
- *args,
138
- deadline: nil
139
- )
140
- req = V1::AccountAttachmentListRequest.new()
141
- req.meta = V1::ListRequestMetadata.new()
142
- page_size_option = @parent._test_options["PageSize"]
143
- if page_size_option.is_a? Integer
144
- req.meta.limit = page_size_option
145
- end
146
-
147
- req.filter = Plumbing::quote_filter_args(filter, *args)
148
- resp = Enumerator::Generator.new { |g|
149
- tries = 0
150
- loop do
151
- begin
152
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata("AccountAttachments.List", req), deadline: deadline)
153
- rescue => exception
154
- if (@parent.shouldRetry(tries, exception))
155
- tries + +@parent.jitterSleep(tries)
156
- next
134
+ # List gets a list of AccountAttachments matching a given set of criteria.
135
+ def list(
136
+ filter \
137
+ ,
138
+ *args,
139
+ deadline:nil)
140
+ req = V1::AccountAttachmentListRequest.new()
141
+ req.meta = V1::ListRequestMetadata.new()
142
+ page_size_option = @parent._test_options['PageSize']
143
+ if page_size_option.is_a? Integer
144
+ req.meta.limit = page_size_option
157
145
  end
158
- raise Plumbing::error_to_porcelain(exception)
159
- end
160
- tries = 0
161
- plumbing_response.account_attachments.each do |plumbing_item|
162
- g.yield Plumbing::account_attachment_to_porcelain(plumbing_item)
163
- end
164
- break if plumbing_response.meta.next_cursor == ""
165
- req.meta.cursor = plumbing_response.meta.next_cursor
146
+
147
+ req.filter = Plumbing::quote_filter_args(filter, *args)
148
+ resp = Enumerator::Generator.new { |g|
149
+ tries = 0
150
+ loop do
151
+ begin
152
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata('AccountAttachments.List', req), deadline:deadline)
153
+ rescue => exception
154
+ if (@parent.shouldRetry(tries, exception))
155
+ tries++
156
+ @parent.jitterSleep(tries)
157
+ next
158
+ end
159
+ raise Plumbing::convert_error_to_porcelain(exception)
160
+ end
161
+ tries = 0
162
+ plumbing_response.account_attachments.each do |plumbing_item|
163
+ g.yield Plumbing::convert_account_attachment_to_porcelain(plumbing_item)
164
+ end
165
+ break if plumbing_response.meta.next_cursor == ""
166
+ req.meta.cursor = plumbing_response.meta.next_cursor
167
+ end
168
+ }
169
+ resp
166
170
  end
167
- }
168
- resp
169
171
  end
170
- end
171
-
172
- # AccountGrants connect a resource directly to an account, giving the account the permission to connect to that resource.
173
- class AccountGrants
174
- def initialize(host, insecure, parent)
175
- begin
176
- if insecure
177
- @stub = V1::AccountGrants::Stub.new(host, :this_channel_is_insecure)
178
- else
179
- cred = GRPC::Core::ChannelCredentials.new()
180
- @stub = V1::AccountGrants::Stub.new(host, cred)
172
+ # AccountGrants assign a resource directly to an account, giving the account the permission to connect to that resource.
173
+ class AccountGrants
174
+ def initialize(host, insecure, parent)
175
+ begin
176
+ if insecure
177
+ @stub = V1::AccountGrants::Stub.new(host, :this_channel_is_insecure)
178
+ else
179
+ cred = GRPC::Core::ChannelCredentials.new()
180
+ @stub = V1::AccountGrants::Stub.new(host, cred)
181
+ end
182
+ rescue => exception
183
+ raise Plumbing::convert_error_to_porcelain(exception)
184
+ end
185
+ @parent = parent
181
186
  end
182
- rescue => exception
183
- raise Plumbing::error_to_porcelain(exception)
184
- end
185
- @parent = parent
186
- end
187
-
188
- # Create registers a new AccountGrant.
189
- def create(
190
- account_grant,
191
- deadline: nil
192
- )
193
- req = V1::AccountGrantCreateRequest.new()
187
+ # Create registers a new AccountGrant.
188
+ def create(
189
+ account_grant \
190
+ ,
191
+ deadline:nil)
192
+ req = V1::AccountGrantCreateRequest.new()
193
+
194
+ req.account_grant = Plumbing::convert_account_grant_to_plumbing(account_grant)
195
+ tries = 0
196
+ plumbing_response = nil
197
+ loop do
198
+ begin
199
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata('AccountGrants.Create', req), deadline:deadline)
200
+ rescue => exception
201
+ if (@parent.shouldRetry(tries, exception))
202
+ tries++
203
+ @parent.jitterSleep(tries)
204
+ next
205
+ end
206
+ raise Plumbing::convert_error_to_porcelain(exception)
207
+ end
208
+ break
209
+ end
194
210
 
195
- req.account_grant = Plumbing::account_grant_to_plumbing(account_grant)
196
- tries = 0
197
- plumbing_response = nil
198
- loop do
199
- begin
200
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata("AccountGrants.Create", req), deadline: deadline)
201
- rescue => exception
202
- if (@parent.shouldRetry(tries, exception))
203
- tries + +@parent.jitterSleep(tries)
204
- next
205
- end
206
- raise Plumbing::error_to_porcelain(exception)
211
+
212
+ resp = AccountGrantCreateResponse.new()
213
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
214
+ resp.account_grant = Plumbing::convert_account_grant_to_porcelain(plumbing_response.account_grant)
215
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
216
+ resp
207
217
  end
208
- break
209
- end
210
-
211
- resp = AccountGrantCreateResponse.new()
212
- resp.meta = Plumbing::create_response_metadata_to_porcelain(plumbing_response.meta)
213
- resp.account_grant = Plumbing::account_grant_to_porcelain(plumbing_response.account_grant)
214
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
215
- resp
216
- end
217
-
218
- # Get reads one AccountGrant by ID.
219
- def get(
220
- id,
221
- deadline: nil
222
- )
223
- req = V1::AccountGrantGetRequest.new()
218
+ # Get reads one AccountGrant by ID.
219
+ def get(
220
+ id \
221
+ ,
222
+ deadline:nil)
223
+ req = V1::AccountGrantGetRequest.new()
224
+
225
+ req.id = (id)
226
+ tries = 0
227
+ plumbing_response = nil
228
+ loop do
229
+ begin
230
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata('AccountGrants.Get', req), deadline:deadline)
231
+ rescue => exception
232
+ if (@parent.shouldRetry(tries, exception))
233
+ tries++
234
+ @parent.jitterSleep(tries)
235
+ next
236
+ end
237
+ raise Plumbing::convert_error_to_porcelain(exception)
238
+ end
239
+ break
240
+ end
224
241
 
225
- req.id = id
226
- tries = 0
227
- plumbing_response = nil
228
- loop do
229
- begin
230
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata("AccountGrants.Get", req), deadline: deadline)
231
- rescue => exception
232
- if (@parent.shouldRetry(tries, exception))
233
- tries + +@parent.jitterSleep(tries)
234
- next
235
- end
236
- raise Plumbing::error_to_porcelain(exception)
242
+
243
+ resp = AccountGrantGetResponse.new()
244
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
245
+ resp.account_grant = Plumbing::convert_account_grant_to_porcelain(plumbing_response.account_grant)
246
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
247
+ resp
237
248
  end
238
- break
239
- end
240
-
241
- resp = AccountGrantGetResponse.new()
242
- resp.meta = Plumbing::get_response_metadata_to_porcelain(plumbing_response.meta)
243
- resp.account_grant = Plumbing::account_grant_to_porcelain(plumbing_response.account_grant)
244
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
245
- resp
246
- end
247
-
248
- # Delete removes a AccountGrant by ID.
249
- def delete(
250
- id,
251
- deadline: nil
252
- )
253
- req = V1::AccountGrantDeleteRequest.new()
249
+ # Delete removes a AccountGrant by ID.
250
+ def delete(
251
+ id \
252
+ ,
253
+ deadline:nil)
254
+ req = V1::AccountGrantDeleteRequest.new()
255
+
256
+ req.id = (id)
257
+ tries = 0
258
+ plumbing_response = nil
259
+ loop do
260
+ begin
261
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('AccountGrants.Delete', req), deadline:deadline)
262
+ rescue => exception
263
+ if (@parent.shouldRetry(tries, exception))
264
+ tries++
265
+ @parent.jitterSleep(tries)
266
+ next
267
+ end
268
+ raise Plumbing::convert_error_to_porcelain(exception)
269
+ end
270
+ break
271
+ end
254
272
 
255
- req.id = id
256
- tries = 0
257
- plumbing_response = nil
258
- loop do
259
- begin
260
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("AccountGrants.Delete", req), deadline: deadline)
261
- rescue => exception
262
- if (@parent.shouldRetry(tries, exception))
263
- tries + +@parent.jitterSleep(tries)
264
- next
265
- end
266
- raise Plumbing::error_to_porcelain(exception)
273
+
274
+ resp = AccountGrantDeleteResponse.new()
275
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
276
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
277
+ resp
267
278
  end
268
- break
269
- end
270
-
271
- resp = AccountGrantDeleteResponse.new()
272
- resp.meta = Plumbing::delete_response_metadata_to_porcelain(plumbing_response.meta)
273
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
274
- resp
275
- end
276
-
277
- # List gets a list of AccountGrants matching a given set of criteria.
278
- def list(
279
- filter,
280
- *args,
281
- deadline: nil
282
- )
283
- req = V1::AccountGrantListRequest.new()
284
- req.meta = V1::ListRequestMetadata.new()
285
- page_size_option = @parent._test_options["PageSize"]
286
- if page_size_option.is_a? Integer
287
- req.meta.limit = page_size_option
288
- end
289
-
290
- req.filter = Plumbing::quote_filter_args(filter, *args)
291
- resp = Enumerator::Generator.new { |g|
292
- tries = 0
293
- loop do
294
- begin
295
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata("AccountGrants.List", req), deadline: deadline)
296
- rescue => exception
297
- if (@parent.shouldRetry(tries, exception))
298
- tries + +@parent.jitterSleep(tries)
299
- next
279
+ # List gets a list of AccountGrants matching a given set of criteria.
280
+ def list(
281
+ filter \
282
+ ,
283
+ *args,
284
+ deadline:nil)
285
+ req = V1::AccountGrantListRequest.new()
286
+ req.meta = V1::ListRequestMetadata.new()
287
+ page_size_option = @parent._test_options['PageSize']
288
+ if page_size_option.is_a? Integer
289
+ req.meta.limit = page_size_option
300
290
  end
301
- raise Plumbing::error_to_porcelain(exception)
302
- end
303
- tries = 0
304
- plumbing_response.account_grants.each do |plumbing_item|
305
- g.yield Plumbing::account_grant_to_porcelain(plumbing_item)
306
- end
307
- break if plumbing_response.meta.next_cursor == ""
308
- req.meta.cursor = plumbing_response.meta.next_cursor
291
+
292
+ req.filter = Plumbing::quote_filter_args(filter, *args)
293
+ resp = Enumerator::Generator.new { |g|
294
+ tries = 0
295
+ loop do
296
+ begin
297
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata('AccountGrants.List', req), deadline:deadline)
298
+ rescue => exception
299
+ if (@parent.shouldRetry(tries, exception))
300
+ tries++
301
+ @parent.jitterSleep(tries)
302
+ next
303
+ end
304
+ raise Plumbing::convert_error_to_porcelain(exception)
305
+ end
306
+ tries = 0
307
+ plumbing_response.account_grants.each do |plumbing_item|
308
+ g.yield Plumbing::convert_account_grant_to_porcelain(plumbing_item)
309
+ end
310
+ break if plumbing_response.meta.next_cursor == ""
311
+ req.meta.cursor = plumbing_response.meta.next_cursor
312
+ end
313
+ }
314
+ resp
309
315
  end
310
- }
311
- resp
312
316
  end
313
- end
314
-
315
- # Accounts are users that have access to strongDM.
316
- # There are two types of accounts:
317
- # 1. **Regular users:** humans who are authenticated through username and password or SSO
318
- # 2. **Service users:** machines that are authneticated using a service token
319
- class Accounts
320
- def initialize(host, insecure, parent)
321
- begin
322
- if insecure
323
- @stub = V1::Accounts::Stub.new(host, :this_channel_is_insecure)
324
- else
325
- cred = GRPC::Core::ChannelCredentials.new()
326
- @stub = V1::Accounts::Stub.new(host, cred)
317
+ # Accounts are users that have access to strongDM.
318
+ # There are two types of accounts:
319
+ # 1. **Regular users:** humans who are authenticated through username and password or SSO
320
+ # 2. **Service users:** machines that are authneticated using a service token
321
+ class Accounts
322
+ def initialize(host, insecure, parent)
323
+ begin
324
+ if insecure
325
+ @stub = V1::Accounts::Stub.new(host, :this_channel_is_insecure)
326
+ else
327
+ cred = GRPC::Core::ChannelCredentials.new()
328
+ @stub = V1::Accounts::Stub.new(host, cred)
329
+ end
330
+ rescue => exception
331
+ raise Plumbing::convert_error_to_porcelain(exception)
332
+ end
333
+ @parent = parent
327
334
  end
328
- rescue => exception
329
- raise Plumbing::error_to_porcelain(exception)
330
- end
331
- @parent = parent
332
- end
333
-
334
- # Create registers a new Account.
335
- def create(
336
- account,
337
- deadline: nil
338
- )
339
- req = V1::AccountCreateRequest.new()
335
+ # Create registers a new Account.
336
+ def create(
337
+ account \
338
+ ,
339
+ deadline:nil)
340
+ req = V1::AccountCreateRequest.new()
341
+
342
+ req.account = Plumbing::convert_account_to_plumbing(account)
343
+ tries = 0
344
+ plumbing_response = nil
345
+ loop do
346
+ begin
347
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata('Accounts.Create', req), deadline:deadline)
348
+ rescue => exception
349
+ if (@parent.shouldRetry(tries, exception))
350
+ tries++
351
+ @parent.jitterSleep(tries)
352
+ next
353
+ end
354
+ raise Plumbing::convert_error_to_porcelain(exception)
355
+ end
356
+ break
357
+ end
340
358
 
341
- req.account = Plumbing::account_to_plumbing(account)
342
- tries = 0
343
- plumbing_response = nil
344
- loop do
345
- begin
346
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata("Accounts.Create", req), deadline: deadline)
347
- rescue => exception
348
- if (@parent.shouldRetry(tries, exception))
349
- tries + +@parent.jitterSleep(tries)
350
- next
351
- end
352
- raise Plumbing::error_to_porcelain(exception)
359
+
360
+ resp = AccountCreateResponse.new()
361
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
362
+ resp.account = Plumbing::convert_account_to_porcelain(plumbing_response.account)
363
+ resp.token = (plumbing_response.token)
364
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
365
+ resp
353
366
  end
354
- break
355
- end
356
-
357
- resp = AccountCreateResponse.new()
358
- resp.meta = Plumbing::create_response_metadata_to_porcelain(plumbing_response.meta)
359
- resp.account = Plumbing::account_to_porcelain(plumbing_response.account)
360
- resp.token = plumbing_response.token
361
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
362
- resp
363
- end
364
-
365
- # Get reads one Account by ID.
366
- def get(
367
- id,
368
- deadline: nil
369
- )
370
- req = V1::AccountGetRequest.new()
367
+ # Get reads one Account by ID.
368
+ def get(
369
+ id \
370
+ ,
371
+ deadline:nil)
372
+ req = V1::AccountGetRequest.new()
373
+
374
+ req.id = (id)
375
+ tries = 0
376
+ plumbing_response = nil
377
+ loop do
378
+ begin
379
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata('Accounts.Get', req), deadline:deadline)
380
+ rescue => exception
381
+ if (@parent.shouldRetry(tries, exception))
382
+ tries++
383
+ @parent.jitterSleep(tries)
384
+ next
385
+ end
386
+ raise Plumbing::convert_error_to_porcelain(exception)
387
+ end
388
+ break
389
+ end
371
390
 
372
- req.id = id
373
- tries = 0
374
- plumbing_response = nil
375
- loop do
376
- begin
377
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata("Accounts.Get", req), deadline: deadline)
378
- rescue => exception
379
- if (@parent.shouldRetry(tries, exception))
380
- tries + +@parent.jitterSleep(tries)
381
- next
382
- end
383
- raise Plumbing::error_to_porcelain(exception)
391
+
392
+ resp = AccountGetResponse.new()
393
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
394
+ resp.account = Plumbing::convert_account_to_porcelain(plumbing_response.account)
395
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
396
+ resp
384
397
  end
385
- break
386
- end
387
-
388
- resp = AccountGetResponse.new()
389
- resp.meta = Plumbing::get_response_metadata_to_porcelain(plumbing_response.meta)
390
- resp.account = Plumbing::account_to_porcelain(plumbing_response.account)
391
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
392
- resp
393
- end
394
-
395
- # Update patches a Account by ID.
396
- def update(
397
- account,
398
- deadline: nil
399
- )
400
- req = V1::AccountUpdateRequest.new()
398
+ # Update patches a Account by ID.
399
+ def update(
400
+ account \
401
+ ,
402
+ deadline:nil)
403
+ req = V1::AccountUpdateRequest.new()
404
+
405
+ req.account = Plumbing::convert_account_to_plumbing(account)
406
+ tries = 0
407
+ plumbing_response = nil
408
+ loop do
409
+ begin
410
+ plumbing_response = @stub.update(req, metadata: @parent.get_metadata('Accounts.Update', req), deadline:deadline)
411
+ rescue => exception
412
+ if (@parent.shouldRetry(tries, exception))
413
+ tries++
414
+ @parent.jitterSleep(tries)
415
+ next
416
+ end
417
+ raise Plumbing::convert_error_to_porcelain(exception)
418
+ end
419
+ break
420
+ end
401
421
 
402
- req.account = Plumbing::account_to_plumbing(account)
403
- tries = 0
404
- plumbing_response = nil
405
- loop do
406
- begin
407
- plumbing_response = @stub.update(req, metadata: @parent.get_metadata("Accounts.Update", req), deadline: deadline)
408
- rescue => exception
409
- if (@parent.shouldRetry(tries, exception))
410
- tries + +@parent.jitterSleep(tries)
411
- next
412
- end
413
- raise Plumbing::error_to_porcelain(exception)
422
+
423
+ resp = AccountUpdateResponse.new()
424
+ resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)
425
+ resp.account = Plumbing::convert_account_to_porcelain(plumbing_response.account)
426
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
427
+ resp
414
428
  end
415
- break
416
- end
417
-
418
- resp = AccountUpdateResponse.new()
419
- resp.meta = Plumbing::update_response_metadata_to_porcelain(plumbing_response.meta)
420
- resp.account = Plumbing::account_to_porcelain(plumbing_response.account)
421
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
422
- resp
423
- end
424
-
425
- # Delete removes a Account by ID.
426
- def delete(
427
- id,
428
- deadline: nil
429
- )
430
- req = V1::AccountDeleteRequest.new()
429
+ # Delete removes a Account by ID.
430
+ def delete(
431
+ id \
432
+ ,
433
+ deadline:nil)
434
+ req = V1::AccountDeleteRequest.new()
435
+
436
+ req.id = (id)
437
+ tries = 0
438
+ plumbing_response = nil
439
+ loop do
440
+ begin
441
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('Accounts.Delete', req), deadline:deadline)
442
+ rescue => exception
443
+ if (@parent.shouldRetry(tries, exception))
444
+ tries++
445
+ @parent.jitterSleep(tries)
446
+ next
447
+ end
448
+ raise Plumbing::convert_error_to_porcelain(exception)
449
+ end
450
+ break
451
+ end
431
452
 
432
- req.id = id
433
- tries = 0
434
- plumbing_response = nil
435
- loop do
436
- begin
437
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("Accounts.Delete", req), deadline: deadline)
438
- rescue => exception
439
- if (@parent.shouldRetry(tries, exception))
440
- tries + +@parent.jitterSleep(tries)
441
- next
442
- end
443
- raise Plumbing::error_to_porcelain(exception)
453
+
454
+ resp = AccountDeleteResponse.new()
455
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
456
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
457
+ resp
444
458
  end
445
- break
446
- end
447
-
448
- resp = AccountDeleteResponse.new()
449
- resp.meta = Plumbing::delete_response_metadata_to_porcelain(plumbing_response.meta)
450
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
451
- resp
452
- end
453
-
454
- # List gets a list of Accounts matching a given set of criteria.
455
- def list(
456
- filter,
457
- *args,
458
- deadline: nil
459
- )
460
- req = V1::AccountListRequest.new()
461
- req.meta = V1::ListRequestMetadata.new()
462
- page_size_option = @parent._test_options["PageSize"]
463
- if page_size_option.is_a? Integer
464
- req.meta.limit = page_size_option
465
- end
466
-
467
- req.filter = Plumbing::quote_filter_args(filter, *args)
468
- resp = Enumerator::Generator.new { |g|
469
- tries = 0
470
- loop do
471
- begin
472
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata("Accounts.List", req), deadline: deadline)
473
- rescue => exception
474
- if (@parent.shouldRetry(tries, exception))
475
- tries + +@parent.jitterSleep(tries)
476
- next
459
+ # List gets a list of Accounts matching a given set of criteria.
460
+ def list(
461
+ filter \
462
+ ,
463
+ *args,
464
+ deadline:nil)
465
+ req = V1::AccountListRequest.new()
466
+ req.meta = V1::ListRequestMetadata.new()
467
+ page_size_option = @parent._test_options['PageSize']
468
+ if page_size_option.is_a? Integer
469
+ req.meta.limit = page_size_option
477
470
  end
478
- raise Plumbing::error_to_porcelain(exception)
479
- end
480
- tries = 0
481
- plumbing_response.accounts.each do |plumbing_item|
482
- g.yield Plumbing::account_to_porcelain(plumbing_item)
483
- end
484
- break if plumbing_response.meta.next_cursor == ""
485
- req.meta.cursor = plumbing_response.meta.next_cursor
471
+
472
+ req.filter = Plumbing::quote_filter_args(filter, *args)
473
+ resp = Enumerator::Generator.new { |g|
474
+ tries = 0
475
+ loop do
476
+ begin
477
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata('Accounts.List', req), deadline:deadline)
478
+ rescue => exception
479
+ if (@parent.shouldRetry(tries, exception))
480
+ tries++
481
+ @parent.jitterSleep(tries)
482
+ next
483
+ end
484
+ raise Plumbing::convert_error_to_porcelain(exception)
485
+ end
486
+ tries = 0
487
+ plumbing_response.accounts.each do |plumbing_item|
488
+ g.yield Plumbing::convert_account_to_porcelain(plumbing_item)
489
+ end
490
+ break if plumbing_response.meta.next_cursor == ""
491
+ req.meta.cursor = plumbing_response.meta.next_cursor
492
+ end
493
+ }
494
+ resp
486
495
  end
487
- }
488
- resp
489
496
  end
490
- end
491
-
492
- # Nodes make up the strongDM network, and allow your users to connect securely to your resources.
493
- # There are two types of nodes:
494
- # 1. **Relay:** creates connectivity to your datasources, while maintaining the egress-only nature of your firewall
495
- # 1. **Gateways:** a relay that also listens for connections from strongDM clients
496
- class Nodes
497
- def initialize(host, insecure, parent)
498
- begin
499
- if insecure
500
- @stub = V1::Nodes::Stub.new(host, :this_channel_is_insecure)
501
- else
502
- cred = GRPC::Core::ChannelCredentials.new()
503
- @stub = V1::Nodes::Stub.new(host, cred)
497
+ # Nodes make up the strongDM network, and allow your users to connect securely to your resources.
498
+ # There are two types of nodes:
499
+ # 1. **Relay:** creates connectivity to your datasources, while maintaining the egress-only nature of your firewall
500
+ # 1. **Gateways:** a relay that also listens for connections from strongDM clients
501
+ class Nodes
502
+ def initialize(host, insecure, parent)
503
+ begin
504
+ if insecure
505
+ @stub = V1::Nodes::Stub.new(host, :this_channel_is_insecure)
506
+ else
507
+ cred = GRPC::Core::ChannelCredentials.new()
508
+ @stub = V1::Nodes::Stub.new(host, cred)
509
+ end
510
+ rescue => exception
511
+ raise Plumbing::convert_error_to_porcelain(exception)
512
+ end
513
+ @parent = parent
504
514
  end
505
- rescue => exception
506
- raise Plumbing::error_to_porcelain(exception)
507
- end
508
- @parent = parent
509
- end
510
-
511
- # Create registers a new Node.
512
- def create(
513
- node,
514
- deadline: nil
515
- )
516
- req = V1::NodeCreateRequest.new()
515
+ # Create registers a new Node.
516
+ def create(
517
+ node \
518
+ ,
519
+ deadline:nil)
520
+ req = V1::NodeCreateRequest.new()
521
+
522
+ req.node = Plumbing::convert_node_to_plumbing(node)
523
+ tries = 0
524
+ plumbing_response = nil
525
+ loop do
526
+ begin
527
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata('Nodes.Create', req), deadline:deadline)
528
+ rescue => exception
529
+ if (@parent.shouldRetry(tries, exception))
530
+ tries++
531
+ @parent.jitterSleep(tries)
532
+ next
533
+ end
534
+ raise Plumbing::convert_error_to_porcelain(exception)
535
+ end
536
+ break
537
+ end
517
538
 
518
- req.node = Plumbing::node_to_plumbing(node)
519
- tries = 0
520
- plumbing_response = nil
521
- loop do
522
- begin
523
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata("Nodes.Create", req), deadline: deadline)
524
- rescue => exception
525
- if (@parent.shouldRetry(tries, exception))
526
- tries + +@parent.jitterSleep(tries)
527
- next
528
- end
529
- raise Plumbing::error_to_porcelain(exception)
539
+
540
+ resp = NodeCreateResponse.new()
541
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
542
+ resp.node = Plumbing::convert_node_to_porcelain(plumbing_response.node)
543
+ resp.token = (plumbing_response.token)
544
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
545
+ resp
530
546
  end
531
- break
532
- end
533
-
534
- resp = NodeCreateResponse.new()
535
- resp.meta = Plumbing::create_response_metadata_to_porcelain(plumbing_response.meta)
536
- resp.node = Plumbing::node_to_porcelain(plumbing_response.node)
537
- resp.token = plumbing_response.token
538
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
539
- resp
540
- end
541
-
542
- # Get reads one Node by ID.
543
- def get(
544
- id,
545
- deadline: nil
546
- )
547
- req = V1::NodeGetRequest.new()
547
+ # Get reads one Node by ID.
548
+ def get(
549
+ id \
550
+ ,
551
+ deadline:nil)
552
+ req = V1::NodeGetRequest.new()
553
+
554
+ req.id = (id)
555
+ tries = 0
556
+ plumbing_response = nil
557
+ loop do
558
+ begin
559
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata('Nodes.Get', req), deadline:deadline)
560
+ rescue => exception
561
+ if (@parent.shouldRetry(tries, exception))
562
+ tries++
563
+ @parent.jitterSleep(tries)
564
+ next
565
+ end
566
+ raise Plumbing::convert_error_to_porcelain(exception)
567
+ end
568
+ break
569
+ end
548
570
 
549
- req.id = id
550
- tries = 0
551
- plumbing_response = nil
552
- loop do
553
- begin
554
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata("Nodes.Get", req), deadline: deadline)
555
- rescue => exception
556
- if (@parent.shouldRetry(tries, exception))
557
- tries + +@parent.jitterSleep(tries)
558
- next
559
- end
560
- raise Plumbing::error_to_porcelain(exception)
571
+
572
+ resp = NodeGetResponse.new()
573
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
574
+ resp.node = Plumbing::convert_node_to_porcelain(plumbing_response.node)
575
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
576
+ resp
561
577
  end
562
- break
563
- end
564
-
565
- resp = NodeGetResponse.new()
566
- resp.meta = Plumbing::get_response_metadata_to_porcelain(plumbing_response.meta)
567
- resp.node = Plumbing::node_to_porcelain(plumbing_response.node)
568
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
569
- resp
570
- end
571
-
572
- # Update patches a Node by ID.
573
- def update(
574
- node,
575
- deadline: nil
576
- )
577
- req = V1::NodeUpdateRequest.new()
578
+ # Update patches a Node by ID.
579
+ def update(
580
+ node \
581
+ ,
582
+ deadline:nil)
583
+ req = V1::NodeUpdateRequest.new()
584
+
585
+ req.node = Plumbing::convert_node_to_plumbing(node)
586
+ tries = 0
587
+ plumbing_response = nil
588
+ loop do
589
+ begin
590
+ plumbing_response = @stub.update(req, metadata: @parent.get_metadata('Nodes.Update', req), deadline:deadline)
591
+ rescue => exception
592
+ if (@parent.shouldRetry(tries, exception))
593
+ tries++
594
+ @parent.jitterSleep(tries)
595
+ next
596
+ end
597
+ raise Plumbing::convert_error_to_porcelain(exception)
598
+ end
599
+ break
600
+ end
578
601
 
579
- req.node = Plumbing::node_to_plumbing(node)
580
- tries = 0
581
- plumbing_response = nil
582
- loop do
583
- begin
584
- plumbing_response = @stub.update(req, metadata: @parent.get_metadata("Nodes.Update", req), deadline: deadline)
585
- rescue => exception
586
- if (@parent.shouldRetry(tries, exception))
587
- tries + +@parent.jitterSleep(tries)
588
- next
589
- end
590
- raise Plumbing::error_to_porcelain(exception)
602
+
603
+ resp = NodeUpdateResponse.new()
604
+ resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)
605
+ resp.node = Plumbing::convert_node_to_porcelain(plumbing_response.node)
606
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
607
+ resp
591
608
  end
592
- break
593
- end
594
-
595
- resp = NodeUpdateResponse.new()
596
- resp.meta = Plumbing::update_response_metadata_to_porcelain(plumbing_response.meta)
597
- resp.node = Plumbing::node_to_porcelain(plumbing_response.node)
598
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
599
- resp
600
- end
601
-
602
- # Delete removes a Node by ID.
603
- def delete(
604
- id,
605
- deadline: nil
606
- )
607
- req = V1::NodeDeleteRequest.new()
609
+ # Delete removes a Node by ID.
610
+ def delete(
611
+ id \
612
+ ,
613
+ deadline:nil)
614
+ req = V1::NodeDeleteRequest.new()
615
+
616
+ req.id = (id)
617
+ tries = 0
618
+ plumbing_response = nil
619
+ loop do
620
+ begin
621
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('Nodes.Delete', req), deadline:deadline)
622
+ rescue => exception
623
+ if (@parent.shouldRetry(tries, exception))
624
+ tries++
625
+ @parent.jitterSleep(tries)
626
+ next
627
+ end
628
+ raise Plumbing::convert_error_to_porcelain(exception)
629
+ end
630
+ break
631
+ end
608
632
 
609
- req.id = id
610
- tries = 0
611
- plumbing_response = nil
612
- loop do
613
- begin
614
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("Nodes.Delete", req), deadline: deadline)
615
- rescue => exception
616
- if (@parent.shouldRetry(tries, exception))
617
- tries + +@parent.jitterSleep(tries)
618
- next
619
- end
620
- raise Plumbing::error_to_porcelain(exception)
633
+
634
+ resp = NodeDeleteResponse.new()
635
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
636
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
637
+ resp
621
638
  end
622
- break
623
- end
624
-
625
- resp = NodeDeleteResponse.new()
626
- resp.meta = Plumbing::delete_response_metadata_to_porcelain(plumbing_response.meta)
627
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
628
- resp
629
- end
630
-
631
- # List gets a list of Nodes matching a given set of criteria.
632
- def list(
633
- filter,
634
- *args,
635
- deadline: nil
636
- )
637
- req = V1::NodeListRequest.new()
638
- req.meta = V1::ListRequestMetadata.new()
639
- page_size_option = @parent._test_options["PageSize"]
640
- if page_size_option.is_a? Integer
641
- req.meta.limit = page_size_option
642
- end
643
-
644
- req.filter = Plumbing::quote_filter_args(filter, *args)
645
- resp = Enumerator::Generator.new { |g|
646
- tries = 0
647
- loop do
648
- begin
649
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata("Nodes.List", req), deadline: deadline)
650
- rescue => exception
651
- if (@parent.shouldRetry(tries, exception))
652
- tries + +@parent.jitterSleep(tries)
653
- next
639
+ # List gets a list of Nodes matching a given set of criteria.
640
+ def list(
641
+ filter \
642
+ ,
643
+ *args,
644
+ deadline:nil)
645
+ req = V1::NodeListRequest.new()
646
+ req.meta = V1::ListRequestMetadata.new()
647
+ page_size_option = @parent._test_options['PageSize']
648
+ if page_size_option.is_a? Integer
649
+ req.meta.limit = page_size_option
654
650
  end
655
- raise Plumbing::error_to_porcelain(exception)
656
- end
657
- tries = 0
658
- plumbing_response.nodes.each do |plumbing_item|
659
- g.yield Plumbing::node_to_porcelain(plumbing_item)
660
- end
661
- break if plumbing_response.meta.next_cursor == ""
662
- req.meta.cursor = plumbing_response.meta.next_cursor
651
+
652
+ req.filter = Plumbing::quote_filter_args(filter, *args)
653
+ resp = Enumerator::Generator.new { |g|
654
+ tries = 0
655
+ loop do
656
+ begin
657
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata('Nodes.List', req), deadline:deadline)
658
+ rescue => exception
659
+ if (@parent.shouldRetry(tries, exception))
660
+ tries++
661
+ @parent.jitterSleep(tries)
662
+ next
663
+ end
664
+ raise Plumbing::convert_error_to_porcelain(exception)
665
+ end
666
+ tries = 0
667
+ plumbing_response.nodes.each do |plumbing_item|
668
+ g.yield Plumbing::convert_node_to_porcelain(plumbing_item)
669
+ end
670
+ break if plumbing_response.meta.next_cursor == ""
671
+ req.meta.cursor = plumbing_response.meta.next_cursor
672
+ end
673
+ }
674
+ resp
663
675
  end
664
- }
665
- resp
666
676
  end
667
- end
668
677
 
669
- class Resources
670
- def initialize(host, insecure, parent)
671
- begin
672
- if insecure
673
- @stub = V1::Resources::Stub.new(host, :this_channel_is_insecure)
674
- else
675
- cred = GRPC::Core::ChannelCredentials.new()
676
- @stub = V1::Resources::Stub.new(host, cred)
678
+ class Resources
679
+ def initialize(host, insecure, parent)
680
+ begin
681
+ if insecure
682
+ @stub = V1::Resources::Stub.new(host, :this_channel_is_insecure)
683
+ else
684
+ cred = GRPC::Core::ChannelCredentials.new()
685
+ @stub = V1::Resources::Stub.new(host, cred)
686
+ end
687
+ rescue => exception
688
+ raise Plumbing::convert_error_to_porcelain(exception)
689
+ end
690
+ @parent = parent
677
691
  end
678
- rescue => exception
679
- raise Plumbing::error_to_porcelain(exception)
680
- end
681
- @parent = parent
682
- end
683
-
684
- # Create registers a new Resource.
685
- def create(
686
- resource,
687
- deadline: nil
688
- )
689
- req = V1::ResourceCreateRequest.new()
692
+ # Create registers a new Resource.
693
+ def create(
694
+ resource \
695
+ ,
696
+ deadline:nil)
697
+ req = V1::ResourceCreateRequest.new()
698
+
699
+ req.resource = Plumbing::convert_resource_to_plumbing(resource)
700
+ tries = 0
701
+ plumbing_response = nil
702
+ loop do
703
+ begin
704
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata('Resources.Create', req), deadline:deadline)
705
+ rescue => exception
706
+ if (@parent.shouldRetry(tries, exception))
707
+ tries++
708
+ @parent.jitterSleep(tries)
709
+ next
710
+ end
711
+ raise Plumbing::convert_error_to_porcelain(exception)
712
+ end
713
+ break
714
+ end
690
715
 
691
- req.resource = Plumbing::resource_to_plumbing(resource)
692
- tries = 0
693
- plumbing_response = nil
694
- loop do
695
- begin
696
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata("Resources.Create", req), deadline: deadline)
697
- rescue => exception
698
- if (@parent.shouldRetry(tries, exception))
699
- tries + +@parent.jitterSleep(tries)
700
- next
701
- end
702
- raise Plumbing::error_to_porcelain(exception)
716
+
717
+ resp = ResourceCreateResponse.new()
718
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
719
+ resp.resource = Plumbing::convert_resource_to_porcelain(plumbing_response.resource)
720
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
721
+ resp
703
722
  end
704
- break
705
- end
706
-
707
- resp = ResourceCreateResponse.new()
708
- resp.meta = Plumbing::create_response_metadata_to_porcelain(plumbing_response.meta)
709
- resp.resource = Plumbing::resource_to_porcelain(plumbing_response.resource)
710
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
711
- resp
712
- end
713
-
714
- # Get reads one Resource by ID.
715
- def get(
716
- id,
717
- deadline: nil
718
- )
719
- req = V1::ResourceGetRequest.new()
723
+ # Get reads one Resource by ID.
724
+ def get(
725
+ id \
726
+ ,
727
+ deadline:nil)
728
+ req = V1::ResourceGetRequest.new()
729
+
730
+ req.id = (id)
731
+ tries = 0
732
+ plumbing_response = nil
733
+ loop do
734
+ begin
735
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata('Resources.Get', req), deadline:deadline)
736
+ rescue => exception
737
+ if (@parent.shouldRetry(tries, exception))
738
+ tries++
739
+ @parent.jitterSleep(tries)
740
+ next
741
+ end
742
+ raise Plumbing::convert_error_to_porcelain(exception)
743
+ end
744
+ break
745
+ end
720
746
 
721
- req.id = id
722
- tries = 0
723
- plumbing_response = nil
724
- loop do
725
- begin
726
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata("Resources.Get", req), deadline: deadline)
727
- rescue => exception
728
- if (@parent.shouldRetry(tries, exception))
729
- tries + +@parent.jitterSleep(tries)
730
- next
731
- end
732
- raise Plumbing::error_to_porcelain(exception)
747
+
748
+ resp = ResourceGetResponse.new()
749
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
750
+ resp.resource = Plumbing::convert_resource_to_porcelain(plumbing_response.resource)
751
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
752
+ resp
733
753
  end
734
- break
735
- end
736
-
737
- resp = ResourceGetResponse.new()
738
- resp.meta = Plumbing::get_response_metadata_to_porcelain(plumbing_response.meta)
739
- resp.resource = Plumbing::resource_to_porcelain(plumbing_response.resource)
740
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
741
- resp
742
- end
743
-
744
- # Update patches a Resource by ID.
745
- def update(
746
- resource,
747
- deadline: nil
748
- )
749
- req = V1::ResourceUpdateRequest.new()
754
+ # Update patches a Resource by ID.
755
+ def update(
756
+ resource \
757
+ ,
758
+ deadline:nil)
759
+ req = V1::ResourceUpdateRequest.new()
760
+
761
+ req.resource = Plumbing::convert_resource_to_plumbing(resource)
762
+ tries = 0
763
+ plumbing_response = nil
764
+ loop do
765
+ begin
766
+ plumbing_response = @stub.update(req, metadata: @parent.get_metadata('Resources.Update', req), deadline:deadline)
767
+ rescue => exception
768
+ if (@parent.shouldRetry(tries, exception))
769
+ tries++
770
+ @parent.jitterSleep(tries)
771
+ next
772
+ end
773
+ raise Plumbing::convert_error_to_porcelain(exception)
774
+ end
775
+ break
776
+ end
750
777
 
751
- req.resource = Plumbing::resource_to_plumbing(resource)
752
- tries = 0
753
- plumbing_response = nil
754
- loop do
755
- begin
756
- plumbing_response = @stub.update(req, metadata: @parent.get_metadata("Resources.Update", req), deadline: deadline)
757
- rescue => exception
758
- if (@parent.shouldRetry(tries, exception))
759
- tries + +@parent.jitterSleep(tries)
760
- next
761
- end
762
- raise Plumbing::error_to_porcelain(exception)
778
+
779
+ resp = ResourceUpdateResponse.new()
780
+ resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)
781
+ resp.resource = Plumbing::convert_resource_to_porcelain(plumbing_response.resource)
782
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
783
+ resp
763
784
  end
764
- break
765
- end
766
-
767
- resp = ResourceUpdateResponse.new()
768
- resp.meta = Plumbing::update_response_metadata_to_porcelain(plumbing_response.meta)
769
- resp.resource = Plumbing::resource_to_porcelain(plumbing_response.resource)
770
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
771
- resp
772
- end
773
-
774
- # Delete removes a Resource by ID.
775
- def delete(
776
- id,
777
- deadline: nil
778
- )
779
- req = V1::ResourceDeleteRequest.new()
785
+ # Delete removes a Resource by ID.
786
+ def delete(
787
+ id \
788
+ ,
789
+ deadline:nil)
790
+ req = V1::ResourceDeleteRequest.new()
791
+
792
+ req.id = (id)
793
+ tries = 0
794
+ plumbing_response = nil
795
+ loop do
796
+ begin
797
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('Resources.Delete', req), deadline:deadline)
798
+ rescue => exception
799
+ if (@parent.shouldRetry(tries, exception))
800
+ tries++
801
+ @parent.jitterSleep(tries)
802
+ next
803
+ end
804
+ raise Plumbing::convert_error_to_porcelain(exception)
805
+ end
806
+ break
807
+ end
780
808
 
781
- req.id = id
782
- tries = 0
783
- plumbing_response = nil
784
- loop do
785
- begin
786
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("Resources.Delete", req), deadline: deadline)
787
- rescue => exception
788
- if (@parent.shouldRetry(tries, exception))
789
- tries + +@parent.jitterSleep(tries)
790
- next
791
- end
792
- raise Plumbing::error_to_porcelain(exception)
809
+
810
+ resp = ResourceDeleteResponse.new()
811
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
812
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
813
+ resp
793
814
  end
794
- break
795
- end
796
-
797
- resp = ResourceDeleteResponse.new()
798
- resp.meta = Plumbing::delete_response_metadata_to_porcelain(plumbing_response.meta)
799
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
800
- resp
801
- end
802
-
803
- # List gets a list of Resources matching a given set of criteria.
804
- def list(
805
- filter,
806
- *args,
807
- deadline: nil
808
- )
809
- req = V1::ResourceListRequest.new()
810
- req.meta = V1::ListRequestMetadata.new()
811
- page_size_option = @parent._test_options["PageSize"]
812
- if page_size_option.is_a? Integer
813
- req.meta.limit = page_size_option
814
- end
815
-
816
- req.filter = Plumbing::quote_filter_args(filter, *args)
817
- resp = Enumerator::Generator.new { |g|
818
- tries = 0
819
- loop do
820
- begin
821
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata("Resources.List", req), deadline: deadline)
822
- rescue => exception
823
- if (@parent.shouldRetry(tries, exception))
824
- tries + +@parent.jitterSleep(tries)
825
- next
815
+ # List gets a list of Resources matching a given set of criteria.
816
+ def list(
817
+ filter \
818
+ ,
819
+ *args,
820
+ deadline:nil)
821
+ req = V1::ResourceListRequest.new()
822
+ req.meta = V1::ListRequestMetadata.new()
823
+ page_size_option = @parent._test_options['PageSize']
824
+ if page_size_option.is_a? Integer
825
+ req.meta.limit = page_size_option
826
826
  end
827
- raise Plumbing::error_to_porcelain(exception)
828
- end
829
- tries = 0
830
- plumbing_response.resources.each do |plumbing_item|
831
- g.yield Plumbing::resource_to_porcelain(plumbing_item)
832
- end
833
- break if plumbing_response.meta.next_cursor == ""
834
- req.meta.cursor = plumbing_response.meta.next_cursor
827
+
828
+ req.filter = Plumbing::quote_filter_args(filter, *args)
829
+ resp = Enumerator::Generator.new { |g|
830
+ tries = 0
831
+ loop do
832
+ begin
833
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata('Resources.List', req), deadline:deadline)
834
+ rescue => exception
835
+ if (@parent.shouldRetry(tries, exception))
836
+ tries++
837
+ @parent.jitterSleep(tries)
838
+ next
839
+ end
840
+ raise Plumbing::convert_error_to_porcelain(exception)
841
+ end
842
+ tries = 0
843
+ plumbing_response.resources.each do |plumbing_item|
844
+ g.yield Plumbing::convert_resource_to_porcelain(plumbing_item)
845
+ end
846
+ break if plumbing_response.meta.next_cursor == ""
847
+ req.meta.cursor = plumbing_response.meta.next_cursor
848
+ end
849
+ }
850
+ resp
835
851
  end
836
- }
837
- resp
838
852
  end
839
- end
840
-
841
- # RoleAttachments represent relationships between composite roles and the roles
842
- # that make up those composite roles. When a composite role is attached to another
843
- # role, the permissions granted to members of the composite role are augmented to
844
- # include the permissions granted to members of the attached role.
845
- class RoleAttachments
846
- def initialize(host, insecure, parent)
847
- begin
848
- if insecure
849
- @stub = V1::RoleAttachments::Stub.new(host, :this_channel_is_insecure)
850
- else
851
- cred = GRPC::Core::ChannelCredentials.new()
852
- @stub = V1::RoleAttachments::Stub.new(host, cred)
853
+ # RoleAttachments represent relationships between composite roles and the roles
854
+ # that make up those composite roles. When a composite role is attached to another
855
+ # role, the permissions granted to members of the composite role are augmented to
856
+ # include the permissions granted to members of the attached role.
857
+ class RoleAttachments
858
+ def initialize(host, insecure, parent)
859
+ begin
860
+ if insecure
861
+ @stub = V1::RoleAttachments::Stub.new(host, :this_channel_is_insecure)
862
+ else
863
+ cred = GRPC::Core::ChannelCredentials.new()
864
+ @stub = V1::RoleAttachments::Stub.new(host, cred)
865
+ end
866
+ rescue => exception
867
+ raise Plumbing::convert_error_to_porcelain(exception)
868
+ end
869
+ @parent = parent
853
870
  end
854
- rescue => exception
855
- raise Plumbing::error_to_porcelain(exception)
856
- end
857
- @parent = parent
858
- end
859
-
860
- # Create registers a new RoleAttachment.
861
- def create(
862
- role_attachment,
863
- deadline: nil
864
- )
865
- req = V1::RoleAttachmentCreateRequest.new()
871
+ # Create registers a new RoleAttachment.
872
+ def create(
873
+ role_attachment \
874
+ ,
875
+ deadline:nil)
876
+ req = V1::RoleAttachmentCreateRequest.new()
877
+
878
+ req.role_attachment = Plumbing::convert_role_attachment_to_plumbing(role_attachment)
879
+ tries = 0
880
+ plumbing_response = nil
881
+ loop do
882
+ begin
883
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata('RoleAttachments.Create', req), deadline:deadline)
884
+ rescue => exception
885
+ if (@parent.shouldRetry(tries, exception))
886
+ tries++
887
+ @parent.jitterSleep(tries)
888
+ next
889
+ end
890
+ raise Plumbing::convert_error_to_porcelain(exception)
891
+ end
892
+ break
893
+ end
866
894
 
867
- req.role_attachment = Plumbing::role_attachment_to_plumbing(role_attachment)
868
- tries = 0
869
- plumbing_response = nil
870
- loop do
871
- begin
872
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata("RoleAttachments.Create", req), deadline: deadline)
873
- rescue => exception
874
- if (@parent.shouldRetry(tries, exception))
875
- tries + +@parent.jitterSleep(tries)
876
- next
877
- end
878
- raise Plumbing::error_to_porcelain(exception)
895
+
896
+ resp = RoleAttachmentCreateResponse.new()
897
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
898
+ resp.role_attachment = Plumbing::convert_role_attachment_to_porcelain(plumbing_response.role_attachment)
899
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
900
+ resp
879
901
  end
880
- break
881
- end
882
-
883
- resp = RoleAttachmentCreateResponse.new()
884
- resp.meta = Plumbing::create_response_metadata_to_porcelain(plumbing_response.meta)
885
- resp.role_attachment = Plumbing::role_attachment_to_porcelain(plumbing_response.role_attachment)
886
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
887
- resp
888
- end
889
-
890
- # Get reads one RoleAttachment by ID.
891
- def get(
892
- id,
893
- deadline: nil
894
- )
895
- req = V1::RoleAttachmentGetRequest.new()
902
+ # Get reads one RoleAttachment by ID.
903
+ def get(
904
+ id \
905
+ ,
906
+ deadline:nil)
907
+ req = V1::RoleAttachmentGetRequest.new()
908
+
909
+ req.id = (id)
910
+ tries = 0
911
+ plumbing_response = nil
912
+ loop do
913
+ begin
914
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata('RoleAttachments.Get', req), deadline:deadline)
915
+ rescue => exception
916
+ if (@parent.shouldRetry(tries, exception))
917
+ tries++
918
+ @parent.jitterSleep(tries)
919
+ next
920
+ end
921
+ raise Plumbing::convert_error_to_porcelain(exception)
922
+ end
923
+ break
924
+ end
896
925
 
897
- req.id = id
898
- tries = 0
899
- plumbing_response = nil
900
- loop do
901
- begin
902
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata("RoleAttachments.Get", req), deadline: deadline)
903
- rescue => exception
904
- if (@parent.shouldRetry(tries, exception))
905
- tries + +@parent.jitterSleep(tries)
906
- next
907
- end
908
- raise Plumbing::error_to_porcelain(exception)
926
+
927
+ resp = RoleAttachmentGetResponse.new()
928
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
929
+ resp.role_attachment = Plumbing::convert_role_attachment_to_porcelain(plumbing_response.role_attachment)
930
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
931
+ resp
909
932
  end
910
- break
911
- end
912
-
913
- resp = RoleAttachmentGetResponse.new()
914
- resp.meta = Plumbing::get_response_metadata_to_porcelain(plumbing_response.meta)
915
- resp.role_attachment = Plumbing::role_attachment_to_porcelain(plumbing_response.role_attachment)
916
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
917
- resp
918
- end
919
-
920
- # Delete removes a RoleAttachment by ID.
921
- def delete(
922
- id,
923
- deadline: nil
924
- )
925
- req = V1::RoleAttachmentDeleteRequest.new()
933
+ # Delete removes a RoleAttachment by ID.
934
+ def delete(
935
+ id \
936
+ ,
937
+ deadline:nil)
938
+ req = V1::RoleAttachmentDeleteRequest.new()
939
+
940
+ req.id = (id)
941
+ tries = 0
942
+ plumbing_response = nil
943
+ loop do
944
+ begin
945
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('RoleAttachments.Delete', req), deadline:deadline)
946
+ rescue => exception
947
+ if (@parent.shouldRetry(tries, exception))
948
+ tries++
949
+ @parent.jitterSleep(tries)
950
+ next
951
+ end
952
+ raise Plumbing::convert_error_to_porcelain(exception)
953
+ end
954
+ break
955
+ end
926
956
 
927
- req.id = id
928
- tries = 0
929
- plumbing_response = nil
930
- loop do
931
- begin
932
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("RoleAttachments.Delete", req), deadline: deadline)
933
- rescue => exception
934
- if (@parent.shouldRetry(tries, exception))
935
- tries + +@parent.jitterSleep(tries)
936
- next
937
- end
938
- raise Plumbing::error_to_porcelain(exception)
957
+
958
+ resp = RoleAttachmentDeleteResponse.new()
959
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
960
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
961
+ resp
939
962
  end
940
- break
941
- end
942
-
943
- resp = RoleAttachmentDeleteResponse.new()
944
- resp.meta = Plumbing::delete_response_metadata_to_porcelain(plumbing_response.meta)
945
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
946
- resp
947
- end
948
-
949
- # List gets a list of RoleAttachments matching a given set of criteria.
950
- def list(
951
- filter,
952
- *args,
953
- deadline: nil
954
- )
955
- req = V1::RoleAttachmentListRequest.new()
956
- req.meta = V1::ListRequestMetadata.new()
957
- page_size_option = @parent._test_options["PageSize"]
958
- if page_size_option.is_a? Integer
959
- req.meta.limit = page_size_option
960
- end
961
-
962
- req.filter = Plumbing::quote_filter_args(filter, *args)
963
- resp = Enumerator::Generator.new { |g|
964
- tries = 0
965
- loop do
966
- begin
967
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata("RoleAttachments.List", req), deadline: deadline)
968
- rescue => exception
969
- if (@parent.shouldRetry(tries, exception))
970
- tries + +@parent.jitterSleep(tries)
971
- next
963
+ # List gets a list of RoleAttachments matching a given set of criteria.
964
+ def list(
965
+ filter \
966
+ ,
967
+ *args,
968
+ deadline:nil)
969
+ req = V1::RoleAttachmentListRequest.new()
970
+ req.meta = V1::ListRequestMetadata.new()
971
+ page_size_option = @parent._test_options['PageSize']
972
+ if page_size_option.is_a? Integer
973
+ req.meta.limit = page_size_option
972
974
  end
973
- raise Plumbing::error_to_porcelain(exception)
974
- end
975
- tries = 0
976
- plumbing_response.role_attachments.each do |plumbing_item|
977
- g.yield Plumbing::role_attachment_to_porcelain(plumbing_item)
978
- end
979
- break if plumbing_response.meta.next_cursor == ""
980
- req.meta.cursor = plumbing_response.meta.next_cursor
975
+
976
+ req.filter = Plumbing::quote_filter_args(filter, *args)
977
+ resp = Enumerator::Generator.new { |g|
978
+ tries = 0
979
+ loop do
980
+ begin
981
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata('RoleAttachments.List', req), deadline:deadline)
982
+ rescue => exception
983
+ if (@parent.shouldRetry(tries, exception))
984
+ tries++
985
+ @parent.jitterSleep(tries)
986
+ next
987
+ end
988
+ raise Plumbing::convert_error_to_porcelain(exception)
989
+ end
990
+ tries = 0
991
+ plumbing_response.role_attachments.each do |plumbing_item|
992
+ g.yield Plumbing::convert_role_attachment_to_porcelain(plumbing_item)
993
+ end
994
+ break if plumbing_response.meta.next_cursor == ""
995
+ req.meta.cursor = plumbing_response.meta.next_cursor
996
+ end
997
+ }
998
+ resp
981
999
  end
982
- }
983
- resp
984
1000
  end
985
- end
986
-
987
- # RoleGrants represent relationships between composite roles and the roles
988
- # that make up those composite roles. When a composite role is attached to another
989
- # role, the permissions granted to members of the composite role are augmented to
990
- # include the permissions granted to members of the attached role.
991
- class RoleGrants
992
- def initialize(host, insecure, parent)
993
- begin
994
- if insecure
995
- @stub = V1::RoleGrants::Stub.new(host, :this_channel_is_insecure)
996
- else
997
- cred = GRPC::Core::ChannelCredentials.new()
998
- @stub = V1::RoleGrants::Stub.new(host, cred)
1001
+ # RoleGrants represent relationships between composite roles and the roles
1002
+ # that make up those composite roles. When a composite role is attached to another
1003
+ # role, the permissions granted to members of the composite role are augmented to
1004
+ # include the permissions granted to members of the attached role.
1005
+ class RoleGrants
1006
+ def initialize(host, insecure, parent)
1007
+ begin
1008
+ if insecure
1009
+ @stub = V1::RoleGrants::Stub.new(host, :this_channel_is_insecure)
1010
+ else
1011
+ cred = GRPC::Core::ChannelCredentials.new()
1012
+ @stub = V1::RoleGrants::Stub.new(host, cred)
1013
+ end
1014
+ rescue => exception
1015
+ raise Plumbing::convert_error_to_porcelain(exception)
1016
+ end
1017
+ @parent = parent
999
1018
  end
1000
- rescue => exception
1001
- raise Plumbing::error_to_porcelain(exception)
1002
- end
1003
- @parent = parent
1004
- end
1005
-
1006
- # Create registers a new RoleGrant.
1007
- def create(
1008
- role_grant,
1009
- deadline: nil
1010
- )
1011
- req = V1::RoleGrantCreateRequest.new()
1019
+ # Create registers a new RoleGrant.
1020
+ def create(
1021
+ role_grant \
1022
+ ,
1023
+ deadline:nil)
1024
+ req = V1::RoleGrantCreateRequest.new()
1025
+
1026
+ req.role_grant = Plumbing::convert_role_grant_to_plumbing(role_grant)
1027
+ tries = 0
1028
+ plumbing_response = nil
1029
+ loop do
1030
+ begin
1031
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata('RoleGrants.Create', req), deadline:deadline)
1032
+ rescue => exception
1033
+ if (@parent.shouldRetry(tries, exception))
1034
+ tries++
1035
+ @parent.jitterSleep(tries)
1036
+ next
1037
+ end
1038
+ raise Plumbing::convert_error_to_porcelain(exception)
1039
+ end
1040
+ break
1041
+ end
1012
1042
 
1013
- req.role_grant = Plumbing::role_grant_to_plumbing(role_grant)
1014
- tries = 0
1015
- plumbing_response = nil
1016
- loop do
1017
- begin
1018
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata("RoleGrants.Create", req), deadline: deadline)
1019
- rescue => exception
1020
- if (@parent.shouldRetry(tries, exception))
1021
- tries + +@parent.jitterSleep(tries)
1022
- next
1023
- end
1024
- raise Plumbing::error_to_porcelain(exception)
1043
+
1044
+ resp = RoleGrantCreateResponse.new()
1045
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
1046
+ resp.role_grant = Plumbing::convert_role_grant_to_porcelain(plumbing_response.role_grant)
1047
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1048
+ resp
1025
1049
  end
1026
- break
1027
- end
1028
-
1029
- resp = RoleGrantCreateResponse.new()
1030
- resp.meta = Plumbing::create_response_metadata_to_porcelain(plumbing_response.meta)
1031
- resp.role_grant = Plumbing::role_grant_to_porcelain(plumbing_response.role_grant)
1032
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1033
- resp
1034
- end
1035
-
1036
- # Get reads one RoleGrant by ID.
1037
- def get(
1038
- id,
1039
- deadline: nil
1040
- )
1041
- req = V1::RoleGrantGetRequest.new()
1050
+ # Get reads one RoleGrant by ID.
1051
+ def get(
1052
+ id \
1053
+ ,
1054
+ deadline:nil)
1055
+ req = V1::RoleGrantGetRequest.new()
1056
+
1057
+ req.id = (id)
1058
+ tries = 0
1059
+ plumbing_response = nil
1060
+ loop do
1061
+ begin
1062
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata('RoleGrants.Get', req), deadline:deadline)
1063
+ rescue => exception
1064
+ if (@parent.shouldRetry(tries, exception))
1065
+ tries++
1066
+ @parent.jitterSleep(tries)
1067
+ next
1068
+ end
1069
+ raise Plumbing::convert_error_to_porcelain(exception)
1070
+ end
1071
+ break
1072
+ end
1042
1073
 
1043
- req.id = id
1044
- tries = 0
1045
- plumbing_response = nil
1046
- loop do
1047
- begin
1048
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata("RoleGrants.Get", req), deadline: deadline)
1049
- rescue => exception
1050
- if (@parent.shouldRetry(tries, exception))
1051
- tries + +@parent.jitterSleep(tries)
1052
- next
1053
- end
1054
- raise Plumbing::error_to_porcelain(exception)
1074
+
1075
+ resp = RoleGrantGetResponse.new()
1076
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
1077
+ resp.role_grant = Plumbing::convert_role_grant_to_porcelain(plumbing_response.role_grant)
1078
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1079
+ resp
1055
1080
  end
1056
- break
1057
- end
1058
-
1059
- resp = RoleGrantGetResponse.new()
1060
- resp.meta = Plumbing::get_response_metadata_to_porcelain(plumbing_response.meta)
1061
- resp.role_grant = Plumbing::role_grant_to_porcelain(plumbing_response.role_grant)
1062
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1063
- resp
1064
- end
1065
-
1066
- # Delete removes a RoleGrant by ID.
1067
- def delete(
1068
- id,
1069
- deadline: nil
1070
- )
1071
- req = V1::RoleGrantDeleteRequest.new()
1081
+ # Delete removes a RoleGrant by ID.
1082
+ def delete(
1083
+ id \
1084
+ ,
1085
+ deadline:nil)
1086
+ req = V1::RoleGrantDeleteRequest.new()
1087
+
1088
+ req.id = (id)
1089
+ tries = 0
1090
+ plumbing_response = nil
1091
+ loop do
1092
+ begin
1093
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('RoleGrants.Delete', req), deadline:deadline)
1094
+ rescue => exception
1095
+ if (@parent.shouldRetry(tries, exception))
1096
+ tries++
1097
+ @parent.jitterSleep(tries)
1098
+ next
1099
+ end
1100
+ raise Plumbing::convert_error_to_porcelain(exception)
1101
+ end
1102
+ break
1103
+ end
1072
1104
 
1073
- req.id = id
1074
- tries = 0
1075
- plumbing_response = nil
1076
- loop do
1077
- begin
1078
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("RoleGrants.Delete", req), deadline: deadline)
1079
- rescue => exception
1080
- if (@parent.shouldRetry(tries, exception))
1081
- tries + +@parent.jitterSleep(tries)
1082
- next
1083
- end
1084
- raise Plumbing::error_to_porcelain(exception)
1105
+
1106
+ resp = RoleGrantDeleteResponse.new()
1107
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
1108
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1109
+ resp
1085
1110
  end
1086
- break
1087
- end
1088
-
1089
- resp = RoleGrantDeleteResponse.new()
1090
- resp.meta = Plumbing::delete_response_metadata_to_porcelain(plumbing_response.meta)
1091
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1092
- resp
1093
- end
1094
-
1095
- # List gets a list of RoleGrants matching a given set of criteria.
1096
- def list(
1097
- filter,
1098
- *args,
1099
- deadline: nil
1100
- )
1101
- req = V1::RoleGrantListRequest.new()
1102
- req.meta = V1::ListRequestMetadata.new()
1103
- page_size_option = @parent._test_options["PageSize"]
1104
- if page_size_option.is_a? Integer
1105
- req.meta.limit = page_size_option
1106
- end
1107
-
1108
- req.filter = Plumbing::quote_filter_args(filter, *args)
1109
- resp = Enumerator::Generator.new { |g|
1110
- tries = 0
1111
- loop do
1112
- begin
1113
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata("RoleGrants.List", req), deadline: deadline)
1114
- rescue => exception
1115
- if (@parent.shouldRetry(tries, exception))
1116
- tries + +@parent.jitterSleep(tries)
1117
- next
1111
+ # List gets a list of RoleGrants matching a given set of criteria.
1112
+ def list(
1113
+ filter \
1114
+ ,
1115
+ *args,
1116
+ deadline:nil)
1117
+ req = V1::RoleGrantListRequest.new()
1118
+ req.meta = V1::ListRequestMetadata.new()
1119
+ page_size_option = @parent._test_options['PageSize']
1120
+ if page_size_option.is_a? Integer
1121
+ req.meta.limit = page_size_option
1118
1122
  end
1119
- raise Plumbing::error_to_porcelain(exception)
1120
- end
1121
- tries = 0
1122
- plumbing_response.role_grants.each do |plumbing_item|
1123
- g.yield Plumbing::role_grant_to_porcelain(plumbing_item)
1124
- end
1125
- break if plumbing_response.meta.next_cursor == ""
1126
- req.meta.cursor = plumbing_response.meta.next_cursor
1123
+
1124
+ req.filter = Plumbing::quote_filter_args(filter, *args)
1125
+ resp = Enumerator::Generator.new { |g|
1126
+ tries = 0
1127
+ loop do
1128
+ begin
1129
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata('RoleGrants.List', req), deadline:deadline)
1130
+ rescue => exception
1131
+ if (@parent.shouldRetry(tries, exception))
1132
+ tries++
1133
+ @parent.jitterSleep(tries)
1134
+ next
1135
+ end
1136
+ raise Plumbing::convert_error_to_porcelain(exception)
1137
+ end
1138
+ tries = 0
1139
+ plumbing_response.role_grants.each do |plumbing_item|
1140
+ g.yield Plumbing::convert_role_grant_to_porcelain(plumbing_item)
1141
+ end
1142
+ break if plumbing_response.meta.next_cursor == ""
1143
+ req.meta.cursor = plumbing_response.meta.next_cursor
1144
+ end
1145
+ }
1146
+ resp
1127
1147
  end
1128
- }
1129
- resp
1130
1148
  end
1131
- end
1132
-
1133
- # Roles are tools for controlling user access to resources. Each Role holds a
1134
- # list of resources which they grant access to. Composite roles are a special
1135
- # type of Role which have no resource associations of their own, but instead
1136
- # grant access to the combined resources associated with a set of child roles.
1137
- # Each user can be a member of one Role or composite role.
1138
- class Roles
1139
- def initialize(host, insecure, parent)
1140
- begin
1141
- if insecure
1142
- @stub = V1::Roles::Stub.new(host, :this_channel_is_insecure)
1143
- else
1144
- cred = GRPC::Core::ChannelCredentials.new()
1145
- @stub = V1::Roles::Stub.new(host, cred)
1149
+ # Roles are tools for controlling user access to resources. Each Role holds a
1150
+ # list of resources which they grant access to. Composite roles are a special
1151
+ # type of Role which have no resource associations of their own, but instead
1152
+ # grant access to the combined resources associated with a set of child roles.
1153
+ # Each user can be a member of one Role or composite role.
1154
+ class Roles
1155
+ def initialize(host, insecure, parent)
1156
+ begin
1157
+ if insecure
1158
+ @stub = V1::Roles::Stub.new(host, :this_channel_is_insecure)
1159
+ else
1160
+ cred = GRPC::Core::ChannelCredentials.new()
1161
+ @stub = V1::Roles::Stub.new(host, cred)
1162
+ end
1163
+ rescue => exception
1164
+ raise Plumbing::convert_error_to_porcelain(exception)
1165
+ end
1166
+ @parent = parent
1146
1167
  end
1147
- rescue => exception
1148
- raise Plumbing::error_to_porcelain(exception)
1149
- end
1150
- @parent = parent
1151
- end
1152
-
1153
- # Create registers a new Role.
1154
- def create(
1155
- role,
1156
- deadline: nil
1157
- )
1158
- req = V1::RoleCreateRequest.new()
1168
+ # Create registers a new Role.
1169
+ def create(
1170
+ role \
1171
+ ,
1172
+ deadline:nil)
1173
+ req = V1::RoleCreateRequest.new()
1174
+
1175
+ req.role = Plumbing::convert_role_to_plumbing(role)
1176
+ tries = 0
1177
+ plumbing_response = nil
1178
+ loop do
1179
+ begin
1180
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata('Roles.Create', req), deadline:deadline)
1181
+ rescue => exception
1182
+ if (@parent.shouldRetry(tries, exception))
1183
+ tries++
1184
+ @parent.jitterSleep(tries)
1185
+ next
1186
+ end
1187
+ raise Plumbing::convert_error_to_porcelain(exception)
1188
+ end
1189
+ break
1190
+ end
1159
1191
 
1160
- req.role = Plumbing::role_to_plumbing(role)
1161
- tries = 0
1162
- plumbing_response = nil
1163
- loop do
1164
- begin
1165
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata("Roles.Create", req), deadline: deadline)
1166
- rescue => exception
1167
- if (@parent.shouldRetry(tries, exception))
1168
- tries + +@parent.jitterSleep(tries)
1169
- next
1170
- end
1171
- raise Plumbing::error_to_porcelain(exception)
1192
+
1193
+ resp = RoleCreateResponse.new()
1194
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
1195
+ resp.role = Plumbing::convert_role_to_porcelain(plumbing_response.role)
1196
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1197
+ resp
1172
1198
  end
1173
- break
1174
- end
1175
-
1176
- resp = RoleCreateResponse.new()
1177
- resp.meta = Plumbing::create_response_metadata_to_porcelain(plumbing_response.meta)
1178
- resp.role = Plumbing::role_to_porcelain(plumbing_response.role)
1179
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1180
- resp
1181
- end
1182
-
1183
- # Get reads one Role by ID.
1184
- def get(
1185
- id,
1186
- deadline: nil
1187
- )
1188
- req = V1::RoleGetRequest.new()
1199
+ # Get reads one Role by ID.
1200
+ def get(
1201
+ id \
1202
+ ,
1203
+ deadline:nil)
1204
+ req = V1::RoleGetRequest.new()
1205
+
1206
+ req.id = (id)
1207
+ tries = 0
1208
+ plumbing_response = nil
1209
+ loop do
1210
+ begin
1211
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata('Roles.Get', req), deadline:deadline)
1212
+ rescue => exception
1213
+ if (@parent.shouldRetry(tries, exception))
1214
+ tries++
1215
+ @parent.jitterSleep(tries)
1216
+ next
1217
+ end
1218
+ raise Plumbing::convert_error_to_porcelain(exception)
1219
+ end
1220
+ break
1221
+ end
1189
1222
 
1190
- req.id = id
1191
- tries = 0
1192
- plumbing_response = nil
1193
- loop do
1194
- begin
1195
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata("Roles.Get", req), deadline: deadline)
1196
- rescue => exception
1197
- if (@parent.shouldRetry(tries, exception))
1198
- tries + +@parent.jitterSleep(tries)
1199
- next
1200
- end
1201
- raise Plumbing::error_to_porcelain(exception)
1223
+
1224
+ resp = RoleGetResponse.new()
1225
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
1226
+ resp.role = Plumbing::convert_role_to_porcelain(plumbing_response.role)
1227
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1228
+ resp
1202
1229
  end
1203
- break
1204
- end
1205
-
1206
- resp = RoleGetResponse.new()
1207
- resp.meta = Plumbing::get_response_metadata_to_porcelain(plumbing_response.meta)
1208
- resp.role = Plumbing::role_to_porcelain(plumbing_response.role)
1209
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1210
- resp
1211
- end
1212
-
1213
- # Update patches a Role by ID.
1214
- def update(
1215
- role,
1216
- deadline: nil
1217
- )
1218
- req = V1::RoleUpdateRequest.new()
1230
+ # Update patches a Role by ID.
1231
+ def update(
1232
+ role \
1233
+ ,
1234
+ deadline:nil)
1235
+ req = V1::RoleUpdateRequest.new()
1236
+
1237
+ req.role = Plumbing::convert_role_to_plumbing(role)
1238
+ tries = 0
1239
+ plumbing_response = nil
1240
+ loop do
1241
+ begin
1242
+ plumbing_response = @stub.update(req, metadata: @parent.get_metadata('Roles.Update', req), deadline:deadline)
1243
+ rescue => exception
1244
+ if (@parent.shouldRetry(tries, exception))
1245
+ tries++
1246
+ @parent.jitterSleep(tries)
1247
+ next
1248
+ end
1249
+ raise Plumbing::convert_error_to_porcelain(exception)
1250
+ end
1251
+ break
1252
+ end
1219
1253
 
1220
- req.role = Plumbing::role_to_plumbing(role)
1221
- tries = 0
1222
- plumbing_response = nil
1223
- loop do
1224
- begin
1225
- plumbing_response = @stub.update(req, metadata: @parent.get_metadata("Roles.Update", req), deadline: deadline)
1226
- rescue => exception
1227
- if (@parent.shouldRetry(tries, exception))
1228
- tries + +@parent.jitterSleep(tries)
1229
- next
1230
- end
1231
- raise Plumbing::error_to_porcelain(exception)
1254
+
1255
+ resp = RoleUpdateResponse.new()
1256
+ resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)
1257
+ resp.role = Plumbing::convert_role_to_porcelain(plumbing_response.role)
1258
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1259
+ resp
1232
1260
  end
1233
- break
1234
- end
1235
-
1236
- resp = RoleUpdateResponse.new()
1237
- resp.meta = Plumbing::update_response_metadata_to_porcelain(plumbing_response.meta)
1238
- resp.role = Plumbing::role_to_porcelain(plumbing_response.role)
1239
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1240
- resp
1241
- end
1242
-
1243
- # Delete removes a Role by ID.
1244
- def delete(
1245
- id,
1246
- deadline: nil
1247
- )
1248
- req = V1::RoleDeleteRequest.new()
1261
+ # Delete removes a Role by ID.
1262
+ def delete(
1263
+ id \
1264
+ ,
1265
+ deadline:nil)
1266
+ req = V1::RoleDeleteRequest.new()
1267
+
1268
+ req.id = (id)
1269
+ tries = 0
1270
+ plumbing_response = nil
1271
+ loop do
1272
+ begin
1273
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('Roles.Delete', req), deadline:deadline)
1274
+ rescue => exception
1275
+ if (@parent.shouldRetry(tries, exception))
1276
+ tries++
1277
+ @parent.jitterSleep(tries)
1278
+ next
1279
+ end
1280
+ raise Plumbing::convert_error_to_porcelain(exception)
1281
+ end
1282
+ break
1283
+ end
1249
1284
 
1250
- req.id = id
1251
- tries = 0
1252
- plumbing_response = nil
1253
- loop do
1254
- begin
1255
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("Roles.Delete", req), deadline: deadline)
1256
- rescue => exception
1257
- if (@parent.shouldRetry(tries, exception))
1258
- tries + +@parent.jitterSleep(tries)
1259
- next
1260
- end
1261
- raise Plumbing::error_to_porcelain(exception)
1285
+
1286
+ resp = RoleDeleteResponse.new()
1287
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
1288
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1289
+ resp
1262
1290
  end
1263
- break
1264
- end
1265
-
1266
- resp = RoleDeleteResponse.new()
1267
- resp.meta = Plumbing::delete_response_metadata_to_porcelain(plumbing_response.meta)
1268
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1269
- resp
1270
- end
1271
-
1272
- # List gets a list of Roles matching a given set of criteria.
1273
- def list(
1274
- filter,
1275
- *args,
1276
- deadline: nil
1277
- )
1278
- req = V1::RoleListRequest.new()
1279
- req.meta = V1::ListRequestMetadata.new()
1280
- page_size_option = @parent._test_options["PageSize"]
1281
- if page_size_option.is_a? Integer
1282
- req.meta.limit = page_size_option
1283
- end
1284
-
1285
- req.filter = Plumbing::quote_filter_args(filter, *args)
1286
- resp = Enumerator::Generator.new { |g|
1287
- tries = 0
1288
- loop do
1289
- begin
1290
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata("Roles.List", req), deadline: deadline)
1291
- rescue => exception
1292
- if (@parent.shouldRetry(tries, exception))
1293
- tries + +@parent.jitterSleep(tries)
1294
- next
1291
+ # List gets a list of Roles matching a given set of criteria.
1292
+ def list(
1293
+ filter \
1294
+ ,
1295
+ *args,
1296
+ deadline:nil)
1297
+ req = V1::RoleListRequest.new()
1298
+ req.meta = V1::ListRequestMetadata.new()
1299
+ page_size_option = @parent._test_options['PageSize']
1300
+ if page_size_option.is_a? Integer
1301
+ req.meta.limit = page_size_option
1295
1302
  end
1296
- raise Plumbing::error_to_porcelain(exception)
1297
- end
1298
- tries = 0
1299
- plumbing_response.roles.each do |plumbing_item|
1300
- g.yield Plumbing::role_to_porcelain(plumbing_item)
1301
- end
1302
- break if plumbing_response.meta.next_cursor == ""
1303
- req.meta.cursor = plumbing_response.meta.next_cursor
1303
+
1304
+ req.filter = Plumbing::quote_filter_args(filter, *args)
1305
+ resp = Enumerator::Generator.new { |g|
1306
+ tries = 0
1307
+ loop do
1308
+ begin
1309
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata('Roles.List', req), deadline:deadline)
1310
+ rescue => exception
1311
+ if (@parent.shouldRetry(tries, exception))
1312
+ tries++
1313
+ @parent.jitterSleep(tries)
1314
+ next
1315
+ end
1316
+ raise Plumbing::convert_error_to_porcelain(exception)
1317
+ end
1318
+ tries = 0
1319
+ plumbing_response.roles.each do |plumbing_item|
1320
+ g.yield Plumbing::convert_role_to_porcelain(plumbing_item)
1321
+ end
1322
+ break if plumbing_response.meta.next_cursor == ""
1323
+ req.meta.cursor = plumbing_response.meta.next_cursor
1324
+ end
1325
+ }
1326
+ resp
1304
1327
  end
1305
- }
1306
- resp
1307
1328
  end
1308
- end
1309
1329
  end