google-api-client 0.27.2 → 0.27.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +45 -0
  3. data/generated/google/apis/bigtableadmin_v2.rb +1 -1
  4. data/generated/google/apis/bigtableadmin_v2/classes.rb +45 -0
  5. data/generated/google/apis/bigtableadmin_v2/representations.rb +17 -0
  6. data/generated/google/apis/cloudbuild_v1alpha1.rb +1 -1
  7. data/generated/google/apis/cloudkms_v1.rb +4 -1
  8. data/generated/google/apis/cloudtrace_v2.rb +1 -1
  9. data/generated/google/apis/cloudtrace_v2/classes.rb +2 -2
  10. data/generated/google/apis/compute_alpha.rb +1 -1
  11. data/generated/google/apis/compute_alpha/classes.rb +1198 -13
  12. data/generated/google/apis/compute_alpha/representations.rb +406 -0
  13. data/generated/google/apis/compute_alpha/service.rb +200 -4
  14. data/generated/google/apis/compute_beta.rb +1 -1
  15. data/generated/google/apis/compute_beta/classes.rb +23 -9
  16. data/generated/google/apis/compute_beta/representations.rb +2 -0
  17. data/generated/google/apis/compute_beta/service.rb +41 -4
  18. data/generated/google/apis/compute_v1.rb +1 -1
  19. data/generated/google/apis/compute_v1/classes.rb +65 -6
  20. data/generated/google/apis/compute_v1/representations.rb +19 -0
  21. data/generated/google/apis/compute_v1/service.rb +4 -4
  22. data/generated/google/apis/container_v1.rb +1 -1
  23. data/generated/google/apis/container_v1/classes.rb +145 -0
  24. data/generated/google/apis/container_v1/representations.rb +54 -0
  25. data/generated/google/apis/container_v1/service.rb +69 -0
  26. data/generated/google/apis/container_v1beta1.rb +1 -1
  27. data/generated/google/apis/container_v1beta1/classes.rb +177 -0
  28. data/generated/google/apis/container_v1beta1/representations.rb +70 -0
  29. data/generated/google/apis/container_v1beta1/service.rb +69 -0
  30. data/generated/google/apis/containeranalysis_v1alpha1.rb +35 -0
  31. data/generated/google/apis/containeranalysis_v1alpha1/classes.rb +2780 -0
  32. data/generated/google/apis/containeranalysis_v1alpha1/representations.rb +1106 -0
  33. data/generated/google/apis/containeranalysis_v1alpha1/service.rb +1329 -0
  34. data/generated/google/apis/containeranalysis_v1beta1.rb +35 -0
  35. data/generated/google/apis/containeranalysis_v1beta1/classes.rb +2702 -0
  36. data/generated/google/apis/containeranalysis_v1beta1/representations.rb +1152 -0
  37. data/generated/google/apis/containeranalysis_v1beta1/service.rb +932 -0
  38. data/generated/google/apis/content_v2.rb +1 -1
  39. data/generated/google/apis/content_v2/classes.rb +84 -14
  40. data/generated/google/apis/content_v2/representations.rb +24 -0
  41. data/generated/google/apis/content_v2_1.rb +1 -1
  42. data/generated/google/apis/content_v2_1/classes.rb +70 -11
  43. data/generated/google/apis/content_v2_1/representations.rb +25 -3
  44. data/generated/google/apis/dialogflow_v2.rb +1 -1
  45. data/generated/google/apis/dialogflow_v2/classes.rb +20 -20
  46. data/generated/google/apis/dialogflow_v2/service.rb +6 -6
  47. data/generated/google/apis/dialogflow_v2beta1.rb +1 -1
  48. data/generated/google/apis/dialogflow_v2beta1/classes.rb +20 -20
  49. data/generated/google/apis/dialogflow_v2beta1/service.rb +6 -6
  50. data/generated/google/apis/dns_v1.rb +1 -1
  51. data/generated/google/apis/dns_v1/classes.rb +19 -10
  52. data/generated/google/apis/dns_v1beta2.rb +1 -1
  53. data/generated/google/apis/dns_v1beta2/classes.rb +31 -22
  54. data/generated/google/apis/dns_v2beta1.rb +1 -1
  55. data/generated/google/apis/dns_v2beta1/classes.rb +19 -10
  56. data/generated/google/apis/doubleclickbidmanager_v1.rb +1 -1
  57. data/generated/google/apis/doubleclickbidmanager_v1/classes.rb +9 -2
  58. data/generated/google/apis/doubleclickbidmanager_v1/representations.rb +1 -0
  59. data/generated/google/apis/firebasedynamiclinks_v1.rb +1 -1
  60. data/generated/google/apis/firebasedynamiclinks_v1/classes.rb +7 -0
  61. data/generated/google/apis/firebasedynamiclinks_v1/representations.rb +1 -0
  62. data/generated/google/apis/firestore_v1.rb +1 -1
  63. data/generated/google/apis/firestore_v1/classes.rb +18 -0
  64. data/generated/google/apis/firestore_v1/representations.rb +6 -0
  65. data/generated/google/apis/firestore_v1beta1.rb +1 -1
  66. data/generated/google/apis/firestore_v1beta1/classes.rb +18 -0
  67. data/generated/google/apis/firestore_v1beta1/representations.rb +6 -0
  68. data/generated/google/apis/fitness_v1.rb +1 -1
  69. data/generated/google/apis/fitness_v1/classes.rb +2 -1
  70. data/generated/google/apis/jobs_v3p1beta1.rb +1 -1
  71. data/generated/google/apis/jobs_v3p1beta1/classes.rb +169 -0
  72. data/generated/google/apis/jobs_v3p1beta1/representations.rb +33 -0
  73. data/generated/google/apis/jobs_v3p1beta1/service.rb +32 -0
  74. data/generated/google/apis/libraryagent_v1.rb +34 -0
  75. data/generated/google/apis/libraryagent_v1/classes.rb +151 -0
  76. data/generated/google/apis/libraryagent_v1/representations.rb +86 -0
  77. data/generated/google/apis/libraryagent_v1/service.rb +265 -0
  78. data/generated/google/apis/oslogin_v1.rb +2 -2
  79. data/generated/google/apis/oslogin_v1/service.rb +1 -1
  80. data/generated/google/apis/oslogin_v1alpha.rb +2 -2
  81. data/generated/google/apis/oslogin_v1alpha/service.rb +1 -1
  82. data/generated/google/apis/oslogin_v1beta.rb +2 -2
  83. data/generated/google/apis/oslogin_v1beta/service.rb +1 -1
  84. data/generated/google/apis/remotebuildexecution_v1.rb +34 -0
  85. data/generated/google/apis/remotebuildexecution_v1/classes.rb +3858 -0
  86. data/generated/google/apis/remotebuildexecution_v1/representations.rb +1196 -0
  87. data/generated/google/apis/remotebuildexecution_v1/service.rb +374 -0
  88. data/generated/google/apis/remotebuildexecution_v1alpha.rb +34 -0
  89. data/generated/google/apis/remotebuildexecution_v1alpha/classes.rb +3709 -0
  90. data/generated/google/apis/remotebuildexecution_v1alpha/representations.rb +1113 -0
  91. data/generated/google/apis/remotebuildexecution_v1alpha/service.rb +400 -0
  92. data/generated/google/apis/remotebuildexecution_v2.rb +34 -0
  93. data/generated/google/apis/remotebuildexecution_v2/classes.rb +4460 -0
  94. data/generated/google/apis/remotebuildexecution_v2/representations.rb +1431 -0
  95. data/generated/google/apis/remotebuildexecution_v2/service.rb +542 -0
  96. data/generated/google/apis/serviceconsumermanagement_v1.rb +1 -1
  97. data/generated/google/apis/serviceconsumermanagement_v1/classes.rb +12 -0
  98. data/generated/google/apis/serviceconsumermanagement_v1/representations.rb +2 -0
  99. data/generated/google/apis/servicenetworking_v1beta.rb +1 -1
  100. data/generated/google/apis/servicenetworking_v1beta/classes.rb +12 -0
  101. data/generated/google/apis/servicenetworking_v1beta/representations.rb +2 -0
  102. data/generated/google/apis/serviceusage_v1.rb +1 -1
  103. data/generated/google/apis/serviceusage_v1/classes.rb +12 -0
  104. data/generated/google/apis/serviceusage_v1/representations.rb +2 -0
  105. data/generated/google/apis/serviceusage_v1beta1.rb +1 -1
  106. data/generated/google/apis/serviceusage_v1beta1/classes.rb +12 -0
  107. data/generated/google/apis/serviceusage_v1beta1/representations.rb +2 -0
  108. data/generated/google/apis/sheets_v4.rb +1 -1
  109. data/generated/google/apis/sheets_v4/classes.rb +4 -4
  110. data/generated/google/apis/slides_v1.rb +1 -1
  111. data/generated/google/apis/slides_v1/classes.rb +5 -5
  112. data/generated/google/apis/speech_v1.rb +1 -1
  113. data/generated/google/apis/speech_v1p1beta1.rb +1 -1
  114. data/generated/google/apis/testing_v1.rb +1 -1
  115. data/generated/google/apis/testing_v1/classes.rb +9 -0
  116. data/generated/google/apis/testing_v1/representations.rb +1 -0
  117. data/generated/google/apis/websecurityscanner_v1alpha.rb +1 -1
  118. data/generated/google/apis/websecurityscanner_v1alpha/classes.rb +7 -0
  119. data/generated/google/apis/websecurityscanner_v1alpha/representations.rb +2 -0
  120. data/generated/google/apis/youtube_partner_v1.rb +1 -1
  121. data/lib/google/apis/version.rb +1 -1
  122. metadata +26 -2
