strongdm 1.0.8 → 1.0.10

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