@@ -286,6 +286,12 @@ module Google
286
286
  include Google::Apis::Core::JsonObjectSupport
287
287
  end
288
288
 
289
+ class Operation
290
+ class Representation < Google::Apis::Core::JsonRepresentation; end
291
+
292
+ include Google::Apis::Core::JsonObjectSupport
293
+ end
294
+
289
295
  class PostalAddress
290
296
  class Representation < Google::Apis::Core::JsonRepresentation; end
291
297
 
@@ -328,6 +334,12 @@ module Google
328
334
  include Google::Apis::Core::JsonObjectSupport
329
335
  end
330
336
 
337
+ class Status
338
+ class Representation < Google::Apis::Core::JsonRepresentation; end
339
+
340
+ include Google::Apis::Core::JsonObjectSupport
341
+ end
342
+
331
343
  class TimeOfDay
332
344
  class Representation < Google::Apis::Core::JsonRepresentation; end
333
345
 
@@ -829,6 +841,18 @@ module Google
829
841
  end
830
842
  end
831
843
 
844
+ class Operation
845
+ # @private
846
+ class Representation < Google::Apis::Core::JsonRepresentation
847
+ property :done, as: 'done'
848
+ property :error, as: 'error', class: Google::Apis::JobsV3p1beta1::Status, decorator: Google::Apis::JobsV3p1beta1::Status::Representation
849
+
850
+ hash :metadata, as: 'metadata'
851
+ property :name, as: 'name'
852
+ hash :response, as: 'response'
853
+ end
854
+ end
855
+
832
856
  class PostalAddress
833
857
  # @private
834
858
  class Representation < Google::Apis::Core::JsonRepresentation
@@ -928,6 +952,15 @@ module Google
928
952
  end
929
953
  end
930
954
 
955
+ class Status
956
+ # @private
957
+ class Representation < Google::Apis::Core::JsonRepresentation
958
+ property :code, as: 'code'
959
+ collection :details, as: 'details'
960
+ property :message, as: 'message'
961
+ end
962
+ end
963
+
931
964
  class TimeOfDay
932
965
  # @private
933
966
  class Representation < Google::Apis::Core::JsonRepresentation
@@ -697,6 +697,38 @@ module Google
697
697
  command.query['quotaUser'] = quota_user unless quota_user.nil?
698
698
  execute_or_queue_command(command, &block)
699
699
  end
700
+
701
+ # Gets the latest state of a long-running operation. Clients can use this
702
+ # method to poll the operation result at intervals as recommended by the API
703
+ # service.
704
+ # @param [String] name
705
+ # The name of the operation resource.
706
+ # @param [String] fields
707
+ # Selector specifying which fields to include in a partial response.
708
+ # @param [String] quota_user
709
+ # Available to use for quota purposes for server-side applications. Can be any
710
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
711
+ # @param [Google::Apis::RequestOptions] options
712
+ # Request-specific options
713
+ #
714
+ # @yield [result, err] Result & error if block supplied
715
+ # @yieldparam result [Google::Apis::JobsV3p1beta1::Operation] parsed result object
716
+ # @yieldparam err [StandardError] error object if request failed
717
+ #
718
+ # @return [Google::Apis::JobsV3p1beta1::Operation]
719
+ #
720
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
721
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
722
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
723
+ def get_project_operation(name, fields: nil, quota_user: nil, options: nil, &block)
724
+ command = make_simple_command(:get, 'v3p1beta1/{+name}', options)
725
+ command.response_representation = Google::Apis::JobsV3p1beta1::Operation::Representation
726
+ command.response_class = Google::Apis::JobsV3p1beta1::Operation
727
+ command.params['name'] = name unless name.nil?
728
+ command.query['fields'] = fields unless fields.nil?
729
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
730
+ execute_or_queue_command(command, &block)
731
+ end
700
732
 
701
733
  protected
702
734
 
@@ -0,0 +1,34 @@
1
+ # Copyright 2015 Google Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/libraryagent_v1/service.rb'
16
+ require 'google/apis/libraryagent_v1/classes.rb'
17
+ require 'google/apis/libraryagent_v1/representations.rb'
18
+
19
+ module Google
20
+ module Apis
21
+ # Library Agent API
22
+ #
23
+ # A simple Google Example Library API.
24
+ #
25
+ # @see https://cloud.google.com/docs/quota
26
+ module LibraryagentV1
27
+ VERSION = 'V1'
28
+ REVISION = '20190105'
29
+
30
+ # View and manage your data across Google Cloud Platform services
31
+ AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,151 @@
1
+ # Copyright 2015 Google Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module LibraryagentV1
24
+
25
+ # A single book in the library.
26
+ class GoogleExampleLibraryagentV1Book
27
+ include Google::Apis::Core::Hashable
28
+
29
+ # The name of the book author.
30
+ # Corresponds to the JSON property `author`
31
+ # @return [String]
32
+ attr_accessor :author
33
+
34
+ # The resource name of the book.
35
+ # Book names have the form `shelves/`shelf_id`/books/`book_id``.
36
+ # The name is ignored when creating a book.
37
+ # Corresponds to the JSON property `name`
38
+ # @return [String]
39
+ attr_accessor :name
40
+
41
+ # Value indicating whether the book has been read.
42
+ # Corresponds to the JSON property `read`
43
+ # @return [Boolean]
44
+ attr_accessor :read
45
+ alias_method :read?, :read
46
+
47
+ # The title of the book.
48
+ # Corresponds to the JSON property `title`
49
+ # @return [String]
50
+ attr_accessor :title
51
+
52
+ def initialize(**args)
53
+ update!(**args)
54
+ end
55
+
56
+ # Update properties of this object
57
+ def update!(**args)
58
+ @author = args[:author] if args.key?(:author)
59
+ @name = args[:name] if args.key?(:name)
60
+ @read = args[:read] if args.key?(:read)
61
+ @title = args[:title] if args.key?(:title)
62
+ end
63
+ end
64
+
65
+ # Response message for LibraryAgent.ListBooks.
66
+ class GoogleExampleLibraryagentV1ListBooksResponse
67
+ include Google::Apis::Core::Hashable
68
+
69
+ # The list of books.
70
+ # Corresponds to the JSON property `books`
71
+ # @return [Array<Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1Book>]
72
+ attr_accessor :books
73
+
74
+ # A token to retrieve next page of results.
75
+ # Pass this value in the
76
+ # ListBooksRequest.page_token
77
+ # field in the subsequent call to `ListBooks` method to retrieve the next
78
+ # page of results.
79
+ # Corresponds to the JSON property `nextPageToken`
80
+ # @return [String]
81
+ attr_accessor :next_page_token
82
+
83
+ def initialize(**args)
84
+ update!(**args)
85
+ end
86
+
87
+ # Update properties of this object
88
+ def update!(**args)
89
+ @books = args[:books] if args.key?(:books)
90
+ @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
91
+ end
92
+ end
93
+
94
+ # Response message for LibraryAgent.ListShelves.
95
+ class GoogleExampleLibraryagentV1ListShelvesResponse
96
+ include Google::Apis::Core::Hashable
97
+
98
+ # A token to retrieve next page of results.
99
+ # Pass this value in the
100
+ # ListShelvesRequest.page_token
101
+ # field in the subsequent call to `ListShelves` method to retrieve the next
102
+ # page of results.
103
+ # Corresponds to the JSON property `nextPageToken`
104
+ # @return [String]
105
+ attr_accessor :next_page_token
106
+
107
+ # The list of shelves.
108
+ # Corresponds to the JSON property `shelves`
109
+ # @return [Array<Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1Shelf>]
110
+ attr_accessor :shelves
111
+
112
+ def initialize(**args)
113
+ update!(**args)
114
+ end
115
+
116
+ # Update properties of this object
117
+ def update!(**args)
118
+ @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
119
+ @shelves = args[:shelves] if args.key?(:shelves)
120
+ end
121
+ end
122
+
123
+ # A Shelf contains a collection of books with a theme.
124
+ class GoogleExampleLibraryagentV1Shelf
125
+ include Google::Apis::Core::Hashable
126
+
127
+ # Output only. The resource name of the shelf.
128
+ # Shelf names have the form `shelves/`shelf_id``.
129
+ # The name is ignored when creating a shelf.
130
+ # Corresponds to the JSON property `name`
131
+ # @return [String]
132
+ attr_accessor :name
133
+
134
+ # The theme of the shelf
135
+ # Corresponds to the JSON property `theme`
136
+ # @return [String]
137
+ attr_accessor :theme
138
+
139
+ def initialize(**args)
140
+ update!(**args)
141
+ end
142
+
143
+ # Update properties of this object
144
+ def update!(**args)
145
+ @name = args[:name] if args.key?(:name)
146
+ @theme = args[:theme] if args.key?(:theme)
147
+ end
148
+ end
149
+ end
150
+ end
151
+ end
@@ -0,0 +1,86 @@
1
+ # Copyright 2015 Google Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module LibraryagentV1
24
+
25
+ class GoogleExampleLibraryagentV1Book
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class GoogleExampleLibraryagentV1ListBooksResponse
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class GoogleExampleLibraryagentV1ListShelvesResponse
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class GoogleExampleLibraryagentV1Shelf
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class GoogleExampleLibraryagentV1Book
50
+ # @private
51
+ class Representation < Google::Apis::Core::JsonRepresentation
52
+ property :author, as: 'author'
53
+ property :name, as: 'name'
54
+ property :read, as: 'read'
55
+ property :title, as: 'title'
56
+ end
57
+ end
58
+
59
+ class GoogleExampleLibraryagentV1ListBooksResponse
60
+ # @private
61
+ class Representation < Google::Apis::Core::JsonRepresentation
62
+ collection :books, as: 'books', class: Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1Book, decorator: Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1Book::Representation
63
+
64
+ property :next_page_token, as: 'nextPageToken'
65
+ end
66
+ end
67
+
68
+ class GoogleExampleLibraryagentV1ListShelvesResponse
69
+ # @private
70
+ class Representation < Google::Apis::Core::JsonRepresentation
71
+ property :next_page_token, as: 'nextPageToken'
72
+ collection :shelves, as: 'shelves', class: Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1Shelf, decorator: Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1Shelf::Representation
73
+
74
+ end
75
+ end
76
+
77
+ class GoogleExampleLibraryagentV1Shelf
78
+ # @private
79
+ class Representation < Google::Apis::Core::JsonRepresentation
80
+ property :name, as: 'name'
81
+ property :theme, as: 'theme'
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,265 @@
1
+ # Copyright 2015 Google Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module LibraryagentV1
23
+ # Library Agent API
24
+ #
25
+ # A simple Google Example Library API.
26
+ #
27
+ # @example
28
+ # require 'google/apis/libraryagent_v1'
29
+ #
30
+ # Libraryagent = Google::Apis::LibraryagentV1 # Alias the module
31
+ # service = Libraryagent::LibraryagentService.new
32
+ #
33
+ # @see https://cloud.google.com/docs/quota
34
+ class LibraryagentService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://libraryagent.googleapis.com/', '')
47
+ @batch_path = 'batch'
48
+ end
49
+
50
+ # Gets a shelf. Returns NOT_FOUND if the shelf does not exist.
51
+ # @param [String] name
52
+ # The name of the shelf to retrieve.
53
+ # @param [String] fields
54
+ # Selector specifying which fields to include in a partial response.
55
+ # @param [String] quota_user
56
+ # Available to use for quota purposes for server-side applications. Can be any
57
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
58
+ # @param [Google::Apis::RequestOptions] options
59
+ # Request-specific options
60
+ #
61
+ # @yield [result, err] Result & error if block supplied
62
+ # @yieldparam result [Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1Shelf] parsed result object
63
+ # @yieldparam err [StandardError] error object if request failed
64
+ #
65
+ # @return [Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1Shelf]
66
+ #
67
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
68
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
69
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
70
+ def get_shelf(name, fields: nil, quota_user: nil, options: nil, &block)
71
+ command = make_simple_command(:get, 'v1/{+name}', options)
72
+ command.response_representation = Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1Shelf::Representation
73
+ command.response_class = Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1Shelf
74
+ command.params['name'] = name unless name.nil?
75
+ command.query['fields'] = fields unless fields.nil?
76
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
77
+ execute_or_queue_command(command, &block)
78
+ end
79
+
80
+ # Lists shelves. The order is unspecified but deterministic. Newly created
81
+ # shelves will not necessarily be added to the end of this list.
82
+ # @param [Fixnum] page_size
83
+ # Requested page size. Server may return fewer shelves than requested.
84
+ # If unspecified, server will pick an appropriate default.
85
+ # @param [String] page_token
86
+ # A token identifying a page of results the server should return.
87
+ # Typically, this is the value of
88
+ # ListShelvesResponse.next_page_token
89
+ # returned from the previous call to `ListShelves` method.
90
+ # @param [String] fields
91
+ # Selector specifying which fields to include in a partial response.
92
+ # @param [String] quota_user
93
+ # Available to use for quota purposes for server-side applications. Can be any
94
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
95
+ # @param [Google::Apis::RequestOptions] options
96
+ # Request-specific options
97
+ #
98
+ # @yield [result, err] Result & error if block supplied
99
+ # @yieldparam result [Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1ListShelvesResponse] parsed result object
100
+ # @yieldparam err [StandardError] error object if request failed
101
+ #
102
+ # @return [Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1ListShelvesResponse]
103
+ #
104
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
105
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
106
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
107
+ def list_shelves(page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
108
+ command = make_simple_command(:get, 'v1/shelves', options)
109
+ command.response_representation = Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1ListShelvesResponse::Representation
110
+ command.response_class = Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1ListShelvesResponse
111
+ command.query['pageSize'] = page_size unless page_size.nil?
112
+ command.query['pageToken'] = page_token unless page_token.nil?
113
+ command.query['fields'] = fields unless fields.nil?
114
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
115
+ execute_or_queue_command(command, &block)
116
+ end
117
+
118
+ # Borrow a book from the library. Returns the book if it is borrowed
119
+ # successfully. Returns NOT_FOUND if the book does not exist in the library.
120
+ # Returns quota exceeded error if the amount of books borrowed exceeds
121
+ # allocation quota in any dimensions.
122
+ # @param [String] name
123
+ # The name of the book to borrow.
124
+ # @param [String] fields
125
+ # Selector specifying which fields to include in a partial response.
126
+ # @param [String] quota_user
127
+ # Available to use for quota purposes for server-side applications. Can be any
128
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
129
+ # @param [Google::Apis::RequestOptions] options
130
+ # Request-specific options
131
+ #
132
+ # @yield [result, err] Result & error if block supplied
133
+ # @yieldparam result [Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1Book] parsed result object
134
+ # @yieldparam err [StandardError] error object if request failed
135
+ #
136
+ # @return [Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1Book]
137
+ #
138
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
139
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
140
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
141
+ def borrow_shelf_book(name, fields: nil, quota_user: nil, options: nil, &block)
142
+ command = make_simple_command(:post, 'v1/{+name}:borrow', options)
143
+ command.response_representation = Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1Book::Representation
144
+ command.response_class = Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1Book
145
+ command.params['name'] = name unless name.nil?
146
+ command.query['fields'] = fields unless fields.nil?
147
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
148
+ execute_or_queue_command(command, &block)
149
+ end
150
+
151
+ # Gets a book. Returns NOT_FOUND if the book does not exist.
152
+ # @param [String] name
153
+ # The name of the book to retrieve.
154
+ # @param [String] fields
155
+ # Selector specifying which fields to include in a partial response.
156
+ # @param [String] quota_user
157
+ # Available to use for quota purposes for server-side applications. Can be any
158
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
159
+ # @param [Google::Apis::RequestOptions] options
160
+ # Request-specific options
161
+ #
162
+ # @yield [result, err] Result & error if block supplied
163
+ # @yieldparam result [Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1Book] parsed result object
164
+ # @yieldparam err [StandardError] error object if request failed
165
+ #
166
+ # @return [Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1Book]
167
+ #
168
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
169
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
170
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
171
+ def get_shelf_book(name, fields: nil, quota_user: nil, options: nil, &block)
172
+ command = make_simple_command(:get, 'v1/{+name}', options)
173
+ command.response_representation = Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1Book::Representation
174
+ command.response_class = Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1Book
175
+ command.params['name'] = name unless name.nil?
176
+ command.query['fields'] = fields unless fields.nil?
177
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
178
+ execute_or_queue_command(command, &block)
179
+ end
180
+
181
+ # Lists books in a shelf. The order is unspecified but deterministic. Newly
182
+ # created books will not necessarily be added to the end of this list.
183
+ # Returns NOT_FOUND if the shelf does not exist.
184
+ # @param [String] parent
185
+ # The name of the shelf whose books we'd like to list.
186
+ # @param [Fixnum] page_size
187
+ # Requested page size. Server may return fewer books than requested.
188
+ # If unspecified, server will pick an appropriate default.
189
+ # @param [String] page_token
190
+ # A token identifying a page of results the server should return.
191
+ # Typically, this is the value of
192
+ # ListBooksResponse.next_page_token.
193
+ # returned from the previous call to `ListBooks` method.
194
+ # @param [String] fields
195
+ # Selector specifying which fields to include in a partial response.
196
+ # @param [String] quota_user
197
+ # Available to use for quota purposes for server-side applications. Can be any
198
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
199
+ # @param [Google::Apis::RequestOptions] options
200
+ # Request-specific options
201
+ #
202
+ # @yield [result, err] Result & error if block supplied
203
+ # @yieldparam result [Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1ListBooksResponse] parsed result object
204
+ # @yieldparam err [StandardError] error object if request failed
205
+ #
206
+ # @return [Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1ListBooksResponse]
207
+ #
208
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
209
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
210
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
211
+ def list_shelf_books(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
212
+ command = make_simple_command(:get, 'v1/{+parent}/books', options)
213
+ command.response_representation = Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1ListBooksResponse::Representation
214
+ command.response_class = Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1ListBooksResponse
215
+ command.params['parent'] = parent unless parent.nil?
216
+ command.query['pageSize'] = page_size unless page_size.nil?
217
+ command.query['pageToken'] = page_token unless page_token.nil?
218
+ command.query['fields'] = fields unless fields.nil?
219
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
220
+ execute_or_queue_command(command, &block)
221
+ end
222
+
223
+ # Return a book to the library. Returns the book if it is returned to the
224
+ # library successfully.
225
+ # Returns error if the book does not belong to the library
226
+ # or the users didn't borrow before.
227
+ # @param [String] name
228
+ # The name of the book to return.
229
+ # @param [String] fields
230
+ # Selector specifying which fields to include in a partial response.
231
+ # @param [String] quota_user
232
+ # Available to use for quota purposes for server-side applications. Can be any
233
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
234
+ # @param [Google::Apis::RequestOptions] options
235
+ # Request-specific options
236
+ #
237
+ # @yield [result, err] Result & error if block supplied
238
+ # @yieldparam result [Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1Book] parsed result object
239
+ # @yieldparam err [StandardError] error object if request failed
240
+ #
241
+ # @return [Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1Book]
242
+ #
243
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
244
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
245
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
246
+ def return_shelf_book(name, fields: nil, quota_user: nil, options: nil, &block)
247
+ command = make_simple_command(:post, 'v1/{+name}:return', options)
248
+ command.response_representation = Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1Book::Representation
249
+ command.response_class = Google::Apis::LibraryagentV1::GoogleExampleLibraryagentV1Book
250
+ command.params['name'] = name unless name.nil?
251
+ command.query['fields'] = fields unless fields.nil?
252
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
253
+ execute_or_queue_command(command, &block)
254
+ end
255
+
256
+ protected
257
+
258
+ def apply_command_defaults(command)
259
+ command.query['key'] = key unless key.nil?
260
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
261
+ end
262
+ end
263
+ end
264
+ end
265
+ end