Debian Codegraph @

drivelabels/v2/drivelabels-gen.go

raw
1 // Copyright 2026 Google LLC.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 // Code generated file. DO NOT EDIT.
6
7 // Package drivelabels provides access to the Drive Labels API.
8 //
9 // For product documentation, see: https://developers.google.com/workspace/drive/labels
10 //
11 // # Library status
12 //
13 // These client libraries are officially supported by Google. However, this
14 // library is considered complete and is in maintenance mode. This means
15 // that we will address critical bugs and security issues but will not add
16 // any new features.
17 //
18 // When possible, we recommend using our newer
19 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
20 // that are still actively being worked and iterated on.
21 //
22 // # Creating a client
23 //
24 // Usage example:
25 //
26 // import "google.golang.org/api/drivelabels/v2"
27 // ...
28 // ctx := context.Background()
29 // drivelabelsService, err := drivelabels.NewService(ctx)
30 //
31 // In this example, Google Application Default Credentials are used for
32 // authentication. For information on how to create and obtain Application
33 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
34 //
35 // # Other authentication options
36 //
37 // By default, all available scopes (see "Constants") are used to authenticate.
38 // To restrict scopes, use [google.golang.org/api/option.WithScopes]:
39 //
40 // drivelabelsService, err := drivelabels.NewService(ctx, option.WithScopes(drivelabels.DriveLabelsReadonlyScope))
41 //
42 // To use an API key for authentication (note: some APIs do not support API
43 // keys), use [google.golang.org/api/option.WithAPIKey]:
44 //
45 // drivelabelsService, err := drivelabels.NewService(ctx, option.WithAPIKey("AIza..."))
46 //
47 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
48 // flow, use [google.golang.org/api/option.WithTokenSource]:
49 //
50 // config := &oauth2.Config{...}
51 // // ...
52 // token, err := config.Exchange(ctx, ...)
53 // drivelabelsService, err := drivelabels.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
54 //
55 // See [google.golang.org/api/option.ClientOption] for details on options.
56 package drivelabels // import "google.golang.org/api/drivelabels/v2"
57
58 import (
59 "bytes"
60 "context"
61 "encoding/json"
62 "errors"
63 "fmt"
64 "io"
65 "log/slog"
66 "net/http"
67 "net/url"
68 "strconv"
69 "strings"
70
71 "github.com/googleapis/gax-go/v2/internallog"
72 googleapi "google.golang.org/api/googleapi"
73 internal "google.golang.org/api/internal"
74 gensupport "google.golang.org/api/internal/gensupport"
75 option "google.golang.org/api/option"
76 internaloption "google.golang.org/api/option/internaloption"
77 htransport "google.golang.org/api/transport/http"
78 )
79
80 // Always reference these packages, just in case the auto-generated code
81 // below doesn't.
82 var _ = bytes.NewBuffer
83 var _ = strconv.Itoa
84 var _ = fmt.Sprintf
85 var _ = json.NewDecoder
86 var _ = io.Copy
87 var _ = url.Parse
88 var _ = gensupport.MarshalJSON
89 var _ = googleapi.Version
90 var _ = errors.New
91 var _ = strings.Replace
92 var _ = context.Canceled
93 var _ = internaloption.WithDefaultEndpoint
94 var _ = internal.Version
95 var _ = internallog.New
96
97 const apiId = "drivelabels:v2"
98 const apiName = "drivelabels"
99 const apiVersion = "v2"
100 const basePath = "https://drivelabels.googleapis.com/"
101 const basePathTemplate = "https://drivelabels.UNIVERSE_DOMAIN/"
102 const mtlsBasePath = "https://drivelabels.mtls.googleapis.com/"
103
104 // OAuth2 scopes used by this API.
105 const (
106 // See, edit, create, and delete all Google Drive labels in your organization,
107 // and see your organization's label-related admin policies
108 DriveAdminLabelsScope = "https://www.googleapis.com/auth/drive.admin.labels"
109
110 // See all Google Drive labels and label-related admin policies in your
111 // organization
112 DriveAdminLabelsReadonlyScope = "https://www.googleapis.com/auth/drive.admin.labels.readonly"
113
114 // See, edit, create, and delete your Google Drive labels
115 DriveLabelsScope = "https://www.googleapis.com/auth/drive.labels"
116
117 // See your Google Drive labels
118 DriveLabelsReadonlyScope = "https://www.googleapis.com/auth/drive.labels.readonly"
119 )
120
121 // NewService creates a new Service.
122 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
123 scopesOption := internaloption.WithDefaultScopes(
124 "https://www.googleapis.com/auth/drive.admin.labels",
125 "https://www.googleapis.com/auth/drive.admin.labels.readonly",
126 "https://www.googleapis.com/auth/drive.labels",
127 "https://www.googleapis.com/auth/drive.labels.readonly",
128 )
129 // NOTE: prepend, so we don't override user-specified scopes.
130 opts = append([]option.ClientOption{scopesOption}, opts...)
131 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
132 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
133 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
134 opts = append(opts, internaloption.EnableNewAuthLibrary())
135 client, endpoint, err := htransport.NewClient(ctx, opts...)
136 if err != nil {
137 return nil, err
138 }
139 s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)}
140 s.Labels = NewLabelsService(s)
141 s.Limits = NewLimitsService(s)
142 s.Users = NewUsersService(s)
143 if endpoint != "" {
144 s.BasePath = endpoint
145 }
146 return s, nil
147 }
148
149 // New creates a new Service. It uses the provided http.Client for requests.
150 //
151 // Deprecated: please use NewService instead.
152 // To provide a custom HTTP client, use option.WithHTTPClient.
153 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
154 func New(client *http.Client) (*Service, error) {
155 if client == nil {
156 return nil, errors.New("client is nil")
157 }
158 return NewService(context.TODO(), option.WithHTTPClient(client))
159 }
160
161 type Service struct {
162 client *http.Client
163 logger *slog.Logger
164 BasePath string // API endpoint base URL
165 UserAgent string // optional additional User-Agent fragment
166
167 Labels *LabelsService
168
169 Limits *LimitsService
170
171 Users *UsersService
172 }
173
174 func (s *Service) userAgent() string {
175 if s.UserAgent == "" {
176 return googleapi.UserAgent
177 }
178 return googleapi.UserAgent + " " + s.UserAgent
179 }
180
181 func NewLabelsService(s *Service) *LabelsService {
182 rs := &LabelsService{s: s}
183 rs.Locks = NewLabelsLocksService(s)
184 rs.Permissions = NewLabelsPermissionsService(s)
185 rs.Revisions = NewLabelsRevisionsService(s)
186 return rs
187 }
188
189 type LabelsService struct {
190 s *Service
191
192 Locks *LabelsLocksService
193
194 Permissions *LabelsPermissionsService
195
196 Revisions *LabelsRevisionsService
197 }
198
199 func NewLabelsLocksService(s *Service) *LabelsLocksService {
200 rs := &LabelsLocksService{s: s}
201 return rs
202 }
203
204 type LabelsLocksService struct {
205 s *Service
206 }
207
208 func NewLabelsPermissionsService(s *Service) *LabelsPermissionsService {
209 rs := &LabelsPermissionsService{s: s}
210 return rs
211 }
212
213 type LabelsPermissionsService struct {
214 s *Service
215 }
216
217 func NewLabelsRevisionsService(s *Service) *LabelsRevisionsService {
218 rs := &LabelsRevisionsService{s: s}
219 rs.Locks = NewLabelsRevisionsLocksService(s)
220 rs.Permissions = NewLabelsRevisionsPermissionsService(s)
221 return rs
222 }
223
224 type LabelsRevisionsService struct {
225 s *Service
226
227 Locks *LabelsRevisionsLocksService
228
229 Permissions *LabelsRevisionsPermissionsService
230 }
231
232 func NewLabelsRevisionsLocksService(s *Service) *LabelsRevisionsLocksService {
233 rs := &LabelsRevisionsLocksService{s: s}
234 return rs
235 }
236
237 type LabelsRevisionsLocksService struct {
238 s *Service
239 }
240
241 func NewLabelsRevisionsPermissionsService(s *Service) *LabelsRevisionsPermissionsService {
242 rs := &LabelsRevisionsPermissionsService{s: s}
243 return rs
244 }
245
246 type LabelsRevisionsPermissionsService struct {
247 s *Service
248 }
249
250 func NewLimitsService(s *Service) *LimitsService {
251 rs := &LimitsService{s: s}
252 return rs
253 }
254
255 type LimitsService struct {
256 s *Service
257 }
258
259 func NewUsersService(s *Service) *UsersService {
260 rs := &UsersService{s: s}
261 return rs
262 }
263
264 type UsersService struct {
265 s *Service
266 }
267
268 // GoogleAppsDriveLabelsV2BadgeColors: The color derived from BadgeConfig and
269 // changed to the closest recommended supported color.
270 type GoogleAppsDriveLabelsV2BadgeColors struct {
271 // BackgroundColor: Output only. Badge background that pairs with the
272 // foreground.
273 BackgroundColor *GoogleTypeColor `json:"backgroundColor,omitempty"`
274 // ForegroundColor: Output only. Badge foreground that pairs with the
275 // background.
276 ForegroundColor *GoogleTypeColor `json:"foregroundColor,omitempty"`
277 // SoloColor: Output only. Color that can be used for text without a
278 // background.
279 SoloColor *GoogleTypeColor `json:"soloColor,omitempty"`
280 // ForceSendFields is a list of field names (e.g. "BackgroundColor") to
281 // unconditionally include in API requests. By default, fields with empty or
282 // default values are omitted from API requests. See
283 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
284 // details.
285 ForceSendFields []string `json:"-"`
286 // NullFields is a list of field names (e.g. "BackgroundColor") to include in
287 // API requests with the JSON null value. By default, fields with empty values
288 // are omitted from API requests. See
289 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
290 NullFields []string `json:"-"`
291 }
292
293 func (s GoogleAppsDriveLabelsV2BadgeColors) MarshalJSON() ([]byte, error) {
294 type NoMethod GoogleAppsDriveLabelsV2BadgeColors
295 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
296 }
297
298 // GoogleAppsDriveLabelsV2BadgeConfig: Badge status of the label.
299 type GoogleAppsDriveLabelsV2BadgeConfig struct {
300 // Color: The color of the badge. When not specified, no badge is rendered. The
301 // background, foreground, and solo (light and dark mode) colors set here are
302 // changed in the Drive UI into the closest recommended supported color.
303 Color *GoogleTypeColor `json:"color,omitempty"`
304 // PriorityOverride: Override the default global priority of this badge. When
305 // set to 0, the default priority heuristic is used.
306 PriorityOverride int64 `json:"priorityOverride,omitempty,string"`
307 // ForceSendFields is a list of field names (e.g. "Color") to unconditionally
308 // include in API requests. By default, fields with empty or default values are
309 // omitted from API requests. See
310 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
311 // details.
312 ForceSendFields []string `json:"-"`
313 // NullFields is a list of field names (e.g. "Color") to include in API
314 // requests with the JSON null value. By default, fields with empty values are
315 // omitted from API requests. See
316 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
317 NullFields []string `json:"-"`
318 }
319
320 func (s GoogleAppsDriveLabelsV2BadgeConfig) MarshalJSON() ([]byte, error) {
321 type NoMethod GoogleAppsDriveLabelsV2BadgeConfig
322 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
323 }
324
325 // GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest: Deletes one or
326 // more label permissions.
327 type GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest struct {
328 // Requests: Required. The request message specifying the resources to update.
329 Requests []*GoogleAppsDriveLabelsV2DeleteLabelPermissionRequest `json:"requests,omitempty"`
330 // UseAdminAccess: Set to `true` in order to use the user's admin credentials.
331 // The server will verify the user is an admin for the label before allowing
332 // access. If this is set, the `use_admin_access` field in the
333 // `DeleteLabelPermissionRequest` messages must either be empty or match this
334 // field.
335 UseAdminAccess bool `json:"useAdminAccess,omitempty"`
336 // ForceSendFields is a list of field names (e.g. "Requests") to
337 // unconditionally include in API requests. By default, fields with empty or
338 // default values are omitted from API requests. See
339 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
340 // details.
341 ForceSendFields []string `json:"-"`
342 // NullFields is a list of field names (e.g. "Requests") to include in API
343 // requests with the JSON null value. By default, fields with empty values are
344 // omitted from API requests. See
345 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
346 NullFields []string `json:"-"`
347 }
348
349 func (s GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest) MarshalJSON() ([]byte, error) {
350 type NoMethod GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest
351 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
352 }
353
354 // GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest: Updates one or
355 // more label permissions.
356 type GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest struct {
357 // Requests: Required. The request message specifying the resources to update.
358 Requests []*GoogleAppsDriveLabelsV2UpdateLabelPermissionRequest `json:"requests,omitempty"`
359 // UseAdminAccess: Set to `true` in order to use the user's admin credentials.
360 // The server will verify the user is an admin for the label before allowing
361 // access. If this is set, the `use_admin_access` field in the
362 // `UpdateLabelPermissionRequest` messages must either be empty or match this
363 // field.
364 UseAdminAccess bool `json:"useAdminAccess,omitempty"`
365 // ForceSendFields is a list of field names (e.g. "Requests") to
366 // unconditionally include in API requests. By default, fields with empty or
367 // default values are omitted from API requests. See
368 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
369 // details.
370 ForceSendFields []string `json:"-"`
371 // NullFields is a list of field names (e.g. "Requests") to include in API
372 // requests with the JSON null value. By default, fields with empty values are
373 // omitted from API requests. See
374 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
375 NullFields []string `json:"-"`
376 }
377
378 func (s GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest) MarshalJSON() ([]byte, error) {
379 type NoMethod GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest
380 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
381 }
382
383 // GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse: Response for
384 // updating one or more label permissions.
385 type GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse struct {
386 // Permissions: Required. Permissions updated.
387 Permissions []*GoogleAppsDriveLabelsV2LabelPermission `json:"permissions,omitempty"`
388
389 // ServerResponse contains the HTTP response code and headers from the server.
390 googleapi.ServerResponse `json:"-"`
391 // ForceSendFields is a list of field names (e.g. "Permissions") to
392 // unconditionally include in API requests. By default, fields with empty or
393 // default values are omitted from API requests. See
394 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
395 // details.
396 ForceSendFields []string `json:"-"`
397 // NullFields is a list of field names (e.g. "Permissions") to include in API
398 // requests with the JSON null value. By default, fields with empty values are
399 // omitted from API requests. See
400 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
401 NullFields []string `json:"-"`
402 }
403
404 func (s GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse) MarshalJSON() ([]byte, error) {
405 type NoMethod GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse
406 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
407 }
408
409 // GoogleAppsDriveLabelsV2DateLimits: Limits for date field type.
410 type GoogleAppsDriveLabelsV2DateLimits struct {
411 // MaxValue: Maximum value for the date field type.
412 MaxValue *GoogleTypeDate `json:"maxValue,omitempty"`
413 // MinValue: Minimum value for the date field type.
414 MinValue *GoogleTypeDate `json:"minValue,omitempty"`
415 // ForceSendFields is a list of field names (e.g. "MaxValue") to
416 // unconditionally include in API requests. By default, fields with empty or
417 // default values are omitted from API requests. See
418 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
419 // details.
420 ForceSendFields []string `json:"-"`
421 // NullFields is a list of field names (e.g. "MaxValue") to include in API
422 // requests with the JSON null value. By default, fields with empty values are
423 // omitted from API requests. See
424 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
425 NullFields []string `json:"-"`
426 }
427
428 func (s GoogleAppsDriveLabelsV2DateLimits) MarshalJSON() ([]byte, error) {
429 type NoMethod GoogleAppsDriveLabelsV2DateLimits
430 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
431 }
432
433 // GoogleAppsDriveLabelsV2DeleteLabelPermissionRequest: Deletes a label
434 // permission. Permissions affect the label resource as a whole, aren't
435 // revisioned, and don't require publishing.
436 type GoogleAppsDriveLabelsV2DeleteLabelPermissionRequest struct {
437 // Name: Required. Label permission resource name.
438 Name string `json:"name,omitempty"`
439 // UseAdminAccess: Set to `true` in order to use the user's admin credentials.
440 // The server will verify the user is an admin for the label before allowing
441 // access.
442 UseAdminAccess bool `json:"useAdminAccess,omitempty"`
443 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally
444 // include in API requests. By default, fields with empty or default values are
445 // omitted from API requests. See
446 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
447 // details.
448 ForceSendFields []string `json:"-"`
449 // NullFields is a list of field names (e.g. "Name") to include in API requests
450 // with the JSON null value. By default, fields with empty values are omitted
451 // from API requests. See
452 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
453 NullFields []string `json:"-"`
454 }
455
456 func (s GoogleAppsDriveLabelsV2DeleteLabelPermissionRequest) MarshalJSON() ([]byte, error) {
457 type NoMethod GoogleAppsDriveLabelsV2DeleteLabelPermissionRequest
458 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
459 }
460
461 // GoogleAppsDriveLabelsV2DeltaUpdateLabelRequest: The set of requests for
462 // updating aspects of a label. If any request isn't valid, no requests will be
463 // applied.
464 type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequest struct {
465 // LanguageCode: The BCP-47 language code to use for evaluating localized field
466 // labels when `include_label_in_response` is `true`.
467 LanguageCode string `json:"languageCode,omitempty"`
468 // Requests: A list of updates to apply to the label. Requests will be applied
469 // in the order they are specified.
470 Requests []*GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestRequest `json:"requests,omitempty"`
471 // UseAdminAccess: Set to `true` in order to use the user's admin credentials.
472 // The server will verify the user is an admin for the label before allowing
473 // access.
474 UseAdminAccess bool `json:"useAdminAccess,omitempty"`
475 // View: When specified, only certain fields belonging to the indicated view
476 // will be returned.
477 //
478 // Possible values:
479 // "LABEL_VIEW_BASIC" - Implies the field mask:
480 // `name,id,revision_id,label_type,properties.*`
481 // "LABEL_VIEW_FULL" - All possible fields.
482 View string `json:"view,omitempty"`
483 // WriteControl: Provides control over how write requests are executed.
484 WriteControl *GoogleAppsDriveLabelsV2WriteControl `json:"writeControl,omitempty"`
485 // ForceSendFields is a list of field names (e.g. "LanguageCode") to
486 // unconditionally include in API requests. By default, fields with empty or
487 // default values are omitted from API requests. See
488 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
489 // details.
490 ForceSendFields []string `json:"-"`
491 // NullFields is a list of field names (e.g. "LanguageCode") to include in API
492 // requests with the JSON null value. By default, fields with empty values are
493 // omitted from API requests. See
494 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
495 NullFields []string `json:"-"`
496 }
497
498 func (s GoogleAppsDriveLabelsV2DeltaUpdateLabelRequest) MarshalJSON() ([]byte, error) {
499 type NoMethod GoogleAppsDriveLabelsV2DeltaUpdateLabelRequest
500 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
501 }
502
503 // GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestCreateFieldRequest: Request to
504 // create a field within a label.
505 type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestCreateFieldRequest struct {
506 // Field: Required. Field to create.
507 Field *GoogleAppsDriveLabelsV2Field `json:"field,omitempty"`
508 // ForceSendFields is a list of field names (e.g. "Field") to unconditionally
509 // include in API requests. By default, fields with empty or default values are
510 // omitted from API requests. See
511 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
512 // details.
513 ForceSendFields []string `json:"-"`
514 // NullFields is a list of field names (e.g. "Field") to include in API
515 // requests with the JSON null value. By default, fields with empty values are
516 // omitted from API requests. See
517 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
518 NullFields []string `json:"-"`
519 }
520
521 func (s GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestCreateFieldRequest) MarshalJSON() ([]byte, error) {
522 type NoMethod GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestCreateFieldRequest
523 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
524 }
525
526 // GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestCreateSelectionChoiceRequest:
527 // Request to create a selection choice.
528 type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestCreateSelectionChoiceRequest struct {
529 // Choice: Required. The choice to create.
530 Choice *GoogleAppsDriveLabelsV2FieldSelectionOptionsChoice `json:"choice,omitempty"`
531 // FieldId: Required. The selection field in which a choice will be created.
532 FieldId string `json:"fieldId,omitempty"`
533 // ForceSendFields is a list of field names (e.g. "Choice") to unconditionally
534 // include in API requests. By default, fields with empty or default values are
535 // omitted from API requests. See
536 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
537 // details.
538 ForceSendFields []string `json:"-"`
539 // NullFields is a list of field names (e.g. "Choice") to include in API
540 // requests with the JSON null value. By default, fields with empty values are
541 // omitted from API requests. See
542 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
543 NullFields []string `json:"-"`
544 }
545
546 func (s GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestCreateSelectionChoiceRequest) MarshalJSON() ([]byte, error) {
547 type NoMethod GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestCreateSelectionChoiceRequest
548 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
549 }
550
551 // GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDeleteFieldRequest: Request to
552 // delete the field.
553 type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDeleteFieldRequest struct {
554 // Id: Required. ID of the field to delete.
555 Id string `json:"id,omitempty"`
556 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
557 // include in API requests. By default, fields with empty or default values are
558 // omitted from API requests. See
559 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
560 // details.
561 ForceSendFields []string `json:"-"`
562 // NullFields is a list of field names (e.g. "Id") to include in API requests
563 // with the JSON null value. By default, fields with empty values are omitted
564 // from API requests. See
565 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
566 NullFields []string `json:"-"`
567 }
568
569 func (s GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDeleteFieldRequest) MarshalJSON() ([]byte, error) {
570 type NoMethod GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDeleteFieldRequest
571 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
572 }
573
574 // GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDeleteSelectionChoiceRequest:
575 // Request to delete a choice.
576 type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDeleteSelectionChoiceRequest struct {
577 // FieldId: Required. The selection field from which a choice will be deleted.
578 FieldId string `json:"fieldId,omitempty"`
579 // Id: Required. Choice to delete.
580 Id string `json:"id,omitempty"`
581 // ForceSendFields is a list of field names (e.g. "FieldId") to unconditionally
582 // include in API requests. By default, fields with empty or default values are
583 // omitted from API requests. See
584 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
585 // details.
586 ForceSendFields []string `json:"-"`
587 // NullFields is a list of field names (e.g. "FieldId") to include in API
588 // requests with the JSON null value. By default, fields with empty values are
589 // omitted from API requests. See
590 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
591 NullFields []string `json:"-"`
592 }
593
594 func (s GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDeleteSelectionChoiceRequest) MarshalJSON() ([]byte, error) {
595 type NoMethod GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDeleteSelectionChoiceRequest
596 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
597 }
598
599 // GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDisableFieldRequest: Request
600 // to disable the field.
601 type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDisableFieldRequest struct {
602 // DisabledPolicy: Required. Field disabled policy.
603 DisabledPolicy *GoogleAppsDriveLabelsV2LifecycleDisabledPolicy `json:"disabledPolicy,omitempty"`
604 // Id: Required. Key of the field to disable.
605 Id string `json:"id,omitempty"`
606 // UpdateMask: The fields that should be updated. At least one field must be
607 // specified. The root `disabled_policy` is implied and should not be
608 // specified. A single `*` can be used as a short-hand for updating every
609 // field.
610 UpdateMask string `json:"updateMask,omitempty"`
611 // ForceSendFields is a list of field names (e.g. "DisabledPolicy") to
612 // unconditionally include in API requests. By default, fields with empty or
613 // default values are omitted from API requests. See
614 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
615 // details.
616 ForceSendFields []string `json:"-"`
617 // NullFields is a list of field names (e.g. "DisabledPolicy") to include in
618 // API requests with the JSON null value. By default, fields with empty values
619 // are omitted from API requests. See
620 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
621 NullFields []string `json:"-"`
622 }
623
624 func (s GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDisableFieldRequest) MarshalJSON() ([]byte, error) {
625 type NoMethod GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDisableFieldRequest
626 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
627 }
628
629 // GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDisableSelectionChoiceRequest:
630 // Request to disable a choice.
631 type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDisableSelectionChoiceRequest struct {
632 // DisabledPolicy: Required. The disabled policy to update.
633 DisabledPolicy *GoogleAppsDriveLabelsV2LifecycleDisabledPolicy `json:"disabledPolicy,omitempty"`
634 // FieldId: Required. The selection field in which a choice will be disabled.
635 FieldId string `json:"fieldId,omitempty"`
636 // Id: Required. Choice to disable.
637 Id string `json:"id,omitempty"`
638 // UpdateMask: The fields that should be updated. At least one field must be
639 // specified. The root `disabled_policy` is implied and should not be
640 // specified. A single `*` can be used as a short-hand for updating every
641 // field.
642 UpdateMask string `json:"updateMask,omitempty"`
643 // ForceSendFields is a list of field names (e.g. "DisabledPolicy") to
644 // unconditionally include in API requests. By default, fields with empty or
645 // default values are omitted from API requests. See
646 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
647 // details.
648 ForceSendFields []string `json:"-"`
649 // NullFields is a list of field names (e.g. "DisabledPolicy") to include in
650 // API requests with the JSON null value. By default, fields with empty values
651 // are omitted from API requests. See
652 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
653 NullFields []string `json:"-"`
654 }
655
656 func (s GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDisableSelectionChoiceRequest) MarshalJSON() ([]byte, error) {
657 type NoMethod GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDisableSelectionChoiceRequest
658 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
659 }
660
661 // GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestEnableFieldRequest: Request to
662 // enable the field.
663 type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestEnableFieldRequest struct {
664 // Id: Required. ID of the field to enable.
665 Id string `json:"id,omitempty"`
666 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
667 // include in API requests. By default, fields with empty or default values are
668 // omitted from API requests. See
669 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
670 // details.
671 ForceSendFields []string `json:"-"`
672 // NullFields is a list of field names (e.g. "Id") to include in API requests
673 // with the JSON null value. By default, fields with empty values are omitted
674 // from API requests. See
675 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
676 NullFields []string `json:"-"`
677 }
678
679 func (s GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestEnableFieldRequest) MarshalJSON() ([]byte, error) {
680 type NoMethod GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestEnableFieldRequest
681 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
682 }
683
684 // GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestEnableSelectionChoiceRequest:
685 // Request to enable a choice.
686 type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestEnableSelectionChoiceRequest struct {
687 // FieldId: Required. The selection field in which a choice will be enabled.
688 FieldId string `json:"fieldId,omitempty"`
689 // Id: Required. Choice to enable.
690 Id string `json:"id,omitempty"`
691 // ForceSendFields is a list of field names (e.g. "FieldId") to unconditionally
692 // include in API requests. By default, fields with empty or default values are
693 // omitted from API requests. See
694 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
695 // details.
696 ForceSendFields []string `json:"-"`
697 // NullFields is a list of field names (e.g. "FieldId") to include in API
698 // requests with the JSON null value. By default, fields with empty values are
699 // omitted from API requests. See
700 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
701 NullFields []string `json:"-"`
702 }
703
704 func (s GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestEnableSelectionChoiceRequest) MarshalJSON() ([]byte, error) {
705 type NoMethod GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestEnableSelectionChoiceRequest
706 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
707 }
708
709 // GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestRequest: A single kind of
710 // update to apply to a label.
711 type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestRequest struct {
712 // CreateField: Creates a field.
713 CreateField *GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestCreateFieldRequest `json:"createField,omitempty"`
714 // CreateSelectionChoice: Create a choice within a selection field.
715 CreateSelectionChoice *GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestCreateSelectionChoiceRequest `json:"createSelectionChoice,omitempty"`
716 // DeleteField: Deletes a field from the label.
717 DeleteField *GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDeleteFieldRequest `json:"deleteField,omitempty"`
718 // DeleteSelectionChoice: Delete a choice within a selection field.
719 DeleteSelectionChoice *GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDeleteSelectionChoiceRequest `json:"deleteSelectionChoice,omitempty"`
720 // DisableField: Disables the field.
721 DisableField *GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDisableFieldRequest `json:"disableField,omitempty"`
722 // DisableSelectionChoice: Disable a choice within a selection field.
723 DisableSelectionChoice *GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDisableSelectionChoiceRequest `json:"disableSelectionChoice,omitempty"`
724 // EnableField: Enables the field.
725 EnableField *GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestEnableFieldRequest `json:"enableField,omitempty"`
726 // EnableSelectionChoice: Enable a choice within a selection field.
727 EnableSelectionChoice *GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestEnableSelectionChoiceRequest `json:"enableSelectionChoice,omitempty"`
728 // UpdateField: Updates basic properties of a field.
729 UpdateField *GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestUpdateFieldPropertiesRequest `json:"updateField,omitempty"`
730 // UpdateFieldType: Update field type and/or type options.
731 UpdateFieldType *GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestUpdateFieldTypeRequest `json:"updateFieldType,omitempty"`
732 // UpdateLabel: Updates the label properties.
733 UpdateLabel *GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestUpdateLabelPropertiesRequest `json:"updateLabel,omitempty"`
734 // UpdateSelectionChoiceProperties: Update a choice property within a selection
735 // field.
736 UpdateSelectionChoiceProperties *GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestUpdateSelectionChoicePropertiesRequest `json:"updateSelectionChoiceProperties,omitempty"`
737 // ForceSendFields is a list of field names (e.g. "CreateField") to
738 // unconditionally include in API requests. By default, fields with empty or
739 // default values are omitted from API requests. See
740 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
741 // details.
742 ForceSendFields []string `json:"-"`
743 // NullFields is a list of field names (e.g. "CreateField") to include in API
744 // requests with the JSON null value. By default, fields with empty values are
745 // omitted from API requests. See
746 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
747 NullFields []string `json:"-"`
748 }
749
750 func (s GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestRequest) MarshalJSON() ([]byte, error) {
751 type NoMethod GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestRequest
752 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
753 }
754
755 // GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestUpdateFieldPropertiesRequest:
756 // Request to update field properties.
757 type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestUpdateFieldPropertiesRequest struct {
758 // Id: Required. The field to update.
759 Id string `json:"id,omitempty"`
760 // Properties: Required. Basic field properties.
761 Properties *GoogleAppsDriveLabelsV2FieldProperties `json:"properties,omitempty"`
762 // UpdateMask: The fields that should be updated. At least one field must be
763 // specified. The root `properties` is implied and should not be specified. A
764 // single `*` can be used as a short-hand for updating every field.
765 UpdateMask string `json:"updateMask,omitempty"`
766 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
767 // include in API requests. By default, fields with empty or default values are
768 // omitted from API requests. See
769 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
770 // details.
771 ForceSendFields []string `json:"-"`
772 // NullFields is a list of field names (e.g. "Id") to include in API requests
773 // with the JSON null value. By default, fields with empty values are omitted
774 // from API requests. See
775 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
776 NullFields []string `json:"-"`
777 }
778
779 func (s GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestUpdateFieldPropertiesRequest) MarshalJSON() ([]byte, error) {
780 type NoMethod GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestUpdateFieldPropertiesRequest
781 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
782 }
783
784 // GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestUpdateFieldTypeRequest:
785 // Request to change the type of a field.
786 type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestUpdateFieldTypeRequest struct {
787 // DateOptions: Update field to Date.
788 DateOptions *GoogleAppsDriveLabelsV2FieldDateOptions `json:"dateOptions,omitempty"`
789 // Id: Required. The field to update.
790 Id string `json:"id,omitempty"`
791 // IntegerOptions: Update field to Integer.
792 IntegerOptions *GoogleAppsDriveLabelsV2FieldIntegerOptions `json:"integerOptions,omitempty"`
793 // SelectionOptions: Update field to Selection.
794 SelectionOptions *GoogleAppsDriveLabelsV2FieldSelectionOptions `json:"selectionOptions,omitempty"`
795 // TextOptions: Update field to Text.
796 TextOptions *GoogleAppsDriveLabelsV2FieldTextOptions `json:"textOptions,omitempty"`
797 // UpdateMask: The fields that should be updated. At least one field must be
798 // specified. The root of `type_options` is implied and should not be
799 // specified. A single `*` can be used as a short-hand for updating every
800 // field.
801 UpdateMask string `json:"updateMask,omitempty"`
802 // UserOptions: Update field to User.
803 UserOptions *GoogleAppsDriveLabelsV2FieldUserOptions `json:"userOptions,omitempty"`
804 // ForceSendFields is a list of field names (e.g. "DateOptions") to
805 // unconditionally include in API requests. By default, fields with empty or
806 // default values are omitted from API requests. See
807 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
808 // details.
809 ForceSendFields []string `json:"-"`
810 // NullFields is a list of field names (e.g. "DateOptions") to include in API
811 // requests with the JSON null value. By default, fields with empty values are
812 // omitted from API requests. See
813 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
814 NullFields []string `json:"-"`
815 }
816
817 func (s GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestUpdateFieldTypeRequest) MarshalJSON() ([]byte, error) {
818 type NoMethod GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestUpdateFieldTypeRequest
819 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
820 }
821
822 // GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestUpdateLabelPropertiesRequest:
823 // Updates basic properties of a label.
824 type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestUpdateLabelPropertiesRequest struct {
825 // Properties: Required. Label properties to update.
826 Properties *GoogleAppsDriveLabelsV2LabelProperties `json:"properties,omitempty"`
827 // UpdateMask: The fields that should be updated. At least one field must be
828 // specified. The root `label_properties` is implied and should not be
829 // specified. A single `*` can be used as a short-hand for updating every
830 // field.
831 UpdateMask string `json:"updateMask,omitempty"`
832 // ForceSendFields is a list of field names (e.g. "Properties") to
833 // unconditionally include in API requests. By default, fields with empty or
834 // default values are omitted from API requests. See
835 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
836 // details.
837 ForceSendFields []string `json:"-"`
838 // NullFields is a list of field names (e.g. "Properties") to include in API
839 // requests with the JSON null value. By default, fields with empty values are
840 // omitted from API requests. See
841 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
842 NullFields []string `json:"-"`
843 }
844
845 func (s GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestUpdateLabelPropertiesRequest) MarshalJSON() ([]byte, error) {
846 type NoMethod GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestUpdateLabelPropertiesRequest
847 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
848 }
849
850 // GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestUpdateSelectionChoiceProperties
851 // Request: Request to update a choice property.
852 type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestUpdateSelectionChoicePropertiesRequest struct {
853 // FieldId: Required. The selection field to update.
854 FieldId string `json:"fieldId,omitempty"`
855 // Id: Required. The choice to update.
856 Id string `json:"id,omitempty"`
857 // Properties: Required. The choice properties to update.
858 Properties *GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceProperties `json:"properties,omitempty"`
859 // UpdateMask: The fields that should be updated. At least one field must be
860 // specified. The root `properties` is implied and should not be specified. A
861 // single `*` can be used as a short-hand for updating every field.
862 UpdateMask string `json:"updateMask,omitempty"`
863 // ForceSendFields is a list of field names (e.g. "FieldId") to unconditionally
864 // include in API requests. By default, fields with empty or default values are
865 // omitted from API requests. See
866 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
867 // details.
868 ForceSendFields []string `json:"-"`
869 // NullFields is a list of field names (e.g. "FieldId") to include in API
870 // requests with the JSON null value. By default, fields with empty values are
871 // omitted from API requests. See
872 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
873 NullFields []string `json:"-"`
874 }
875
876 func (s GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestUpdateSelectionChoicePropertiesRequest) MarshalJSON() ([]byte, error) {
877 type NoMethod GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestUpdateSelectionChoicePropertiesRequest
878 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
879 }
880
881 // GoogleAppsDriveLabelsV2DeltaUpdateLabelResponse: Response for label update.
882 type GoogleAppsDriveLabelsV2DeltaUpdateLabelResponse struct {
883 // Responses: The reply of the updates. This maps 1:1 with the updates,
884 // although responses to some requests may be empty.
885 Responses []*GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseResponse `json:"responses,omitempty"`
886 // UpdatedLabel: The label after updates were applied. This is only set if
887 // `include_label_in_response` is `true` and there were no errors.
888 UpdatedLabel *GoogleAppsDriveLabelsV2Label `json:"updatedLabel,omitempty"`
889
890 // ServerResponse contains the HTTP response code and headers from the server.
891 googleapi.ServerResponse `json:"-"`
892 // ForceSendFields is a list of field names (e.g. "Responses") to
893 // unconditionally include in API requests. By default, fields with empty or
894 // default values are omitted from API requests. See
895 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
896 // details.
897 ForceSendFields []string `json:"-"`
898 // NullFields is a list of field names (e.g. "Responses") to include in API
899 // requests with the JSON null value. By default, fields with empty values are
900 // omitted from API requests. See
901 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
902 NullFields []string `json:"-"`
903 }
904
905 func (s GoogleAppsDriveLabelsV2DeltaUpdateLabelResponse) MarshalJSON() ([]byte, error) {
906 type NoMethod GoogleAppsDriveLabelsV2DeltaUpdateLabelResponse
907 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
908 }
909
910 // GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseCreateFieldResponse: Response
911 // following field create.
912 type GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseCreateFieldResponse struct {
913 // Id: The field of the created field. When left blank in a create request, a
914 // key will be autogenerated and can be identified here.
915 Id string `json:"id,omitempty"`
916 // Priority: The priority of the created field. The priority may change from
917 // what was specified to assure contiguous priorities between fields (1-n).
918 Priority int64 `json:"priority,omitempty"`
919 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
920 // include in API requests. By default, fields with empty or default values are
921 // omitted from API requests. See
922 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
923 // details.
924 ForceSendFields []string `json:"-"`
925 // NullFields is a list of field names (e.g. "Id") to include in API requests
926 // with the JSON null value. By default, fields with empty values are omitted
927 // from API requests. See
928 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
929 NullFields []string `json:"-"`
930 }
931
932 func (s GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseCreateFieldResponse) MarshalJSON() ([]byte, error) {
933 type NoMethod GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseCreateFieldResponse
934 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
935 }
936
937 // GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseCreateSelectionChoiceResponse:
938 //
939 // Response following selection choice create.
940 type GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseCreateSelectionChoiceResponse struct {
941 // FieldId: The server-generated ID of the field.
942 FieldId string `json:"fieldId,omitempty"`
943 // Id: The server-generated ID of the created choice within the field.
944 Id string `json:"id,omitempty"`
945 // ForceSendFields is a list of field names (e.g. "FieldId") to unconditionally
946 // include in API requests. By default, fields with empty or default values are
947 // omitted from API requests. See
948 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
949 // details.
950 ForceSendFields []string `json:"-"`
951 // NullFields is a list of field names (e.g. "FieldId") to include in API
952 // requests with the JSON null value. By default, fields with empty values are
953 // omitted from API requests. See
954 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
955 NullFields []string `json:"-"`
956 }
957
958 func (s GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseCreateSelectionChoiceResponse) MarshalJSON() ([]byte, error) {
959 type NoMethod GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseCreateSelectionChoiceResponse
960 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
961 }
962
963 // GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseDeleteFieldResponse: Response
964 // following field delete.
965 type GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseDeleteFieldResponse struct {
966 }
967
968 // GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseDeleteSelectionChoiceResponse:
969 //
970 // Response following choice delete.
971 type GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseDeleteSelectionChoiceResponse struct {
972 }
973
974 // GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseDisableFieldResponse:
975 // Response following field disable.
976 type GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseDisableFieldResponse struct {
977 }
978
979 // GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseDisableSelectionChoiceResponse
980 // : Response following choice disable.
981 type GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseDisableSelectionChoiceResponse struct {
982 }
983
984 // GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseEnableFieldResponse: Response
985 // following field enable.
986 type GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseEnableFieldResponse struct {
987 }
988
989 // GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseEnableSelectionChoiceResponse:
990 //
991 // Response following choice enable.
992 type GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseEnableSelectionChoiceResponse struct {
993 }
994
995 // GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseResponse: A single response
996 // from an update.
997 type GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseResponse struct {
998 // CreateField: Creates a field.
999 CreateField *GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseCreateFieldResponse `json:"createField,omitempty"`
1000 // CreateSelectionChoice: Creates a selection list option to add to a selection
1001 // field.
1002 CreateSelectionChoice *GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseCreateSelectionChoiceResponse `json:"createSelectionChoice,omitempty"`
1003 // DeleteField: Deletes a field from the label.
1004 DeleteField *GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseDeleteFieldResponse `json:"deleteField,omitempty"`
1005 // DeleteSelectionChoice: Deletes a choice from a selection field.
1006 DeleteSelectionChoice *GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseDeleteSelectionChoiceResponse `json:"deleteSelectionChoice,omitempty"`
1007 // DisableField: Disables field.
1008 DisableField *GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseDisableFieldResponse `json:"disableField,omitempty"`
1009 // DisableSelectionChoice: Disables a choice within a selection field.
1010 DisableSelectionChoice *GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseDisableSelectionChoiceResponse `json:"disableSelectionChoice,omitempty"`
1011 // EnableField: Enables field.
1012 EnableField *GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseEnableFieldResponse `json:"enableField,omitempty"`
1013 // EnableSelectionChoice: Enables a choice within a selection field.
1014 EnableSelectionChoice *GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseEnableSelectionChoiceResponse `json:"enableSelectionChoice,omitempty"`
1015 // UpdateField: Updates basic properties of a field.
1016 UpdateField *GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseUpdateFieldPropertiesResponse `json:"updateField,omitempty"`
1017 // UpdateFieldType: Updates field type and/or type options.
1018 UpdateFieldType *GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseUpdateFieldTypeResponse `json:"updateFieldType,omitempty"`
1019 // UpdateLabel: Updates basic properties of a label.
1020 UpdateLabel *GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseUpdateLabelPropertiesResponse `json:"updateLabel,omitempty"`
1021 // UpdateSelectionChoiceProperties: Updates a choice within a selection field.
1022 UpdateSelectionChoiceProperties *GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseUpdateSelectionChoicePropertiesResponse `json:"updateSelectionChoiceProperties,omitempty"`
1023 // ForceSendFields is a list of field names (e.g. "CreateField") to
1024 // unconditionally include in API requests. By default, fields with empty or
1025 // default values are omitted from API requests. See
1026 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1027 // details.
1028 ForceSendFields []string `json:"-"`
1029 // NullFields is a list of field names (e.g. "CreateField") to include in API
1030 // requests with the JSON null value. By default, fields with empty values are
1031 // omitted from API requests. See
1032 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1033 NullFields []string `json:"-"`
1034 }
1035
1036 func (s GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseResponse) MarshalJSON() ([]byte, error) {
1037 type NoMethod GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseResponse
1038 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1039 }
1040
1041 // GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseUpdateFieldPropertiesResponse:
1042 //
1043 // Response following update to field properties.
1044 type GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseUpdateFieldPropertiesResponse struct {
1045 // Priority: The priority of the updated field. The priority may change from
1046 // what was specified to assure contiguous priorities between fields (1-n).
1047 Priority int64 `json:"priority,omitempty"`
1048 // ForceSendFields is a list of field names (e.g. "Priority") to
1049 // unconditionally include in API requests. By default, fields with empty or
1050 // default values are omitted from API requests. See
1051 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1052 // details.
1053 ForceSendFields []string `json:"-"`
1054 // NullFields is a list of field names (e.g. "Priority") to include in API
1055 // requests with the JSON null value. By default, fields with empty values are
1056 // omitted from API requests. See
1057 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1058 NullFields []string `json:"-"`
1059 }
1060
1061 func (s GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseUpdateFieldPropertiesResponse) MarshalJSON() ([]byte, error) {
1062 type NoMethod GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseUpdateFieldPropertiesResponse
1063 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1064 }
1065
1066 // GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseUpdateFieldTypeResponse:
1067 // Response following update to field type.
1068 type GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseUpdateFieldTypeResponse struct {
1069 }
1070
1071 // GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseUpdateLabelPropertiesResponse:
1072 //
1073 // Response following update to label properties.
1074 type GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseUpdateLabelPropertiesResponse struct {
1075 }
1076
1077 // GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseUpdateSelectionChoicePropertie
1078 // sResponse: Response following update to selection choice properties.
1079 type GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseUpdateSelectionChoicePropertiesResponse struct {
1080 // Priority: The priority of the updated choice. The priority may change from
1081 // what was specified to assure contiguous priorities between choices (1-n).
1082 Priority int64 `json:"priority,omitempty"`
1083 // ForceSendFields is a list of field names (e.g. "Priority") to
1084 // unconditionally include in API requests. By default, fields with empty or
1085 // default values are omitted from API requests. See
1086 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1087 // details.
1088 ForceSendFields []string `json:"-"`
1089 // NullFields is a list of field names (e.g. "Priority") to include in API
1090 // requests with the JSON null value. By default, fields with empty values are
1091 // omitted from API requests. See
1092 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1093 NullFields []string `json:"-"`
1094 }
1095
1096 func (s GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseUpdateSelectionChoicePropertiesResponse) MarshalJSON() ([]byte, error) {
1097 type NoMethod GoogleAppsDriveLabelsV2DeltaUpdateLabelResponseUpdateSelectionChoicePropertiesResponse
1098 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1099 }
1100
1101 // GoogleAppsDriveLabelsV2DisableLabelRequest: Request to deprecate a published
1102 // label.
1103 type GoogleAppsDriveLabelsV2DisableLabelRequest struct {
1104 // DisabledPolicy: Disabled policy to use.
1105 DisabledPolicy *GoogleAppsDriveLabelsV2LifecycleDisabledPolicy `json:"disabledPolicy,omitempty"`
1106 // LanguageCode: The BCP-47 language code to use for evaluating localized field
1107 // labels. When not specified, values in the default configured language will
1108 // be used.
1109 LanguageCode string `json:"languageCode,omitempty"`
1110 // UpdateMask: The fields that should be updated. At least one field must be
1111 // specified. The root `disabled_policy` is implied and should not be
1112 // specified. A single `*` can be used as a short-hand for updating every
1113 // field.
1114 UpdateMask string `json:"updateMask,omitempty"`
1115 // UseAdminAccess: Set to `true` in order to use the user's admin credentials.
1116 // The server will verify the user is an admin for the label before allowing
1117 // access.
1118 UseAdminAccess bool `json:"useAdminAccess,omitempty"`
1119 // WriteControl: Provides control over how write requests are executed.
1120 // Defaults to unset, which means the last write wins.
1121 WriteControl *GoogleAppsDriveLabelsV2WriteControl `json:"writeControl,omitempty"`
1122 // ForceSendFields is a list of field names (e.g. "DisabledPolicy") to
1123 // unconditionally include in API requests. By default, fields with empty or
1124 // default values are omitted from API requests. See
1125 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1126 // details.
1127 ForceSendFields []string `json:"-"`
1128 // NullFields is a list of field names (e.g. "DisabledPolicy") to include in
1129 // API requests with the JSON null value. By default, fields with empty values
1130 // are omitted from API requests. See
1131 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1132 NullFields []string `json:"-"`
1133 }
1134
1135 func (s GoogleAppsDriveLabelsV2DisableLabelRequest) MarshalJSON() ([]byte, error) {
1136 type NoMethod GoogleAppsDriveLabelsV2DisableLabelRequest
1137 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1138 }
1139
1140 // GoogleAppsDriveLabelsV2EnableLabelRequest: Request to enable a label.
1141 type GoogleAppsDriveLabelsV2EnableLabelRequest struct {
1142 // LanguageCode: The BCP-47 language code to use for evaluating localized field
1143 // labels. When not specified, values in the default configured language will
1144 // be used.
1145 LanguageCode string `json:"languageCode,omitempty"`
1146 // UseAdminAccess: Set to `true` in order to use the user's admin credentials.
1147 // The server will verify the user is an admin for the label before allowing
1148 // access.
1149 UseAdminAccess bool `json:"useAdminAccess,omitempty"`
1150 // WriteControl: Provides control over how write requests are executed.
1151 // Defaults to unset, which means the last write wins.
1152 WriteControl *GoogleAppsDriveLabelsV2WriteControl `json:"writeControl,omitempty"`
1153 // ForceSendFields is a list of field names (e.g. "LanguageCode") to
1154 // unconditionally include in API requests. By default, fields with empty or
1155 // default values are omitted from API requests. See
1156 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1157 // details.
1158 ForceSendFields []string `json:"-"`
1159 // NullFields is a list of field names (e.g. "LanguageCode") to include in API
1160 // requests with the JSON null value. By default, fields with empty values are
1161 // omitted from API requests. See
1162 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1163 NullFields []string `json:"-"`
1164 }
1165
1166 func (s GoogleAppsDriveLabelsV2EnableLabelRequest) MarshalJSON() ([]byte, error) {
1167 type NoMethod GoogleAppsDriveLabelsV2EnableLabelRequest
1168 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1169 }
1170
1171 // GoogleAppsDriveLabelsV2Field: Defines a field that has a display name, data
1172 // type, and other configuration options. This field defines the kind of
1173 // metadata that may be set on a Drive item.
1174 type GoogleAppsDriveLabelsV2Field struct {
1175 // AppliedCapabilities: Output only. The capabilities this user has on this
1176 // field and its value when the label is applied on Drive items.
1177 AppliedCapabilities *GoogleAppsDriveLabelsV2FieldAppliedCapabilities `json:"appliedCapabilities,omitempty"`
1178 // CreateTime: Output only. The time this field was created.
1179 CreateTime string `json:"createTime,omitempty"`
1180 // Creator: Output only. The user who created this field.
1181 Creator *GoogleAppsDriveLabelsV2UserInfo `json:"creator,omitempty"`
1182 // DateOptions: Date field options.
1183 DateOptions *GoogleAppsDriveLabelsV2FieldDateOptions `json:"dateOptions,omitempty"`
1184 // DisableTime: Output only. The time this field was disabled. This value has
1185 // no meaning when the field is not disabled.
1186 DisableTime string `json:"disableTime,omitempty"`
1187 // Disabler: Output only. The user who disabled this field. This value has no
1188 // meaning when the field is not disabled.
1189 Disabler *GoogleAppsDriveLabelsV2UserInfo `json:"disabler,omitempty"`
1190 // DisplayHints: Output only. UI display hints for rendering a field.
1191 DisplayHints *GoogleAppsDriveLabelsV2FieldDisplayHints `json:"displayHints,omitempty"`
1192 // Id: Output only. The key of a field, unique within a label or library. This
1193 // value is autogenerated. Matches the regex: `([a-zA-Z0-9])+`.
1194 Id string `json:"id,omitempty"`
1195 // IntegerOptions: Integer field options.
1196 IntegerOptions *GoogleAppsDriveLabelsV2FieldIntegerOptions `json:"integerOptions,omitempty"`
1197 // Lifecycle: Output only. The lifecycle of this field.
1198 Lifecycle *GoogleAppsDriveLabelsV2Lifecycle `json:"lifecycle,omitempty"`
1199 // LockStatus: Output only. The `LockStatus` of this field.
1200 LockStatus *GoogleAppsDriveLabelsV2LockStatus `json:"lockStatus,omitempty"`
1201 // Properties: The basic properties of the field.
1202 Properties *GoogleAppsDriveLabelsV2FieldProperties `json:"properties,omitempty"`
1203 // Publisher: Output only. The user who published this field. This value has no
1204 // meaning when the field is not published.
1205 Publisher *GoogleAppsDriveLabelsV2UserInfo `json:"publisher,omitempty"`
1206 // QueryKey: Output only. The key to use when constructing Drive search queries
1207 // to find files based on values defined for this field on files. For example,
1208 // "{query_key}` > 2001-01-01".
1209 QueryKey string `json:"queryKey,omitempty"`
1210 // SchemaCapabilities: Output only. The capabilities this user has when editing
1211 // this field.
1212 SchemaCapabilities *GoogleAppsDriveLabelsV2FieldSchemaCapabilities `json:"schemaCapabilities,omitempty"`
1213 // SelectionOptions: Selection field options.
1214 SelectionOptions *GoogleAppsDriveLabelsV2FieldSelectionOptions `json:"selectionOptions,omitempty"`
1215 // TextOptions: Text field options.
1216 TextOptions *GoogleAppsDriveLabelsV2FieldTextOptions `json:"textOptions,omitempty"`
1217 // UpdateTime: Output only. The time this field was updated.
1218 UpdateTime string `json:"updateTime,omitempty"`
1219 // Updater: Output only. The user who modified this field.
1220 Updater *GoogleAppsDriveLabelsV2UserInfo `json:"updater,omitempty"`
1221 // UserOptions: User field options.
1222 UserOptions *GoogleAppsDriveLabelsV2FieldUserOptions `json:"userOptions,omitempty"`
1223 // ForceSendFields is a list of field names (e.g. "AppliedCapabilities") to
1224 // unconditionally include in API requests. By default, fields with empty or
1225 // default values are omitted from API requests. See
1226 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1227 // details.
1228 ForceSendFields []string `json:"-"`
1229 // NullFields is a list of field names (e.g. "AppliedCapabilities") to include
1230 // in API requests with the JSON null value. By default, fields with empty
1231 // values are omitted from API requests. See
1232 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1233 NullFields []string `json:"-"`
1234 }
1235
1236 func (s GoogleAppsDriveLabelsV2Field) MarshalJSON() ([]byte, error) {
1237 type NoMethod GoogleAppsDriveLabelsV2Field
1238 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1239 }
1240
1241 // GoogleAppsDriveLabelsV2FieldAppliedCapabilities: The capabilities related to
1242 // this field on applied metadata.
1243 type GoogleAppsDriveLabelsV2FieldAppliedCapabilities struct {
1244 // CanRead: Whether the user can read related applied metadata on items.
1245 CanRead bool `json:"canRead,omitempty"`
1246 // CanSearch: Whether the user can search for Drive items referencing this
1247 // field.
1248 CanSearch bool `json:"canSearch,omitempty"`
1249 // CanWrite: Whether the user can set this field on Drive items.
1250 CanWrite bool `json:"canWrite,omitempty"`
1251 // ForceSendFields is a list of field names (e.g. "CanRead") to unconditionally
1252 // include in API requests. By default, fields with empty or default values are
1253 // omitted from API requests. See
1254 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1255 // details.
1256 ForceSendFields []string `json:"-"`
1257 // NullFields is a list of field names (e.g. "CanRead") to include in API
1258 // requests with the JSON null value. By default, fields with empty values are
1259 // omitted from API requests. See
1260 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1261 NullFields []string `json:"-"`
1262 }
1263
1264 func (s GoogleAppsDriveLabelsV2FieldAppliedCapabilities) MarshalJSON() ([]byte, error) {
1265 type NoMethod GoogleAppsDriveLabelsV2FieldAppliedCapabilities
1266 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1267 }
1268
1269 // GoogleAppsDriveLabelsV2FieldDateOptions: Options for the date field type.
1270 type GoogleAppsDriveLabelsV2FieldDateOptions struct {
1271 // DateFormat: Output only. ICU date format.
1272 DateFormat string `json:"dateFormat,omitempty"`
1273 // DateFormatType: Localized date formatting option. Field values are rendered
1274 // in this format according to their locale.
1275 //
1276 // Possible values:
1277 // "DATE_FORMAT_UNSPECIFIED" - Date format unspecified.
1278 // "LONG_DATE" - Includes full month name. For example, January 12, 1999
1279 // (MMMM d, y)
1280 // "SHORT_DATE" - Short, numeric, representation. For example, 12/13/99
1281 // (M/d/yy)
1282 DateFormatType string `json:"dateFormatType,omitempty"`
1283 // MaxValue: Output only. Maximum valid value (year, month, day).
1284 MaxValue *GoogleTypeDate `json:"maxValue,omitempty"`
1285 // MinValue: Output only. Minimum valid value (year, month, day).
1286 MinValue *GoogleTypeDate `json:"minValue,omitempty"`
1287 // ForceSendFields is a list of field names (e.g. "DateFormat") to
1288 // unconditionally include in API requests. By default, fields with empty or
1289 // default values are omitted from API requests. See
1290 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1291 // details.
1292 ForceSendFields []string `json:"-"`
1293 // NullFields is a list of field names (e.g. "DateFormat") to include in API
1294 // requests with the JSON null value. By default, fields with empty values are
1295 // omitted from API requests. See
1296 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1297 NullFields []string `json:"-"`
1298 }
1299
1300 func (s GoogleAppsDriveLabelsV2FieldDateOptions) MarshalJSON() ([]byte, error) {
1301 type NoMethod GoogleAppsDriveLabelsV2FieldDateOptions
1302 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1303 }
1304
1305 // GoogleAppsDriveLabelsV2FieldDisplayHints: UI display hints for rendering a
1306 // field.
1307 type GoogleAppsDriveLabelsV2FieldDisplayHints struct {
1308 // Disabled: Whether the field should be shown in the UI as disabled.
1309 Disabled bool `json:"disabled,omitempty"`
1310 // HiddenInSearch: This field should be hidden in the search menu when
1311 // searching for Drive items.
1312 HiddenInSearch bool `json:"hiddenInSearch,omitempty"`
1313 // Required: Whether the field should be shown as required in the UI.
1314 Required bool `json:"required,omitempty"`
1315 // ShownInApply: This field should be shown in the apply menu when applying
1316 // values to a Drive item.
1317 ShownInApply bool `json:"shownInApply,omitempty"`
1318 // ForceSendFields is a list of field names (e.g. "Disabled") to
1319 // unconditionally include in API requests. By default, fields with empty or
1320 // default values are omitted from API requests. See
1321 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1322 // details.
1323 ForceSendFields []string `json:"-"`
1324 // NullFields is a list of field names (e.g. "Disabled") to include in API
1325 // requests with the JSON null value. By default, fields with empty values are
1326 // omitted from API requests. See
1327 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1328 NullFields []string `json:"-"`
1329 }
1330
1331 func (s GoogleAppsDriveLabelsV2FieldDisplayHints) MarshalJSON() ([]byte, error) {
1332 type NoMethod GoogleAppsDriveLabelsV2FieldDisplayHints
1333 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1334 }
1335
1336 // GoogleAppsDriveLabelsV2FieldIntegerOptions: Options for the Integer field
1337 // type.
1338 type GoogleAppsDriveLabelsV2FieldIntegerOptions struct {
1339 // MaxValue: Output only. The maximum valid value for the integer field.
1340 MaxValue int64 `json:"maxValue,omitempty,string"`
1341 // MinValue: Output only. The minimum valid value for the integer field.
1342 MinValue int64 `json:"minValue,omitempty,string"`
1343 // ForceSendFields is a list of field names (e.g. "MaxValue") to
1344 // unconditionally include in API requests. By default, fields with empty or
1345 // default values are omitted from API requests. See
1346 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1347 // details.
1348 ForceSendFields []string `json:"-"`
1349 // NullFields is a list of field names (e.g. "MaxValue") to include in API
1350 // requests with the JSON null value. By default, fields with empty values are
1351 // omitted from API requests. See
1352 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1353 NullFields []string `json:"-"`
1354 }
1355
1356 func (s GoogleAppsDriveLabelsV2FieldIntegerOptions) MarshalJSON() ([]byte, error) {
1357 type NoMethod GoogleAppsDriveLabelsV2FieldIntegerOptions
1358 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1359 }
1360
1361 // GoogleAppsDriveLabelsV2FieldLimits: Field constants governing the structure
1362 // of a field; such as, the maximum title length, minimum and maximum field
1363 // values or length, etc.
1364 type GoogleAppsDriveLabelsV2FieldLimits struct {
1365 // DateLimits: Date field limits.
1366 DateLimits *GoogleAppsDriveLabelsV2DateLimits `json:"dateLimits,omitempty"`
1367 // IntegerLimits: Integer field limits.
1368 IntegerLimits *GoogleAppsDriveLabelsV2IntegerLimits `json:"integerLimits,omitempty"`
1369 // LongTextLimits: Long text field limits.
1370 LongTextLimits *GoogleAppsDriveLabelsV2LongTextLimits `json:"longTextLimits,omitempty"`
1371 // MaxDescriptionLength: Limits for field description, also called help text.
1372 MaxDescriptionLength int64 `json:"maxDescriptionLength,omitempty"`
1373 // MaxDisplayNameLength: Limits for field title.
1374 MaxDisplayNameLength int64 `json:"maxDisplayNameLength,omitempty"`
1375 // MaxIdLength: Maximum length for the id.
1376 MaxIdLength int64 `json:"maxIdLength,omitempty"`
1377 // SelectionLimits: Selection field limits.
1378 SelectionLimits *GoogleAppsDriveLabelsV2SelectionLimits `json:"selectionLimits,omitempty"`
1379 // TextLimits: The relevant limits for the specified Field.Type. Text field
1380 // limits.
1381 TextLimits *GoogleAppsDriveLabelsV2TextLimits `json:"textLimits,omitempty"`
1382 // UserLimits: User field limits.
1383 UserLimits *GoogleAppsDriveLabelsV2UserLimits `json:"userLimits,omitempty"`
1384 // ForceSendFields is a list of field names (e.g. "DateLimits") to
1385 // unconditionally include in API requests. By default, fields with empty or
1386 // default values are omitted from API requests. See
1387 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1388 // details.
1389 ForceSendFields []string `json:"-"`
1390 // NullFields is a list of field names (e.g. "DateLimits") to include in API
1391 // requests with the JSON null value. By default, fields with empty values are
1392 // omitted from API requests. See
1393 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1394 NullFields []string `json:"-"`
1395 }
1396
1397 func (s GoogleAppsDriveLabelsV2FieldLimits) MarshalJSON() ([]byte, error) {
1398 type NoMethod GoogleAppsDriveLabelsV2FieldLimits
1399 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1400 }
1401
1402 // GoogleAppsDriveLabelsV2FieldListOptions: Options for a multi-valued variant
1403 // of an associated field type.
1404 type GoogleAppsDriveLabelsV2FieldListOptions struct {
1405 // MaxEntries: Maximum number of entries permitted.
1406 MaxEntries int64 `json:"maxEntries,omitempty"`
1407 // ForceSendFields is a list of field names (e.g. "MaxEntries") to
1408 // unconditionally include in API requests. By default, fields with empty or
1409 // default values are omitted from API requests. See
1410 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1411 // details.
1412 ForceSendFields []string `json:"-"`
1413 // NullFields is a list of field names (e.g. "MaxEntries") to include in API
1414 // requests with the JSON null value. By default, fields with empty values are
1415 // omitted from API requests. See
1416 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1417 NullFields []string `json:"-"`
1418 }
1419
1420 func (s GoogleAppsDriveLabelsV2FieldListOptions) MarshalJSON() ([]byte, error) {
1421 type NoMethod GoogleAppsDriveLabelsV2FieldListOptions
1422 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1423 }
1424
1425 // GoogleAppsDriveLabelsV2FieldProperties: The basic properties of the field.
1426 type GoogleAppsDriveLabelsV2FieldProperties struct {
1427 // DisplayName: Required. The display text to show in the UI identifying this
1428 // field.
1429 DisplayName string `json:"displayName,omitempty"`
1430 // InsertBeforeField: Input only. Insert or move this field before the
1431 // indicated field. If empty, the field is placed at the end of the list.
1432 InsertBeforeField string `json:"insertBeforeField,omitempty"`
1433 // Required: Whether the field should be marked as required.
1434 Required bool `json:"required,omitempty"`
1435 // ForceSendFields is a list of field names (e.g. "DisplayName") to
1436 // unconditionally include in API requests. By default, fields with empty or
1437 // default values are omitted from API requests. See
1438 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1439 // details.
1440 ForceSendFields []string `json:"-"`
1441 // NullFields is a list of field names (e.g. "DisplayName") to include in API
1442 // requests with the JSON null value. By default, fields with empty values are
1443 // omitted from API requests. See
1444 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1445 NullFields []string `json:"-"`
1446 }
1447
1448 func (s GoogleAppsDriveLabelsV2FieldProperties) MarshalJSON() ([]byte, error) {
1449 type NoMethod GoogleAppsDriveLabelsV2FieldProperties
1450 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1451 }
1452
1453 // GoogleAppsDriveLabelsV2FieldSchemaCapabilities: The capabilities related to
1454 // this field when editing the field.
1455 type GoogleAppsDriveLabelsV2FieldSchemaCapabilities struct {
1456 // CanDelete: Whether the user can delete this field. The user must have
1457 // permission and the field must be deprecated.
1458 CanDelete bool `json:"canDelete,omitempty"`
1459 // CanDisable: Whether the user can disable this field. The user must have
1460 // permission and this field must not already be disabled.
1461 CanDisable bool `json:"canDisable,omitempty"`
1462 // CanEnable: Whether the user can enable this field. The user must have
1463 // permission and this field must be disabled.
1464 CanEnable bool `json:"canEnable,omitempty"`
1465 // CanUpdate: Whether the user can change this field.
1466 CanUpdate bool `json:"canUpdate,omitempty"`
1467 // ForceSendFields is a list of field names (e.g. "CanDelete") to
1468 // unconditionally include in API requests. By default, fields with empty or
1469 // default values are omitted from API requests. See
1470 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1471 // details.
1472 ForceSendFields []string `json:"-"`
1473 // NullFields is a list of field names (e.g. "CanDelete") to include in API
1474 // requests with the JSON null value. By default, fields with empty values are
1475 // omitted from API requests. See
1476 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1477 NullFields []string `json:"-"`
1478 }
1479
1480 func (s GoogleAppsDriveLabelsV2FieldSchemaCapabilities) MarshalJSON() ([]byte, error) {
1481 type NoMethod GoogleAppsDriveLabelsV2FieldSchemaCapabilities
1482 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1483 }
1484
1485 // GoogleAppsDriveLabelsV2FieldSelectionOptions: Options for the selection
1486 // field type.
1487 type GoogleAppsDriveLabelsV2FieldSelectionOptions struct {
1488 // Choices: The options available for this selection field. The list order is
1489 // consistent, and modified with `insert_before_choice`.
1490 Choices []*GoogleAppsDriveLabelsV2FieldSelectionOptionsChoice `json:"choices,omitempty"`
1491 // ListOptions: When specified, indicates this field supports a list of values.
1492 // Once the field is published, this cannot be changed.
1493 ListOptions *GoogleAppsDriveLabelsV2FieldListOptions `json:"listOptions,omitempty"`
1494 // ForceSendFields is a list of field names (e.g. "Choices") to unconditionally
1495 // include in API requests. By default, fields with empty or default values are
1496 // omitted from API requests. See
1497 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1498 // details.
1499 ForceSendFields []string `json:"-"`
1500 // NullFields is a list of field names (e.g. "Choices") to include in API
1501 // requests with the JSON null value. By default, fields with empty values are
1502 // omitted from API requests. See
1503 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1504 NullFields []string `json:"-"`
1505 }
1506
1507 func (s GoogleAppsDriveLabelsV2FieldSelectionOptions) MarshalJSON() ([]byte, error) {
1508 type NoMethod GoogleAppsDriveLabelsV2FieldSelectionOptions
1509 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1510 }
1511
1512 // GoogleAppsDriveLabelsV2FieldSelectionOptionsChoice: Selection field choice.
1513 type GoogleAppsDriveLabelsV2FieldSelectionOptionsChoice struct {
1514 // AppliedCapabilities: Output only. The capabilities related to this choice on
1515 // applied metadata.
1516 AppliedCapabilities *GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceAppliedCapabilities `json:"appliedCapabilities,omitempty"`
1517 // CreateTime: Output only. The time this choice was created.
1518 CreateTime string `json:"createTime,omitempty"`
1519 // Creator: Output only. The user who created this choice.
1520 Creator *GoogleAppsDriveLabelsV2UserInfo `json:"creator,omitempty"`
1521 // DisableTime: Output only. The time this choice was disabled. This value has
1522 // no meaning when the choice is not disabled.
1523 DisableTime string `json:"disableTime,omitempty"`
1524 // Disabler: Output only. The user who disabled this choice. This value has no
1525 // meaning when the option is not disabled.
1526 Disabler *GoogleAppsDriveLabelsV2UserInfo `json:"disabler,omitempty"`
1527 // DisplayHints: Output only. UI display hints for rendering a choice.
1528 DisplayHints *GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceDisplayHints `json:"displayHints,omitempty"`
1529 // Id: The unique value of the choice. This ID is autogenerated. Matches the
1530 // regex: `([a-zA-Z0-9_])+`.
1531 Id string `json:"id,omitempty"`
1532 // Lifecycle: Output only. Lifecycle of the choice.
1533 Lifecycle *GoogleAppsDriveLabelsV2Lifecycle `json:"lifecycle,omitempty"`
1534 // LockStatus: Output only. The `LockStatus` of this choice.
1535 LockStatus *GoogleAppsDriveLabelsV2LockStatus `json:"lockStatus,omitempty"`
1536 // Properties: Basic properties of the choice.
1537 Properties *GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceProperties `json:"properties,omitempty"`
1538 // PublishTime: Output only. The time this choice was published. This value has
1539 // no meaning when the choice is not published.
1540 PublishTime string `json:"publishTime,omitempty"`
1541 // Publisher: Output only. The user who published this choice. This value has
1542 // no meaning when the choice is not published.
1543 Publisher *GoogleAppsDriveLabelsV2UserInfo `json:"publisher,omitempty"`
1544 // SchemaCapabilities: Output only. The capabilities related to this option
1545 // when editing the option.
1546 SchemaCapabilities *GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceSchemaCapabilities `json:"schemaCapabilities,omitempty"`
1547 // UpdateTime: Output only. The time this choice was updated last.
1548 UpdateTime string `json:"updateTime,omitempty"`
1549 // Updater: Output only. The user who updated this choice last.
1550 Updater *GoogleAppsDriveLabelsV2UserInfo `json:"updater,omitempty"`
1551 // ForceSendFields is a list of field names (e.g. "AppliedCapabilities") to
1552 // unconditionally include in API requests. By default, fields with empty or
1553 // default values are omitted from API requests. See
1554 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1555 // details.
1556 ForceSendFields []string `json:"-"`
1557 // NullFields is a list of field names (e.g. "AppliedCapabilities") to include
1558 // in API requests with the JSON null value. By default, fields with empty
1559 // values are omitted from API requests. See
1560 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1561 NullFields []string `json:"-"`
1562 }
1563
1564 func (s GoogleAppsDriveLabelsV2FieldSelectionOptionsChoice) MarshalJSON() ([]byte, error) {
1565 type NoMethod GoogleAppsDriveLabelsV2FieldSelectionOptionsChoice
1566 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1567 }
1568
1569 // GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceAppliedCapabilities: The
1570 // capabilities related to this choice on applied metadata.
1571 type GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceAppliedCapabilities struct {
1572 // CanRead: Whether the user can read related applied metadata on items.
1573 CanRead bool `json:"canRead,omitempty"`
1574 // CanSearch: Whether the user can use this choice in search queries.
1575 CanSearch bool `json:"canSearch,omitempty"`
1576 // CanSelect: Whether the user can select this choice on an item.
1577 CanSelect bool `json:"canSelect,omitempty"`
1578 // ForceSendFields is a list of field names (e.g. "CanRead") to unconditionally
1579 // include in API requests. By default, fields with empty or default values are
1580 // omitted from API requests. See
1581 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1582 // details.
1583 ForceSendFields []string `json:"-"`
1584 // NullFields is a list of field names (e.g. "CanRead") to include in API
1585 // requests with the JSON null value. By default, fields with empty values are
1586 // omitted from API requests. See
1587 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1588 NullFields []string `json:"-"`
1589 }
1590
1591 func (s GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceAppliedCapabilities) MarshalJSON() ([]byte, error) {
1592 type NoMethod GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceAppliedCapabilities
1593 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1594 }
1595
1596 // GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceDisplayHints: UI display
1597 // hints for rendering an option.
1598 type GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceDisplayHints struct {
1599 // BadgeColors: The colors to use for the badge. Changed to Google Material
1600 // colors based on the chosen `properties.badge_config.color`.
1601 BadgeColors *GoogleAppsDriveLabelsV2BadgeColors `json:"badgeColors,omitempty"`
1602 // BadgePriority: The priority of this badge. Used to compare and sort between
1603 // multiple badges. A lower number means the badge should be shown first. When
1604 // a badging configuration is not present, this will be 0. Otherwise, this will
1605 // be set to `BadgeConfig.priority_override` or the default heuristic which
1606 // prefers creation date of the label, and field and option priority.
1607 BadgePriority int64 `json:"badgePriority,omitempty,string"`
1608 // DarkBadgeColors: The dark-mode color to use for the badge. Changed to Google
1609 // Material colors based on the chosen `properties.badge_config.color`.
1610 DarkBadgeColors *GoogleAppsDriveLabelsV2BadgeColors `json:"darkBadgeColors,omitempty"`
1611 // Disabled: Whether the option should be shown in the UI as disabled.
1612 Disabled bool `json:"disabled,omitempty"`
1613 // HiddenInSearch: This option should be hidden in the search menu when
1614 // searching for Drive items.
1615 HiddenInSearch bool `json:"hiddenInSearch,omitempty"`
1616 // ShownInApply: This option should be shown in the apply menu when applying
1617 // values to a Drive item.
1618 ShownInApply bool `json:"shownInApply,omitempty"`
1619 // ForceSendFields is a list of field names (e.g. "BadgeColors") to
1620 // unconditionally include in API requests. By default, fields with empty or
1621 // default values are omitted from API requests. See
1622 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1623 // details.
1624 ForceSendFields []string `json:"-"`
1625 // NullFields is a list of field names (e.g. "BadgeColors") to include in API
1626 // requests with the JSON null value. By default, fields with empty values are
1627 // omitted from API requests. See
1628 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1629 NullFields []string `json:"-"`
1630 }
1631
1632 func (s GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceDisplayHints) MarshalJSON() ([]byte, error) {
1633 type NoMethod GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceDisplayHints
1634 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1635 }
1636
1637 // GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceProperties: Basic
1638 // properties of the choice.
1639 type GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceProperties struct {
1640 // BadgeConfig: The badge configuration for this choice. When set, the label
1641 // that owns this choice is considered a "badged label".
1642 BadgeConfig *GoogleAppsDriveLabelsV2BadgeConfig `json:"badgeConfig,omitempty"`
1643 // Description: The description of this label.
1644 Description string `json:"description,omitempty"`
1645 // DisplayName: Required. The display text to show in the UI identifying this
1646 // field.
1647 DisplayName string `json:"displayName,omitempty"`
1648 // InsertBeforeChoice: Input only. Insert or move this choice before the
1649 // indicated choice. If empty, the choice is placed at the end of the list.
1650 InsertBeforeChoice string `json:"insertBeforeChoice,omitempty"`
1651 // ForceSendFields is a list of field names (e.g. "BadgeConfig") to
1652 // unconditionally include in API requests. By default, fields with empty or
1653 // default values are omitted from API requests. See
1654 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1655 // details.
1656 ForceSendFields []string `json:"-"`
1657 // NullFields is a list of field names (e.g. "BadgeConfig") to include in API
1658 // requests with the JSON null value. By default, fields with empty values are
1659 // omitted from API requests. See
1660 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1661 NullFields []string `json:"-"`
1662 }
1663
1664 func (s GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceProperties) MarshalJSON() ([]byte, error) {
1665 type NoMethod GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceProperties
1666 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1667 }
1668
1669 // GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceSchemaCapabilities: The
1670 // capabilities related to this choice when editing the choice.
1671 type GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceSchemaCapabilities struct {
1672 // CanDelete: Whether the user can delete this choice.
1673 CanDelete bool `json:"canDelete,omitempty"`
1674 // CanDisable: Whether the user can disable this choice.
1675 CanDisable bool `json:"canDisable,omitempty"`
1676 // CanEnable: Whether the user can enable this choice.
1677 CanEnable bool `json:"canEnable,omitempty"`
1678 // CanUpdate: Whether the user can update this choice.
1679 CanUpdate bool `json:"canUpdate,omitempty"`
1680 // ForceSendFields is a list of field names (e.g. "CanDelete") to
1681 // unconditionally include in API requests. By default, fields with empty or
1682 // default values are omitted from API requests. See
1683 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1684 // details.
1685 ForceSendFields []string `json:"-"`
1686 // NullFields is a list of field names (e.g. "CanDelete") to include in API
1687 // requests with the JSON null value. By default, fields with empty values are
1688 // omitted from API requests. See
1689 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1690 NullFields []string `json:"-"`
1691 }
1692
1693 func (s GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceSchemaCapabilities) MarshalJSON() ([]byte, error) {
1694 type NoMethod GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceSchemaCapabilities
1695 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1696 }
1697
1698 // GoogleAppsDriveLabelsV2FieldTextOptions: Options for the Text field type.
1699 type GoogleAppsDriveLabelsV2FieldTextOptions struct {
1700 // MaxLength: Output only. The maximum valid length of values for the text
1701 // field.
1702 MaxLength int64 `json:"maxLength,omitempty"`
1703 // MinLength: Output only. The minimum valid length of values for the text
1704 // field.
1705 MinLength int64 `json:"minLength,omitempty"`
1706 // ForceSendFields is a list of field names (e.g. "MaxLength") to
1707 // unconditionally include in API requests. By default, fields with empty or
1708 // default values are omitted from API requests. See
1709 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1710 // details.
1711 ForceSendFields []string `json:"-"`
1712 // NullFields is a list of field names (e.g. "MaxLength") to include in API
1713 // requests with the JSON null value. By default, fields with empty values are
1714 // omitted from API requests. See
1715 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1716 NullFields []string `json:"-"`
1717 }
1718
1719 func (s GoogleAppsDriveLabelsV2FieldTextOptions) MarshalJSON() ([]byte, error) {
1720 type NoMethod GoogleAppsDriveLabelsV2FieldTextOptions
1721 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1722 }
1723
1724 // GoogleAppsDriveLabelsV2FieldUserOptions: Options for the user field type.
1725 type GoogleAppsDriveLabelsV2FieldUserOptions struct {
1726 // ListOptions: When specified, indicates that this field supports a list of
1727 // values. Once the field is published, this cannot be changed.
1728 ListOptions *GoogleAppsDriveLabelsV2FieldListOptions `json:"listOptions,omitempty"`
1729 // ForceSendFields is a list of field names (e.g. "ListOptions") to
1730 // unconditionally include in API requests. By default, fields with empty or
1731 // default values are omitted from API requests. See
1732 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1733 // details.
1734 ForceSendFields []string `json:"-"`
1735 // NullFields is a list of field names (e.g. "ListOptions") to include in API
1736 // requests with the JSON null value. By default, fields with empty values are
1737 // omitted from API requests. See
1738 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1739 NullFields []string `json:"-"`
1740 }
1741
1742 func (s GoogleAppsDriveLabelsV2FieldUserOptions) MarshalJSON() ([]byte, error) {
1743 type NoMethod GoogleAppsDriveLabelsV2FieldUserOptions
1744 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1745 }
1746
1747 // GoogleAppsDriveLabelsV2IntegerLimits: Limits for integer field type.
1748 type GoogleAppsDriveLabelsV2IntegerLimits struct {
1749 // MaxValue: Maximum value for an integer field type.
1750 MaxValue int64 `json:"maxValue,omitempty,string"`
1751 // MinValue: Minimum value for an integer field type.
1752 MinValue int64 `json:"minValue,omitempty,string"`
1753 // ForceSendFields is a list of field names (e.g. "MaxValue") to
1754 // unconditionally include in API requests. By default, fields with empty or
1755 // default values are omitted from API requests. See
1756 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1757 // details.
1758 ForceSendFields []string `json:"-"`
1759 // NullFields is a list of field names (e.g. "MaxValue") to include in API
1760 // requests with the JSON null value. By default, fields with empty values are
1761 // omitted from API requests. See
1762 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1763 NullFields []string `json:"-"`
1764 }
1765
1766 func (s GoogleAppsDriveLabelsV2IntegerLimits) MarshalJSON() ([]byte, error) {
1767 type NoMethod GoogleAppsDriveLabelsV2IntegerLimits
1768 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1769 }
1770
1771 // GoogleAppsDriveLabelsV2Label: A label defines a taxonomy that can be applied
1772 // to Drive items in order to organize and search across items. Labels can be
1773 // simple strings, or can contain fields that describe additional metadata that
1774 // can be further used to organize and search Drive items.
1775 type GoogleAppsDriveLabelsV2Label struct {
1776 // AppliedCapabilities: Output only. The capabilities related to this label on
1777 // applied metadata.
1778 AppliedCapabilities *GoogleAppsDriveLabelsV2LabelAppliedCapabilities `json:"appliedCapabilities,omitempty"`
1779 // AppliedLabelPolicy: Output only. Behavior of this label when it's applied to
1780 // Drive items.
1781 AppliedLabelPolicy *GoogleAppsDriveLabelsV2LabelAppliedLabelPolicy `json:"appliedLabelPolicy,omitempty"`
1782 // CreateTime: Output only. The time this label was created.
1783 CreateTime string `json:"createTime,omitempty"`
1784 // Creator: Output only. The user who created this label.
1785 Creator *GoogleAppsDriveLabelsV2UserInfo `json:"creator,omitempty"`
1786 // Customer: Output only. The customer this label belongs to. For example:
1787 // `customers/123abc789`.
1788 Customer string `json:"customer,omitempty"`
1789 // DisableTime: Output only. The time this label was disabled. This value has
1790 // no meaning when the label isn't disabled.
1791 DisableTime string `json:"disableTime,omitempty"`
1792 // Disabler: Output only. The user who disabled this label. This value has no
1793 // meaning when the label isn't disabled.
1794 Disabler *GoogleAppsDriveLabelsV2UserInfo `json:"disabler,omitempty"`
1795 // DisplayHints: Output only. UI display hints for rendering the label.
1796 DisplayHints *GoogleAppsDriveLabelsV2LabelDisplayHints `json:"displayHints,omitempty"`
1797 // EnabledAppSettings: Optional. The `EnabledAppSettings` for this Label.
1798 EnabledAppSettings *GoogleAppsDriveLabelsV2LabelEnabledAppSettings `json:"enabledAppSettings,omitempty"`
1799 // Fields: List of fields in descending priority order.
1800 Fields []*GoogleAppsDriveLabelsV2Field `json:"fields,omitempty"`
1801 // Id: Output only. Globally unique identifier of this label. ID makes up part
1802 // of the label `name`, but unlike `name`, ID is consistent between revisions.
1803 // Matches the regex: `([a-zA-Z0-9])+`.
1804 Id string `json:"id,omitempty"`
1805 // LabelType: Required. The type of label.
1806 //
1807 // Possible values:
1808 // "LABEL_TYPE_UNSPECIFIED" - Unknown label type.
1809 // "SHARED" - Shared labels may be shared with users to apply to Drive items.
1810 // "ADMIN" - Admin-owned label. Only creatable and editable by admins.
1811 // Supports some additional admin-only features.
1812 // "GOOGLE_APP" - A label owned by an internal Google application rather than
1813 // a customer. These labels are read-only.
1814 LabelType string `json:"labelType,omitempty"`
1815 // LearnMoreUri: Custom URL to present to users to allow them to learn more
1816 // about this label and how it should be used.
1817 LearnMoreUri string `json:"learnMoreUri,omitempty"`
1818 // Lifecycle: Output only. The lifecycle state of the label including whether
1819 // it's published, deprecated, and has draft changes.
1820 Lifecycle *GoogleAppsDriveLabelsV2Lifecycle `json:"lifecycle,omitempty"`
1821 // LockStatus: Output only. The `LockStatus` of this label.
1822 LockStatus *GoogleAppsDriveLabelsV2LockStatus `json:"lockStatus,omitempty"`
1823 // Name: Output only. Resource name of the label. Will be in the form of
1824 // either: `labels/{id}` or `labels/{id}@{revision_id}` depending on the
1825 // request. See `id` and `revision_id` below.
1826 Name string `json:"name,omitempty"`
1827 // Properties: Required. The basic properties of the label.
1828 Properties *GoogleAppsDriveLabelsV2LabelProperties `json:"properties,omitempty"`
1829 // PublishTime: Output only. The time this label was published. This value has
1830 // no meaning when the label isn't published.
1831 PublishTime string `json:"publishTime,omitempty"`
1832 // Publisher: Output only. The user who published this label. This value has no
1833 // meaning when the label isn't published.>>
1834 Publisher *GoogleAppsDriveLabelsV2UserInfo `json:"publisher,omitempty"`
1835 // RevisionCreateTime: Output only. The time this label revision was created.
1836 RevisionCreateTime string `json:"revisionCreateTime,omitempty"`
1837 // RevisionCreator: Output only. The user who created this label revision.
1838 RevisionCreator *GoogleAppsDriveLabelsV2UserInfo `json:"revisionCreator,omitempty"`
1839 // RevisionId: Output only. Revision ID of the label. Revision ID might be part
1840 // of the label `name` depending on the request issued. A new revision is
1841 // created whenever revisioned properties of a label are changed. Matches the
1842 // regex: `([a-zA-Z0-9])+`.
1843 RevisionId string `json:"revisionId,omitempty"`
1844 // SchemaCapabilities: Output only. The capabilities the user has on this
1845 // label.
1846 SchemaCapabilities *GoogleAppsDriveLabelsV2LabelSchemaCapabilities `json:"schemaCapabilities,omitempty"`
1847
1848 // ServerResponse contains the HTTP response code and headers from the server.
1849 googleapi.ServerResponse `json:"-"`
1850 // ForceSendFields is a list of field names (e.g. "AppliedCapabilities") to
1851 // unconditionally include in API requests. By default, fields with empty or
1852 // default values are omitted from API requests. See
1853 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1854 // details.
1855 ForceSendFields []string `json:"-"`
1856 // NullFields is a list of field names (e.g. "AppliedCapabilities") to include
1857 // in API requests with the JSON null value. By default, fields with empty
1858 // values are omitted from API requests. See
1859 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1860 NullFields []string `json:"-"`
1861 }
1862
1863 func (s GoogleAppsDriveLabelsV2Label) MarshalJSON() ([]byte, error) {
1864 type NoMethod GoogleAppsDriveLabelsV2Label
1865 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1866 }
1867
1868 // GoogleAppsDriveLabelsV2LabelAppliedCapabilities: The capabilities a user has
1869 // on this label's applied metadata.
1870 type GoogleAppsDriveLabelsV2LabelAppliedCapabilities struct {
1871 // CanApply: Whether the user can apply this label to items.
1872 CanApply bool `json:"canApply,omitempty"`
1873 // CanRead: Whether the user can read applied metadata related to this label.
1874 CanRead bool `json:"canRead,omitempty"`
1875 // CanRemove: Whether the user can remove this label from items.
1876 CanRemove bool `json:"canRemove,omitempty"`
1877 // ForceSendFields is a list of field names (e.g. "CanApply") to
1878 // unconditionally include in API requests. By default, fields with empty or
1879 // default values are omitted from API requests. See
1880 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1881 // details.
1882 ForceSendFields []string `json:"-"`
1883 // NullFields is a list of field names (e.g. "CanApply") to include in API
1884 // requests with the JSON null value. By default, fields with empty values are
1885 // omitted from API requests. See
1886 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1887 NullFields []string `json:"-"`
1888 }
1889
1890 func (s GoogleAppsDriveLabelsV2LabelAppliedCapabilities) MarshalJSON() ([]byte, error) {
1891 type NoMethod GoogleAppsDriveLabelsV2LabelAppliedCapabilities
1892 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1893 }
1894
1895 // GoogleAppsDriveLabelsV2LabelAppliedLabelPolicy: Behavior of this label when
1896 // it's applied to Drive items.
1897 type GoogleAppsDriveLabelsV2LabelAppliedLabelPolicy struct {
1898 // CopyMode: Indicates how the applied label and field values should be copied
1899 // when a Drive item is copied.
1900 //
1901 // Possible values:
1902 // "COPY_MODE_UNSPECIFIED" - Copy mode unspecified.
1903 // "DO_NOT_COPY" - The applied label and field values aren't copied by
1904 // default when the Drive item it's applied to is copied.
1905 // "ALWAYS_COPY" - The applied label and field values are always copied when
1906 // the Drive item it's applied to is copied. Only admins can use this mode.
1907 // "COPY_APPLIABLE" - The applied label and field values are copied if the
1908 // label is appliable by the user making the copy.
1909 CopyMode string `json:"copyMode,omitempty"`
1910 // ForceSendFields is a list of field names (e.g. "CopyMode") to
1911 // unconditionally include in API requests. By default, fields with empty or
1912 // default values are omitted from API requests. See
1913 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1914 // details.
1915 ForceSendFields []string `json:"-"`
1916 // NullFields is a list of field names (e.g. "CopyMode") to include in API
1917 // requests with the JSON null value. By default, fields with empty values are
1918 // omitted from API requests. See
1919 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1920 NullFields []string `json:"-"`
1921 }
1922
1923 func (s GoogleAppsDriveLabelsV2LabelAppliedLabelPolicy) MarshalJSON() ([]byte, error) {
1924 type NoMethod GoogleAppsDriveLabelsV2LabelAppliedLabelPolicy
1925 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1926 }
1927
1928 // GoogleAppsDriveLabelsV2LabelDisplayHints: The UI display hints for rendering
1929 // the label.
1930 type GoogleAppsDriveLabelsV2LabelDisplayHints struct {
1931 // Disabled: Whether the label should be shown in the UI as disabled.
1932 Disabled bool `json:"disabled,omitempty"`
1933 // HiddenInSearch: This label should be hidden in the search menu when
1934 // searching for Drive items.
1935 HiddenInSearch bool `json:"hiddenInSearch,omitempty"`
1936 // Priority: The order to display labels in a list.
1937 Priority int64 `json:"priority,omitempty,string"`
1938 // ShownInApply: This label should be shown in the apply menu when applying
1939 // values to a Drive item.
1940 ShownInApply bool `json:"shownInApply,omitempty"`
1941 // ForceSendFields is a list of field names (e.g. "Disabled") to
1942 // unconditionally include in API requests. By default, fields with empty or
1943 // default values are omitted from API requests. See
1944 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1945 // details.
1946 ForceSendFields []string `json:"-"`
1947 // NullFields is a list of field names (e.g. "Disabled") to include in API
1948 // requests with the JSON null value. By default, fields with empty values are
1949 // omitted from API requests. See
1950 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1951 NullFields []string `json:"-"`
1952 }
1953
1954 func (s GoogleAppsDriveLabelsV2LabelDisplayHints) MarshalJSON() ([]byte, error) {
1955 type NoMethod GoogleAppsDriveLabelsV2LabelDisplayHints
1956 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1957 }
1958
1959 // GoogleAppsDriveLabelsV2LabelEnabledAppSettings: Describes the Google
1960 // Workspace apps in which the label can be used.
1961 type GoogleAppsDriveLabelsV2LabelEnabledAppSettings struct {
1962 // EnabledApps: Optional. The list of apps where the label can be used.
1963 EnabledApps []*GoogleAppsDriveLabelsV2LabelEnabledAppSettingsEnabledApp `json:"enabledApps,omitempty"`
1964 // ForceSendFields is a list of field names (e.g. "EnabledApps") to
1965 // unconditionally include in API requests. By default, fields with empty or
1966 // default values are omitted from API requests. See
1967 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1968 // details.
1969 ForceSendFields []string `json:"-"`
1970 // NullFields is a list of field names (e.g. "EnabledApps") to include in API
1971 // requests with the JSON null value. By default, fields with empty values are
1972 // omitted from API requests. See
1973 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1974 NullFields []string `json:"-"`
1975 }
1976
1977 func (s GoogleAppsDriveLabelsV2LabelEnabledAppSettings) MarshalJSON() ([]byte, error) {
1978 type NoMethod GoogleAppsDriveLabelsV2LabelEnabledAppSettings
1979 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1980 }
1981
1982 // GoogleAppsDriveLabelsV2LabelEnabledAppSettingsEnabledApp: An app where the
1983 // label can be used.
1984 type GoogleAppsDriveLabelsV2LabelEnabledAppSettingsEnabledApp struct {
1985 // App: Optional. The name of the app.
1986 //
1987 // Possible values:
1988 // "APP_UNSPECIFIED" - Unspecified
1989 // "DRIVE" - Drive
1990 // "GMAIL" - Gmail
1991 App string `json:"app,omitempty"`
1992 // ForceSendFields is a list of field names (e.g. "App") to unconditionally
1993 // include in API requests. By default, fields with empty or default values are
1994 // omitted from API requests. See
1995 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1996 // details.
1997 ForceSendFields []string `json:"-"`
1998 // NullFields is a list of field names (e.g. "App") to include in API requests
1999 // with the JSON null value. By default, fields with empty values are omitted
2000 // from API requests. See
2001 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2002 NullFields []string `json:"-"`
2003 }
2004
2005 func (s GoogleAppsDriveLabelsV2LabelEnabledAppSettingsEnabledApp) MarshalJSON() ([]byte, error) {
2006 type NoMethod GoogleAppsDriveLabelsV2LabelEnabledAppSettingsEnabledApp
2007 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2008 }
2009
2010 // GoogleAppsDriveLabelsV2LabelLimits: Label constraints governing the
2011 // structure of a label; such as, the maximum number of fields allowed and
2012 // maximum length of the label title.
2013 type GoogleAppsDriveLabelsV2LabelLimits struct {
2014 // FieldLimits: The limits for fields.
2015 FieldLimits *GoogleAppsDriveLabelsV2FieldLimits `json:"fieldLimits,omitempty"`
2016 // MaxDeletedFields: The maximum number of published fields that can be
2017 // deleted.
2018 MaxDeletedFields int64 `json:"maxDeletedFields,omitempty"`
2019 // MaxDescriptionLength: The maximum number of characters allowed for the
2020 // description.
2021 MaxDescriptionLength int64 `json:"maxDescriptionLength,omitempty"`
2022 // MaxDraftRevisions: The maximum number of draft revisions that will be kept
2023 // before deleting old drafts.
2024 MaxDraftRevisions int64 `json:"maxDraftRevisions,omitempty"`
2025 // MaxFields: The maximum number of fields allowed within the label.
2026 MaxFields int64 `json:"maxFields,omitempty"`
2027 // MaxTitleLength: The maximum number of characters allowed for the title.
2028 MaxTitleLength int64 `json:"maxTitleLength,omitempty"`
2029 // Name: Resource name.
2030 Name string `json:"name,omitempty"`
2031
2032 // ServerResponse contains the HTTP response code and headers from the server.
2033 googleapi.ServerResponse `json:"-"`
2034 // ForceSendFields is a list of field names (e.g. "FieldLimits") to
2035 // unconditionally include in API requests. By default, fields with empty or
2036 // default values are omitted from API requests. See
2037 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2038 // details.
2039 ForceSendFields []string `json:"-"`
2040 // NullFields is a list of field names (e.g. "FieldLimits") to include in API
2041 // requests with the JSON null value. By default, fields with empty values are
2042 // omitted from API requests. See
2043 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2044 NullFields []string `json:"-"`
2045 }
2046
2047 func (s GoogleAppsDriveLabelsV2LabelLimits) MarshalJSON() ([]byte, error) {
2048 type NoMethod GoogleAppsDriveLabelsV2LabelLimits
2049 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2050 }
2051
2052 // GoogleAppsDriveLabelsV2LabelLock: A lock that can be applied to a label,
2053 // field, or choice.
2054 type GoogleAppsDriveLabelsV2LabelLock struct {
2055 // Capabilities: Output only. The user's capabilities on this label lock.
2056 Capabilities *GoogleAppsDriveLabelsV2LabelLockCapabilities `json:"capabilities,omitempty"`
2057 // ChoiceId: The ID of the selection field choice that should be locked. If
2058 // present, `field_id` must also be present.
2059 ChoiceId string `json:"choiceId,omitempty"`
2060 // CreateTime: Output only. The time this label lock was created.
2061 CreateTime string `json:"createTime,omitempty"`
2062 // Creator: Output only. The user whose credentials were used to create the
2063 // label lock. Not present if no user was responsible for creating the label
2064 // lock.
2065 Creator *GoogleAppsDriveLabelsV2UserInfo `json:"creator,omitempty"`
2066 // DeleteTime: Output only. A timestamp indicating when this label lock was
2067 // scheduled for deletion. Present only if this label lock is in the `DELETING`
2068 // state.
2069 DeleteTime string `json:"deleteTime,omitempty"`
2070 // FieldId: The ID of the field that should be locked. Empty if the whole label
2071 // should be locked.
2072 FieldId string `json:"fieldId,omitempty"`
2073 // Name: Output only. Resource name of this label lock.
2074 Name string `json:"name,omitempty"`
2075 // State: Output only. This label lock's state.
2076 //
2077 // Possible values:
2078 // "STATE_UNSPECIFIED" - Unknown state.
2079 // "ACTIVE" - The label lock is active and is being enforced by the server.
2080 // "DELETING" - The label lock is being deleted. The label lock will continue
2081 // to be enforced by the server until it has been fully removed.
2082 State string `json:"state,omitempty"`
2083 // ForceSendFields is a list of field names (e.g. "Capabilities") to
2084 // unconditionally include in API requests. By default, fields with empty or
2085 // default values are omitted from API requests. See
2086 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2087 // details.
2088 ForceSendFields []string `json:"-"`
2089 // NullFields is a list of field names (e.g. "Capabilities") to include in API
2090 // requests with the JSON null value. By default, fields with empty values are
2091 // omitted from API requests. See
2092 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2093 NullFields []string `json:"-"`
2094 }
2095
2096 func (s GoogleAppsDriveLabelsV2LabelLock) MarshalJSON() ([]byte, error) {
2097 type NoMethod GoogleAppsDriveLabelsV2LabelLock
2098 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2099 }
2100
2101 // GoogleAppsDriveLabelsV2LabelLockCapabilities: A description of a user's
2102 // capabilities on a label lock.
2103 type GoogleAppsDriveLabelsV2LabelLockCapabilities struct {
2104 // CanViewPolicy: True if the user is authorized to view the policy.
2105 CanViewPolicy bool `json:"canViewPolicy,omitempty"`
2106 // ForceSendFields is a list of field names (e.g. "CanViewPolicy") to
2107 // unconditionally include in API requests. By default, fields with empty or
2108 // default values are omitted from API requests. See
2109 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2110 // details.
2111 ForceSendFields []string `json:"-"`
2112 // NullFields is a list of field names (e.g. "CanViewPolicy") to include in API
2113 // requests with the JSON null value. By default, fields with empty values are
2114 // omitted from API requests. See
2115 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2116 NullFields []string `json:"-"`
2117 }
2118
2119 func (s GoogleAppsDriveLabelsV2LabelLockCapabilities) MarshalJSON() ([]byte, error) {
2120 type NoMethod GoogleAppsDriveLabelsV2LabelLockCapabilities
2121 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2122 }
2123
2124 // GoogleAppsDriveLabelsV2LabelPermission: The permission that applies to a
2125 // principal (user, group, audience) on a label.
2126 type GoogleAppsDriveLabelsV2LabelPermission struct {
2127 // Audience: Audience to grant a role to. The magic value of
2128 // `audiences/default` may be used to apply the role to the default audience in
2129 // the context of the organization that owns the label.
2130 Audience string `json:"audience,omitempty"`
2131 // Email: Specifies the email address for a user or group principal. Not
2132 // populated for audience principals. User and group permissions may only be
2133 // inserted using an email address. On update requests, if email address is
2134 // specified, no principal should be specified.
2135 Email string `json:"email,omitempty"`
2136 // Group: Group resource name.
2137 Group string `json:"group,omitempty"`
2138 // Name: Resource name of this permission.
2139 Name string `json:"name,omitempty"`
2140 // Person: Person resource name.
2141 Person string `json:"person,omitempty"`
2142 // Role: The role the principal should have.
2143 //
2144 // Possible values:
2145 // "LABEL_ROLE_UNSPECIFIED" - Unknown role.
2146 // "READER" - A reader can read the label and associated metadata applied to
2147 // Drive items.
2148 // "APPLIER" - An applier can write associated metadata on Drive items in
2149 // which they also have write access to. Implies `READER`.
2150 // "ORGANIZER" - An organizer can pin this label in shared drives they manage
2151 // and add new appliers to the label.
2152 // "EDITOR" - Editors can make any update including deleting the label which
2153 // also deletes the associated Drive item metadata. Implies `APPLIER`.
2154 Role string `json:"role,omitempty"`
2155
2156 // ServerResponse contains the HTTP response code and headers from the server.
2157 googleapi.ServerResponse `json:"-"`
2158 // ForceSendFields is a list of field names (e.g. "Audience") to
2159 // unconditionally include in API requests. By default, fields with empty or
2160 // default values are omitted from API requests. See
2161 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2162 // details.
2163 ForceSendFields []string `json:"-"`
2164 // NullFields is a list of field names (e.g. "Audience") to include in API
2165 // requests with the JSON null value. By default, fields with empty values are
2166 // omitted from API requests. See
2167 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2168 NullFields []string `json:"-"`
2169 }
2170
2171 func (s GoogleAppsDriveLabelsV2LabelPermission) MarshalJSON() ([]byte, error) {
2172 type NoMethod GoogleAppsDriveLabelsV2LabelPermission
2173 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2174 }
2175
2176 // GoogleAppsDriveLabelsV2LabelProperties: Basic properties of the label.
2177 type GoogleAppsDriveLabelsV2LabelProperties struct {
2178 // Description: The description of the label.
2179 Description string `json:"description,omitempty"`
2180 // Title: Required. Title of the label.
2181 Title string `json:"title,omitempty"`
2182 // ForceSendFields is a list of field names (e.g. "Description") to
2183 // unconditionally include in API requests. By default, fields with empty or
2184 // default values are omitted from API requests. See
2185 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2186 // details.
2187 ForceSendFields []string `json:"-"`
2188 // NullFields is a list of field names (e.g. "Description") to include in API
2189 // requests with the JSON null value. By default, fields with empty values are
2190 // omitted from API requests. See
2191 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2192 NullFields []string `json:"-"`
2193 }
2194
2195 func (s GoogleAppsDriveLabelsV2LabelProperties) MarshalJSON() ([]byte, error) {
2196 type NoMethod GoogleAppsDriveLabelsV2LabelProperties
2197 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2198 }
2199
2200 // GoogleAppsDriveLabelsV2LabelSchemaCapabilities: The capabilities related to
2201 // this label when editing the label.
2202 type GoogleAppsDriveLabelsV2LabelSchemaCapabilities struct {
2203 // CanDelete: Whether the user can delete this label. The user must have
2204 // permission and the label must be disabled.
2205 CanDelete bool `json:"canDelete,omitempty"`
2206 // CanDisable: Whether the user can disable this label. The user must have
2207 // permission and this label must not already be disabled.
2208 CanDisable bool `json:"canDisable,omitempty"`
2209 // CanEnable: Whether the user can enable this label. The user must have
2210 // permission and this label must be disabled.
2211 CanEnable bool `json:"canEnable,omitempty"`
2212 // CanUpdate: Whether the user can change this label.
2213 CanUpdate bool `json:"canUpdate,omitempty"`
2214 // ForceSendFields is a list of field names (e.g. "CanDelete") to
2215 // unconditionally include in API requests. By default, fields with empty or
2216 // default values are omitted from API requests. See
2217 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2218 // details.
2219 ForceSendFields []string `json:"-"`
2220 // NullFields is a list of field names (e.g. "CanDelete") to include in API
2221 // requests with the JSON null value. By default, fields with empty values are
2222 // omitted from API requests. See
2223 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2224 NullFields []string `json:"-"`
2225 }
2226
2227 func (s GoogleAppsDriveLabelsV2LabelSchemaCapabilities) MarshalJSON() ([]byte, error) {
2228 type NoMethod GoogleAppsDriveLabelsV2LabelSchemaCapabilities
2229 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2230 }
2231
2232 // GoogleAppsDriveLabelsV2Lifecycle: The lifecycle state of an object, such as
2233 // label, field, or choice. For more information, see Label lifecycle
2234 // (https://developers.google.com/workspace/drive/labels/guides/label-lifecycle).
2235 // The lifecycle enforces the following transitions: * `UNPUBLISHED_DRAFT`
2236 // (starting state) * `UNPUBLISHED_DRAFT` -> `PUBLISHED` * `UNPUBLISHED_DRAFT`
2237 // -> (Deleted) * `PUBLISHED` -> `DISABLED` * `DISABLED` -> `PUBLISHED` *
2238 // `DISABLED` -> (Deleted) The published and disabled states have some distinct
2239 // characteristics: * `Published`: Some kinds of changes might be made to an
2240 // object in this state, in which case `has_unpublished_changes` will be true.
2241 // Also, some kinds of changes aren't permitted. Generally, any change that
2242 // would invalidate or cause new restrictions on existing metadata related to
2243 // the label are rejected. * `Disabled`: When disabled, the configured
2244 // `DisabledPolicy` takes effect.
2245 type GoogleAppsDriveLabelsV2Lifecycle struct {
2246 // DisabledPolicy: The policy that governs how to show a disabled label, field,
2247 // or selection choice.
2248 DisabledPolicy *GoogleAppsDriveLabelsV2LifecycleDisabledPolicy `json:"disabledPolicy,omitempty"`
2249 // HasUnpublishedChanges: Output only. Whether the object associated with this
2250 // lifecycle has unpublished changes.
2251 HasUnpublishedChanges bool `json:"hasUnpublishedChanges,omitempty"`
2252 // State: Output only. The state of the object associated with this lifecycle.
2253 //
2254 // Possible values:
2255 // "STATE_UNSPECIFIED" - Unknown State.
2256 // "UNPUBLISHED_DRAFT" - The initial state of an object. Once published, the
2257 // object can never return to this state. Once an object is published, certain
2258 // kinds of changes are no longer permitted.
2259 // "PUBLISHED" - The object has been published. The object might have
2260 // unpublished draft changes as indicated by `has_unpublished_changes`.
2261 // "DISABLED" - The object has been published and has since been disabled.
2262 // The object might have unpublished draft changes as indicated by
2263 // `has_unpublished_changes`.
2264 // "DELETED" - The object has been deleted.
2265 State string `json:"state,omitempty"`
2266 // ForceSendFields is a list of field names (e.g. "DisabledPolicy") to
2267 // unconditionally include in API requests. By default, fields with empty or
2268 // default values are omitted from API requests. See
2269 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2270 // details.
2271 ForceSendFields []string `json:"-"`
2272 // NullFields is a list of field names (e.g. "DisabledPolicy") to include in
2273 // API requests with the JSON null value. By default, fields with empty values
2274 // are omitted from API requests. See
2275 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2276 NullFields []string `json:"-"`
2277 }
2278
2279 func (s GoogleAppsDriveLabelsV2Lifecycle) MarshalJSON() ([]byte, error) {
2280 type NoMethod GoogleAppsDriveLabelsV2Lifecycle
2281 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2282 }
2283
2284 // GoogleAppsDriveLabelsV2LifecycleDisabledPolicy: The policy that governs how
2285 // to treat a disabled label, field, or selection choice in different contexts.
2286 type GoogleAppsDriveLabelsV2LifecycleDisabledPolicy struct {
2287 // HideInSearch: Whether to hide this disabled object in the search menu for
2288 // Drive items. * When `false`, the object is generally shown in the UI as
2289 // disabled but it appears in the search results when searching for Drive
2290 // items. * When `true`, the object is generally hidden in the UI when
2291 // searching for Drive items.
2292 HideInSearch bool `json:"hideInSearch,omitempty"`
2293 // ShowInApply: Whether to show this disabled object in the apply menu on Drive
2294 // items. * When `true`, the object is generally shown in the UI as disabled
2295 // and is unselectable. * When `false`, the object is generally hidden in the
2296 // UI.
2297 ShowInApply bool `json:"showInApply,omitempty"`
2298 // ForceSendFields is a list of field names (e.g. "HideInSearch") to
2299 // unconditionally include in API requests. By default, fields with empty or
2300 // default values are omitted from API requests. See
2301 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2302 // details.
2303 ForceSendFields []string `json:"-"`
2304 // NullFields is a list of field names (e.g. "HideInSearch") to include in API
2305 // requests with the JSON null value. By default, fields with empty values are
2306 // omitted from API requests. See
2307 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2308 NullFields []string `json:"-"`
2309 }
2310
2311 func (s GoogleAppsDriveLabelsV2LifecycleDisabledPolicy) MarshalJSON() ([]byte, error) {
2312 type NoMethod GoogleAppsDriveLabelsV2LifecycleDisabledPolicy
2313 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2314 }
2315
2316 // GoogleAppsDriveLabelsV2ListLabelLocksResponse: The response to a
2317 // `ListLabelLocksRequest`.
2318 type GoogleAppsDriveLabelsV2ListLabelLocksResponse struct {
2319 // LabelLocks: Label locks.
2320 LabelLocks []*GoogleAppsDriveLabelsV2LabelLock `json:"labelLocks,omitempty"`
2321 // NextPageToken: The token of the next page in the response.
2322 NextPageToken string `json:"nextPageToken,omitempty"`
2323
2324 // ServerResponse contains the HTTP response code and headers from the server.
2325 googleapi.ServerResponse `json:"-"`
2326 // ForceSendFields is a list of field names (e.g. "LabelLocks") to
2327 // unconditionally include in API requests. By default, fields with empty or
2328 // default values are omitted from API requests. See
2329 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2330 // details.
2331 ForceSendFields []string `json:"-"`
2332 // NullFields is a list of field names (e.g. "LabelLocks") to include in API
2333 // requests with the JSON null value. By default, fields with empty values are
2334 // omitted from API requests. See
2335 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2336 NullFields []string `json:"-"`
2337 }
2338
2339 func (s GoogleAppsDriveLabelsV2ListLabelLocksResponse) MarshalJSON() ([]byte, error) {
2340 type NoMethod GoogleAppsDriveLabelsV2ListLabelLocksResponse
2341 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2342 }
2343
2344 // GoogleAppsDriveLabelsV2ListLabelPermissionsResponse: Response for listing
2345 // the permissions on a label.
2346 type GoogleAppsDriveLabelsV2ListLabelPermissionsResponse struct {
2347 // LabelPermissions: Label permissions.
2348 LabelPermissions []*GoogleAppsDriveLabelsV2LabelPermission `json:"labelPermissions,omitempty"`
2349 // NextPageToken: The token of the next page in the response.
2350 NextPageToken string `json:"nextPageToken,omitempty"`
2351
2352 // ServerResponse contains the HTTP response code and headers from the server.
2353 googleapi.ServerResponse `json:"-"`
2354 // ForceSendFields is a list of field names (e.g. "LabelPermissions") to
2355 // unconditionally include in API requests. By default, fields with empty or
2356 // default values are omitted from API requests. See
2357 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2358 // details.
2359 ForceSendFields []string `json:"-"`
2360 // NullFields is a list of field names (e.g. "LabelPermissions") to include in
2361 // API requests with the JSON null value. By default, fields with empty values
2362 // are omitted from API requests. See
2363 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2364 NullFields []string `json:"-"`
2365 }
2366
2367 func (s GoogleAppsDriveLabelsV2ListLabelPermissionsResponse) MarshalJSON() ([]byte, error) {
2368 type NoMethod GoogleAppsDriveLabelsV2ListLabelPermissionsResponse
2369 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2370 }
2371
2372 // GoogleAppsDriveLabelsV2ListLabelsResponse: Response for listing labels.
2373 type GoogleAppsDriveLabelsV2ListLabelsResponse struct {
2374 // Labels: Labels.
2375 Labels []*GoogleAppsDriveLabelsV2Label `json:"labels,omitempty"`
2376 // NextPageToken: The token of the next page in the response.
2377 NextPageToken string `json:"nextPageToken,omitempty"`
2378
2379 // ServerResponse contains the HTTP response code and headers from the server.
2380 googleapi.ServerResponse `json:"-"`
2381 // ForceSendFields is a list of field names (e.g. "Labels") to unconditionally
2382 // include in API requests. By default, fields with empty or default values are
2383 // omitted from API requests. See
2384 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2385 // details.
2386 ForceSendFields []string `json:"-"`
2387 // NullFields is a list of field names (e.g. "Labels") to include in API
2388 // requests with the JSON null value. By default, fields with empty values are
2389 // omitted from API requests. See
2390 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2391 NullFields []string `json:"-"`
2392 }
2393
2394 func (s GoogleAppsDriveLabelsV2ListLabelsResponse) MarshalJSON() ([]byte, error) {
2395 type NoMethod GoogleAppsDriveLabelsV2ListLabelsResponse
2396 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2397 }
2398
2399 // GoogleAppsDriveLabelsV2ListLimits: Limits for list-variant of a field type.
2400 type GoogleAppsDriveLabelsV2ListLimits struct {
2401 // MaxEntries: Maximum number of values allowed for the field type.
2402 MaxEntries int64 `json:"maxEntries,omitempty"`
2403 // ForceSendFields is a list of field names (e.g. "MaxEntries") to
2404 // unconditionally include in API requests. By default, fields with empty or
2405 // default values are omitted from API requests. See
2406 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2407 // details.
2408 ForceSendFields []string `json:"-"`
2409 // NullFields is a list of field names (e.g. "MaxEntries") to include in API
2410 // requests with the JSON null value. By default, fields with empty values are
2411 // omitted from API requests. See
2412 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2413 NullFields []string `json:"-"`
2414 }
2415
2416 func (s GoogleAppsDriveLabelsV2ListLimits) MarshalJSON() ([]byte, error) {
2417 type NoMethod GoogleAppsDriveLabelsV2ListLimits
2418 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2419 }
2420
2421 // GoogleAppsDriveLabelsV2LockStatus: Contains information about whether a
2422 // label component should be considered locked.
2423 type GoogleAppsDriveLabelsV2LockStatus struct {
2424 // Locked: Output only. Indicates whether this label component is the (direct)
2425 // target of a label lock. A label component can be implicitly locked even if
2426 // it's not the direct target of a label lock, in which case this field is set
2427 // to false.
2428 Locked bool `json:"locked,omitempty"`
2429 // ForceSendFields is a list of field names (e.g. "Locked") to unconditionally
2430 // include in API requests. By default, fields with empty or default values are
2431 // omitted from API requests. See
2432 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2433 // details.
2434 ForceSendFields []string `json:"-"`
2435 // NullFields is a list of field names (e.g. "Locked") to include in API
2436 // requests with the JSON null value. By default, fields with empty values are
2437 // omitted from API requests. See
2438 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2439 NullFields []string `json:"-"`
2440 }
2441
2442 func (s GoogleAppsDriveLabelsV2LockStatus) MarshalJSON() ([]byte, error) {
2443 type NoMethod GoogleAppsDriveLabelsV2LockStatus
2444 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2445 }
2446
2447 // GoogleAppsDriveLabelsV2LongTextLimits: Limits for long text field type.
2448 type GoogleAppsDriveLabelsV2LongTextLimits struct {
2449 // MaxLength: Maximum length allowed for a long text field type.
2450 MaxLength int64 `json:"maxLength,omitempty"`
2451 // MinLength: Minimum length allowed for a long text field type.
2452 MinLength int64 `json:"minLength,omitempty"`
2453 // ForceSendFields is a list of field names (e.g. "MaxLength") to
2454 // unconditionally include in API requests. By default, fields with empty or
2455 // default values are omitted from API requests. See
2456 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2457 // details.
2458 ForceSendFields []string `json:"-"`
2459 // NullFields is a list of field names (e.g. "MaxLength") to include in API
2460 // requests with the JSON null value. By default, fields with empty values are
2461 // omitted from API requests. See
2462 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2463 NullFields []string `json:"-"`
2464 }
2465
2466 func (s GoogleAppsDriveLabelsV2LongTextLimits) MarshalJSON() ([]byte, error) {
2467 type NoMethod GoogleAppsDriveLabelsV2LongTextLimits
2468 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2469 }
2470
2471 // GoogleAppsDriveLabelsV2PublishLabelRequest: Request to publish a label.
2472 type GoogleAppsDriveLabelsV2PublishLabelRequest struct {
2473 // LanguageCode: The BCP-47 language code to use for evaluating localized field
2474 // labels. When not specified, values in the default configured language will
2475 // be used.
2476 LanguageCode string `json:"languageCode,omitempty"`
2477 // UseAdminAccess: Set to `true` in order to use the user's admin credentials.
2478 // The server will verify the user is an admin for the label before allowing
2479 // access.
2480 UseAdminAccess bool `json:"useAdminAccess,omitempty"`
2481 // WriteControl: Provides control over how write requests are executed.
2482 // Defaults to unset, which means the last write wins.
2483 WriteControl *GoogleAppsDriveLabelsV2WriteControl `json:"writeControl,omitempty"`
2484 // ForceSendFields is a list of field names (e.g. "LanguageCode") to
2485 // unconditionally include in API requests. By default, fields with empty or
2486 // default values are omitted from API requests. See
2487 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2488 // details.
2489 ForceSendFields []string `json:"-"`
2490 // NullFields is a list of field names (e.g. "LanguageCode") to include in API
2491 // requests with the JSON null value. By default, fields with empty values are
2492 // omitted from API requests. See
2493 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2494 NullFields []string `json:"-"`
2495 }
2496
2497 func (s GoogleAppsDriveLabelsV2PublishLabelRequest) MarshalJSON() ([]byte, error) {
2498 type NoMethod GoogleAppsDriveLabelsV2PublishLabelRequest
2499 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2500 }
2501
2502 // GoogleAppsDriveLabelsV2SelectionLimits: Limits for selection field type.
2503 type GoogleAppsDriveLabelsV2SelectionLimits struct {
2504 // ListLimits: Limits for list-variant of a field type.
2505 ListLimits *GoogleAppsDriveLabelsV2ListLimits `json:"listLimits,omitempty"`
2506 // MaxChoices: Maximum number of choices.
2507 MaxChoices int64 `json:"maxChoices,omitempty"`
2508 // MaxDeletedChoices: Maximum number of deleted choices.
2509 MaxDeletedChoices int64 `json:"maxDeletedChoices,omitempty"`
2510 // MaxDisplayNameLength: Maximum length for display name.
2511 MaxDisplayNameLength int64 `json:"maxDisplayNameLength,omitempty"`
2512 // MaxIdLength: Maximum ID length for a selection option.
2513 MaxIdLength int64 `json:"maxIdLength,omitempty"`
2514 // ForceSendFields is a list of field names (e.g. "ListLimits") to
2515 // unconditionally include in API requests. By default, fields with empty or
2516 // default values are omitted from API requests. See
2517 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2518 // details.
2519 ForceSendFields []string `json:"-"`
2520 // NullFields is a list of field names (e.g. "ListLimits") to include in API
2521 // requests with the JSON null value. By default, fields with empty values are
2522 // omitted from API requests. See
2523 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2524 NullFields []string `json:"-"`
2525 }
2526
2527 func (s GoogleAppsDriveLabelsV2SelectionLimits) MarshalJSON() ([]byte, error) {
2528 type NoMethod GoogleAppsDriveLabelsV2SelectionLimits
2529 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2530 }
2531
2532 // GoogleAppsDriveLabelsV2TextLimits: Limits for text field type.
2533 type GoogleAppsDriveLabelsV2TextLimits struct {
2534 // MaxLength: Maximum length allowed for a text field type.
2535 MaxLength int64 `json:"maxLength,omitempty"`
2536 // MinLength: Minimum length allowed for a text field type.
2537 MinLength int64 `json:"minLength,omitempty"`
2538 // ForceSendFields is a list of field names (e.g. "MaxLength") to
2539 // unconditionally include in API requests. By default, fields with empty or
2540 // default values are omitted from API requests. See
2541 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2542 // details.
2543 ForceSendFields []string `json:"-"`
2544 // NullFields is a list of field names (e.g. "MaxLength") to include in API
2545 // requests with the JSON null value. By default, fields with empty values are
2546 // omitted from API requests. See
2547 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2548 NullFields []string `json:"-"`
2549 }
2550
2551 func (s GoogleAppsDriveLabelsV2TextLimits) MarshalJSON() ([]byte, error) {
2552 type NoMethod GoogleAppsDriveLabelsV2TextLimits
2553 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2554 }
2555
2556 // GoogleAppsDriveLabelsV2UpdateLabelCopyModeRequest: Request to update the
2557 // `CopyMode` of the given label. Changes to this policy aren't revisioned,
2558 // don't require publishing, and take effect immediately. \
2559 type GoogleAppsDriveLabelsV2UpdateLabelCopyModeRequest struct {
2560 // CopyMode: Required. Indicates how the applied label and field values should
2561 // be copied when a Drive item is copied.
2562 //
2563 // Possible values:
2564 // "COPY_MODE_UNSPECIFIED" - Copy mode unspecified.
2565 // "DO_NOT_COPY" - The applied label and field values aren't copied by
2566 // default when the Drive item it's applied to is copied.
2567 // "ALWAYS_COPY" - The applied label and field values are always copied when
2568 // the Drive item it's applied to is copied. Only admins can use this mode.
2569 // "COPY_APPLIABLE" - The applied label and field values are copied if the
2570 // label is appliable by the user making the copy.
2571 CopyMode string `json:"copyMode,omitempty"`
2572 // LanguageCode: The BCP-47 language code to use for evaluating localized field
2573 // labels. When not specified, values in the default configured language will
2574 // be used.
2575 LanguageCode string `json:"languageCode,omitempty"`
2576 // UseAdminAccess: Set to `true` in order to use the user's admin credentials.
2577 // The server will verify the user is an admin for the label before allowing
2578 // access.
2579 UseAdminAccess bool `json:"useAdminAccess,omitempty"`
2580 // View: When specified, only certain fields belonging to the indicated view
2581 // will be returned.
2582 //
2583 // Possible values:
2584 // "LABEL_VIEW_BASIC" - Implies the field mask:
2585 // `name,id,revision_id,label_type,properties.*`
2586 // "LABEL_VIEW_FULL" - All possible fields.
2587 View string `json:"view,omitempty"`
2588 // ForceSendFields is a list of field names (e.g. "CopyMode") to
2589 // unconditionally include in API requests. By default, fields with empty or
2590 // default values are omitted from API requests. See
2591 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2592 // details.
2593 ForceSendFields []string `json:"-"`
2594 // NullFields is a list of field names (e.g. "CopyMode") to include in API
2595 // requests with the JSON null value. By default, fields with empty values are
2596 // omitted from API requests. See
2597 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2598 NullFields []string `json:"-"`
2599 }
2600
2601 func (s GoogleAppsDriveLabelsV2UpdateLabelCopyModeRequest) MarshalJSON() ([]byte, error) {
2602 type NoMethod GoogleAppsDriveLabelsV2UpdateLabelCopyModeRequest
2603 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2604 }
2605
2606 // GoogleAppsDriveLabelsV2UpdateLabelEnabledAppSettingsRequest: Request to
2607 // update the `EnabledAppSettings` of the given label. This change is not
2608 // revisioned, doesn't require publishing, and takes effect immediately. \
2609 type GoogleAppsDriveLabelsV2UpdateLabelEnabledAppSettingsRequest struct {
2610 // EnabledAppSettings: Required. The new `EnabledAppSettings` value for the
2611 // label.
2612 EnabledAppSettings *GoogleAppsDriveLabelsV2LabelEnabledAppSettings `json:"enabledAppSettings,omitempty"`
2613 // LanguageCode: Optional. The BCP-47 language code to use for evaluating
2614 // localized field labels. When not specified, values in the default configured
2615 // language will be used.
2616 LanguageCode string `json:"languageCode,omitempty"`
2617 // UseAdminAccess: Optional. Set to `true` in order to use the user's admin
2618 // credentials. The server will verify the user is an admin for the label
2619 // before allowing access.
2620 UseAdminAccess bool `json:"useAdminAccess,omitempty"`
2621 // View: Optional. When specified, only certain fields belonging to the
2622 // indicated view will be returned.
2623 //
2624 // Possible values:
2625 // "LABEL_VIEW_BASIC" - Implies the field mask:
2626 // `name,id,revision_id,label_type,properties.*`
2627 // "LABEL_VIEW_FULL" - All possible fields.
2628 View string `json:"view,omitempty"`
2629 // ForceSendFields is a list of field names (e.g. "EnabledAppSettings") to
2630 // unconditionally include in API requests. By default, fields with empty or
2631 // default values are omitted from API requests. See
2632 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2633 // details.
2634 ForceSendFields []string `json:"-"`
2635 // NullFields is a list of field names (e.g. "EnabledAppSettings") to include
2636 // in API requests with the JSON null value. By default, fields with empty
2637 // values are omitted from API requests. See
2638 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2639 NullFields []string `json:"-"`
2640 }
2641
2642 func (s GoogleAppsDriveLabelsV2UpdateLabelEnabledAppSettingsRequest) MarshalJSON() ([]byte, error) {
2643 type NoMethod GoogleAppsDriveLabelsV2UpdateLabelEnabledAppSettingsRequest
2644 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2645 }
2646
2647 // GoogleAppsDriveLabelsV2UpdateLabelPermissionRequest: Updates a label
2648 // permission. Permissions affect the label resource as a whole, aren't
2649 // revisioned, and don't require publishing.
2650 type GoogleAppsDriveLabelsV2UpdateLabelPermissionRequest struct {
2651 // LabelPermission: Required. The permission to create or update on the label.
2652 LabelPermission *GoogleAppsDriveLabelsV2LabelPermission `json:"labelPermission,omitempty"`
2653 // Parent: Required. The parent label resource name.
2654 Parent string `json:"parent,omitempty"`
2655 // UseAdminAccess: Set to `true` in order to use the user's admin credentials.
2656 // The server will verify the user is an admin for the label before allowing
2657 // access.
2658 UseAdminAccess bool `json:"useAdminAccess,omitempty"`
2659 // ForceSendFields is a list of field names (e.g. "LabelPermission") to
2660 // unconditionally include in API requests. By default, fields with empty or
2661 // default values are omitted from API requests. See
2662 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2663 // details.
2664 ForceSendFields []string `json:"-"`
2665 // NullFields is a list of field names (e.g. "LabelPermission") to include in
2666 // API requests with the JSON null value. By default, fields with empty values
2667 // are omitted from API requests. See
2668 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2669 NullFields []string `json:"-"`
2670 }
2671
2672 func (s GoogleAppsDriveLabelsV2UpdateLabelPermissionRequest) MarshalJSON() ([]byte, error) {
2673 type NoMethod GoogleAppsDriveLabelsV2UpdateLabelPermissionRequest
2674 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2675 }
2676
2677 // GoogleAppsDriveLabelsV2UserCapabilities: The capabilities of a user.
2678 type GoogleAppsDriveLabelsV2UserCapabilities struct {
2679 // CanAccessLabelManager: Output only. Whether the user is allowed access to
2680 // the label manager.
2681 CanAccessLabelManager bool `json:"canAccessLabelManager,omitempty"`
2682 // CanAdministrateLabels: Output only. Whether the user is an administrator for
2683 // the shared labels feature.
2684 CanAdministrateLabels bool `json:"canAdministrateLabels,omitempty"`
2685 // CanCreateAdminLabels: Output only. Whether the user is allowed to create
2686 // admin labels.
2687 CanCreateAdminLabels bool `json:"canCreateAdminLabels,omitempty"`
2688 // CanCreateSharedLabels: Output only. Whether the user is allowed to create
2689 // shared labels.
2690 CanCreateSharedLabels bool `json:"canCreateSharedLabels,omitempty"`
2691 // Name: Output only. Resource name for the user capabilities.
2692 Name string `json:"name,omitempty"`
2693
2694 // ServerResponse contains the HTTP response code and headers from the server.
2695 googleapi.ServerResponse `json:"-"`
2696 // ForceSendFields is a list of field names (e.g. "CanAccessLabelManager") to
2697 // unconditionally include in API requests. By default, fields with empty or
2698 // default values are omitted from API requests. See
2699 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2700 // details.
2701 ForceSendFields []string `json:"-"`
2702 // NullFields is a list of field names (e.g. "CanAccessLabelManager") to
2703 // include in API requests with the JSON null value. By default, fields with
2704 // empty values are omitted from API requests. See
2705 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2706 NullFields []string `json:"-"`
2707 }
2708
2709 func (s GoogleAppsDriveLabelsV2UserCapabilities) MarshalJSON() ([]byte, error) {
2710 type NoMethod GoogleAppsDriveLabelsV2UserCapabilities
2711 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2712 }
2713
2714 // GoogleAppsDriveLabelsV2UserInfo: Information about a user.
2715 type GoogleAppsDriveLabelsV2UserInfo struct {
2716 // Person: The identifier for this user that can be used with the People API
2717 // (https://developers.google.com/people) to get more information. For example,
2718 // `people/12345678`.
2719 Person string `json:"person,omitempty"`
2720 // ForceSendFields is a list of field names (e.g. "Person") to unconditionally
2721 // include in API requests. By default, fields with empty or default values are
2722 // omitted from API requests. See
2723 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2724 // details.
2725 ForceSendFields []string `json:"-"`
2726 // NullFields is a list of field names (e.g. "Person") to include in API
2727 // requests with the JSON null value. By default, fields with empty values are
2728 // omitted from API requests. See
2729 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2730 NullFields []string `json:"-"`
2731 }
2732
2733 func (s GoogleAppsDriveLabelsV2UserInfo) MarshalJSON() ([]byte, error) {
2734 type NoMethod GoogleAppsDriveLabelsV2UserInfo
2735 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2736 }
2737
2738 // GoogleAppsDriveLabelsV2UserLimits: Limits for Field.Type.USER.
2739 type GoogleAppsDriveLabelsV2UserLimits struct {
2740 // ListLimits: Limits for list-variant of a field type.
2741 ListLimits *GoogleAppsDriveLabelsV2ListLimits `json:"listLimits,omitempty"`
2742 // ForceSendFields is a list of field names (e.g. "ListLimits") to
2743 // unconditionally include in API requests. By default, fields with empty or
2744 // default values are omitted from API requests. See
2745 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2746 // details.
2747 ForceSendFields []string `json:"-"`
2748 // NullFields is a list of field names (e.g. "ListLimits") to include in API
2749 // requests with the JSON null value. By default, fields with empty values are
2750 // omitted from API requests. See
2751 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2752 NullFields []string `json:"-"`
2753 }
2754
2755 func (s GoogleAppsDriveLabelsV2UserLimits) MarshalJSON() ([]byte, error) {
2756 type NoMethod GoogleAppsDriveLabelsV2UserLimits
2757 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2758 }
2759
2760 // GoogleAppsDriveLabelsV2WriteControl: Provides control over how write
2761 // requests are executed. When not specified, the last write wins.
2762 type GoogleAppsDriveLabelsV2WriteControl struct {
2763 // RequiredRevisionId: The revision ID of the label that the write request will
2764 // be applied to. If this isn't the latest revision of the label, the request
2765 // will not be processed and will return a 400 Bad Request error.
2766 RequiredRevisionId string `json:"requiredRevisionId,omitempty"`
2767 // ForceSendFields is a list of field names (e.g. "RequiredRevisionId") to
2768 // unconditionally include in API requests. By default, fields with empty or
2769 // default values are omitted from API requests. See
2770 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2771 // details.
2772 ForceSendFields []string `json:"-"`
2773 // NullFields is a list of field names (e.g. "RequiredRevisionId") to include
2774 // in API requests with the JSON null value. By default, fields with empty
2775 // values are omitted from API requests. See
2776 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2777 NullFields []string `json:"-"`
2778 }
2779
2780 func (s GoogleAppsDriveLabelsV2WriteControl) MarshalJSON() ([]byte, error) {
2781 type NoMethod GoogleAppsDriveLabelsV2WriteControl
2782 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2783 }
2784
2785 // GoogleProtobufEmpty: A generic empty message that you can re-use to avoid
2786 // defining duplicated empty messages in your APIs. A typical example is to use
2787 // it as the request or the response type of an API method. For instance:
2788 // service Foo { rpc Bar(google.protobuf.Empty) returns
2789 // (google.protobuf.Empty); }
2790 type GoogleProtobufEmpty struct {
2791 // ServerResponse contains the HTTP response code and headers from the server.
2792 googleapi.ServerResponse `json:"-"`
2793 }
2794
2795 // GoogleTypeColor: Represents a color in the RGBA color space. This
2796 // representation is designed for simplicity of conversion to and from color
2797 // representations in various languages over compactness. For example, the
2798 // fields of this representation can be trivially provided to the constructor
2799 // of `java.awt.Color` in Java; it can also be trivially provided to UIColor's
2800 // `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little
2801 // work, it can be easily formatted into a CSS `rgba()` string in JavaScript.
2802 // This reference page doesn't have information about the absolute color space
2803 // that should be used to interpret the RGB value—for example, sRGB, Adobe
2804 // RGB, DCI-P3, and BT.2020. By default, applications should assume the sRGB
2805 // color space. When color equality needs to be decided, implementations,
2806 // unless documented otherwise, treat two colors as equal if all their red,
2807 // green, blue, and alpha values each differ by at most `1e-5`. Example (Java):
2808 // import com.google.type.Color; // ... public static java.awt.Color
2809 // fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ?
2810 // protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color(
2811 // protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); }
2812 // public static Color toProto(java.awt.Color color) { float red = (float)
2813 // color.getRed(); float green = (float) color.getGreen(); float blue = (float)
2814 // color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder =
2815 // Color .newBuilder() .setRed(red / denominator) .setGreen(green /
2816 // denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if
2817 // (alpha != 255) { result.setAlpha( FloatValue .newBuilder()
2818 // .setValue(((float) alpha) / denominator) .build()); } return
2819 // resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static
2820 // UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float
2821 // green = [protocolor green]; float blue = [protocolor blue]; FloatValue*
2822 // alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper !=
2823 // nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red
2824 // green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color)
2825 // { CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green
2826 // blue:&blue alpha:&alpha]) { return nil; } Color* result = [[Color alloc]
2827 // init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue];
2828 // if (alpha <= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; }
2829 // [result autorelease]; return result; } // ... Example (JavaScript): // ...
2830 // var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red ||
2831 // 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue
2832 // || 0.0; var red = Math.floor(redFrac * 255); var green =
2833 // Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if
2834 // (!('alpha' in rgb_color)) { return rgbToCssColor(red, green, blue); } var
2835 // alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green,
2836 // blue].join(','); return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(”);
2837 // }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new
2838 // Number((red << 16) | (green << 8) | blue); var hexString =
2839 // rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var
2840 // resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) {
2841 // resultBuilder.push('0'); } resultBuilder.push(hexString); return
2842 // resultBuilder.join(”); }; // ...
2843 type GoogleTypeColor struct {
2844 // Alpha: The fraction of this color that should be applied to the pixel. That
2845 // is, the final pixel color is defined by the equation: `pixel color = alpha *
2846 // (this color) + (1.0 - alpha) * (background color)` This means that a value
2847 // of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a
2848 // completely transparent color. This uses a wrapper message rather than a
2849 // simple float scalar so that it is possible to distinguish between a default
2850 // value and the value being unset. If omitted, this color object is rendered
2851 // as a solid color (as if the alpha value had been explicitly given a value of
2852 // 1.0).
2853 Alpha float64 `json:"alpha,omitempty"`
2854 // Blue: The amount of blue in the color as a value in the interval [0, 1].
2855 Blue float64 `json:"blue,omitempty"`
2856 // Green: The amount of green in the color as a value in the interval [0, 1].
2857 Green float64 `json:"green,omitempty"`
2858 // Red: The amount of red in the color as a value in the interval [0, 1].
2859 Red float64 `json:"red,omitempty"`
2860 // ForceSendFields is a list of field names (e.g. "Alpha") to unconditionally
2861 // include in API requests. By default, fields with empty or default values are
2862 // omitted from API requests. See
2863 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2864 // details.
2865 ForceSendFields []string `json:"-"`
2866 // NullFields is a list of field names (e.g. "Alpha") to include in API
2867 // requests with the JSON null value. By default, fields with empty values are
2868 // omitted from API requests. See
2869 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2870 NullFields []string `json:"-"`
2871 }
2872
2873 func (s GoogleTypeColor) MarshalJSON() ([]byte, error) {
2874 type NoMethod GoogleTypeColor
2875 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2876 }
2877
2878 func (s *GoogleTypeColor) UnmarshalJSON(data []byte) error {
2879 type NoMethod GoogleTypeColor
2880 var s1 struct {
2881 Alpha gensupport.JSONFloat64 `json:"alpha"`
2882 Blue gensupport.JSONFloat64 `json:"blue"`
2883 Green gensupport.JSONFloat64 `json:"green"`
2884 Red gensupport.JSONFloat64 `json:"red"`
2885 *NoMethod
2886 }
2887 s1.NoMethod = (*NoMethod)(s)
2888 if err := json.Unmarshal(data, &s1); err != nil {
2889 return err
2890 }
2891 s.Alpha = float64(s1.Alpha)
2892 s.Blue = float64(s1.Blue)
2893 s.Green = float64(s1.Green)
2894 s.Red = float64(s1.Red)
2895 return nil
2896 }
2897
2898 // GoogleTypeDate: Represents a whole or partial calendar date, such as a
2899 // birthday. The time of day and time zone are either specified elsewhere or
2900 // are insignificant. The date is relative to the Gregorian Calendar. This can
2901 // represent one of the following: * A full date, with non-zero year, month,
2902 // and day values. * A month and day, with a zero year (for example, an
2903 // anniversary). * A year on its own, with a zero month and a zero day. * A
2904 // year and month, with a zero day (for example, a credit card expiration
2905 // date). Related types: * google.type.TimeOfDay * google.type.DateTime *
2906 // google.protobuf.Timestamp
2907 type GoogleTypeDate struct {
2908 // Day: Day of a month. Must be from 1 to 31 and valid for the year and month,
2909 // or 0 to specify a year by itself or a year and month where the day isn't
2910 // significant.
2911 Day int64 `json:"day,omitempty"`
2912 // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year without
2913 // a month and day.
2914 Month int64 `json:"month,omitempty"`
2915 // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a date
2916 // without a year.
2917 Year int64 `json:"year,omitempty"`
2918 // ForceSendFields is a list of field names (e.g. "Day") to unconditionally
2919 // include in API requests. By default, fields with empty or default values are
2920 // omitted from API requests. See
2921 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2922 // details.
2923 ForceSendFields []string `json:"-"`
2924 // NullFields is a list of field names (e.g. "Day") to include in API requests
2925 // with the JSON null value. By default, fields with empty values are omitted
2926 // from API requests. See
2927 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2928 NullFields []string `json:"-"`
2929 }
2930
2931 func (s GoogleTypeDate) MarshalJSON() ([]byte, error) {
2932 type NoMethod GoogleTypeDate
2933 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2934 }
2935
2936 type LabelsCreateCall struct {
2937 s *Service
2938 googleappsdrivelabelsv2label *GoogleAppsDriveLabelsV2Label
2939 urlParams_ gensupport.URLParams
2940 ctx_ context.Context
2941 header_ http.Header
2942 }
2943
2944 // Create: Creates a label. For more information, see Create and publish a
2945 // label
2946 // (https://developers.google.com/workspace/drive/labels/guides/create-label).
2947 func (r *LabelsService) Create(googleappsdrivelabelsv2label *GoogleAppsDriveLabelsV2Label) *LabelsCreateCall {
2948 c := &LabelsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2949 c.googleappsdrivelabelsv2label = googleappsdrivelabelsv2label
2950 return c
2951 }
2952
2953 // LanguageCode sets the optional parameter "languageCode": The BCP-47 language
2954 // code to use for evaluating localized field labels in response. When not
2955 // specified, values in the default configured language will be used.
2956 func (c *LabelsCreateCall) LanguageCode(languageCode string) *LabelsCreateCall {
2957 c.urlParams_.Set("languageCode", languageCode)
2958 return c
2959 }
2960
2961 // UseAdminAccess sets the optional parameter "useAdminAccess": Set to `true`
2962 // in order to use the user's admin privileges. The server will verify the user
2963 // is an admin before allowing access.
2964 func (c *LabelsCreateCall) UseAdminAccess(useAdminAccess bool) *LabelsCreateCall {
2965 c.urlParams_.Set("useAdminAccess", fmt.Sprint(useAdminAccess))
2966 return c
2967 }
2968
2969 // Fields allows partial responses to be retrieved. See
2970 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2971 // details.
2972 func (c *LabelsCreateCall) Fields(s ...googleapi.Field) *LabelsCreateCall {
2973 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2974 return c
2975 }
2976
2977 // Context sets the context to be used in this call's Do method.
2978 func (c *LabelsCreateCall) Context(ctx context.Context) *LabelsCreateCall {
2979 c.ctx_ = ctx
2980 return c
2981 }
2982
2983 // Header returns a http.Header that can be modified by the caller to add
2984 // headers to the request.
2985 func (c *LabelsCreateCall) Header() http.Header {
2986 if c.header_ == nil {
2987 c.header_ = make(http.Header)
2988 }
2989 return c.header_
2990 }
2991
2992 func (c *LabelsCreateCall) doRequest(alt string) (*http.Response, error) {
2993 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2994 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2label)
2995 if err != nil {
2996 return nil, err
2997 }
2998 c.urlParams_.Set("alt", alt)
2999 c.urlParams_.Set("prettyPrint", "false")
3000 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/labels")
3001 urls += "?" + c.urlParams_.Encode()
3002 req, err := http.NewRequest("POST", urls, body)
3003 if err != nil {
3004 return nil, err
3005 }
3006 req.Header = reqHeaders
3007 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.create", "request", internallog.HTTPRequest(req, body.Bytes()))
3008 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3009 }
3010
3011 // Do executes the "drivelabels.labels.create" call.
3012 // Any non-2xx status code is an error. Response headers are in either
3013 // *GoogleAppsDriveLabelsV2Label.ServerResponse.Header or (if a response was
3014 // returned at all) in error.(*googleapi.Error).Header. Use
3015 // googleapi.IsNotModified to check whether the returned error was because
3016 // http.StatusNotModified was returned.
3017 func (c *LabelsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleAppsDriveLabelsV2Label, error) {
3018 gensupport.SetOptions(c.urlParams_, opts...)
3019 res, err := c.doRequest("json")
3020 if res != nil && res.StatusCode == http.StatusNotModified {
3021 if res.Body != nil {
3022 res.Body.Close()
3023 }
3024 return nil, gensupport.WrapError(&googleapi.Error{
3025 Code: res.StatusCode,
3026 Header: res.Header,
3027 })
3028 }
3029 if err != nil {
3030 return nil, err
3031 }
3032 defer googleapi.CloseBody(res)
3033 if err := googleapi.CheckResponse(res); err != nil {
3034 return nil, gensupport.WrapError(err)
3035 }
3036 ret := &GoogleAppsDriveLabelsV2Label{
3037 ServerResponse: googleapi.ServerResponse{
3038 Header: res.Header,
3039 HTTPStatusCode: res.StatusCode,
3040 },
3041 }
3042 target := &ret
3043 b, err := gensupport.DecodeResponseBytes(target, res)
3044 if err != nil {
3045 return nil, err
3046 }
3047 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.create", "response", internallog.HTTPResponse(res, b))
3048 return ret, nil
3049 }
3050
3051 type LabelsDeleteCall struct {
3052 s *Service
3053 name string
3054 urlParams_ gensupport.URLParams
3055 ctx_ context.Context
3056 header_ http.Header
3057 }
3058
3059 // Delete: Permanently deletes a label and related metadata on Drive items. For
3060 // more information, see Disable, enable, and delete a label
3061 // (https://developers.google.com/workspace/drive/labels/guides/disable-delete-label).
3062 // Once deleted, the label and related Drive item metadata will be deleted.
3063 // Only draft labels and disabled labels may be deleted.
3064 //
3065 // - name: Label resource name.
3066 func (r *LabelsService) Delete(name string) *LabelsDeleteCall {
3067 c := &LabelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3068 c.name = name
3069 return c
3070 }
3071
3072 // UseAdminAccess sets the optional parameter "useAdminAccess": Set to `true`
3073 // in order to use the user's admin credentials. The server will verify the
3074 // user is an admin for the label before allowing access.
3075 func (c *LabelsDeleteCall) UseAdminAccess(useAdminAccess bool) *LabelsDeleteCall {
3076 c.urlParams_.Set("useAdminAccess", fmt.Sprint(useAdminAccess))
3077 return c
3078 }
3079
3080 // WriteControlRequiredRevisionId sets the optional parameter
3081 // "writeControl.requiredRevisionId": The revision ID of the label that the
3082 // write request will be applied to. If this isn't the latest revision of the
3083 // label, the request will not be processed and will return a 400 Bad Request
3084 // error.
3085 func (c *LabelsDeleteCall) WriteControlRequiredRevisionId(writeControlRequiredRevisionId string) *LabelsDeleteCall {
3086 c.urlParams_.Set("writeControl.requiredRevisionId", writeControlRequiredRevisionId)
3087 return c
3088 }
3089
3090 // Fields allows partial responses to be retrieved. See
3091 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3092 // details.
3093 func (c *LabelsDeleteCall) Fields(s ...googleapi.Field) *LabelsDeleteCall {
3094 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3095 return c
3096 }
3097
3098 // Context sets the context to be used in this call's Do method.
3099 func (c *LabelsDeleteCall) Context(ctx context.Context) *LabelsDeleteCall {
3100 c.ctx_ = ctx
3101 return c
3102 }
3103
3104 // Header returns a http.Header that can be modified by the caller to add
3105 // headers to the request.
3106 func (c *LabelsDeleteCall) Header() http.Header {
3107 if c.header_ == nil {
3108 c.header_ = make(http.Header)
3109 }
3110 return c.header_
3111 }
3112
3113 func (c *LabelsDeleteCall) doRequest(alt string) (*http.Response, error) {
3114 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3115 c.urlParams_.Set("alt", alt)
3116 c.urlParams_.Set("prettyPrint", "false")
3117 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
3118 urls += "?" + c.urlParams_.Encode()
3119 req, err := http.NewRequest("DELETE", urls, nil)
3120 if err != nil {
3121 return nil, err
3122 }
3123 req.Header = reqHeaders
3124 googleapi.Expand(req.URL, map[string]string{
3125 "name": c.name,
3126 })
3127 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.delete", "request", internallog.HTTPRequest(req, nil))
3128 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3129 }
3130
3131 // Do executes the "drivelabels.labels.delete" call.
3132 // Any non-2xx status code is an error. Response headers are in either
3133 // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at
3134 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3135 // check whether the returned error was because http.StatusNotModified was
3136 // returned.
3137 func (c *LabelsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
3138 gensupport.SetOptions(c.urlParams_, opts...)
3139 res, err := c.doRequest("json")
3140 if res != nil && res.StatusCode == http.StatusNotModified {
3141 if res.Body != nil {
3142 res.Body.Close()
3143 }
3144 return nil, gensupport.WrapError(&googleapi.Error{
3145 Code: res.StatusCode,
3146 Header: res.Header,
3147 })
3148 }
3149 if err != nil {
3150 return nil, err
3151 }
3152 defer googleapi.CloseBody(res)
3153 if err := googleapi.CheckResponse(res); err != nil {
3154 return nil, gensupport.WrapError(err)
3155 }
3156 ret := &GoogleProtobufEmpty{
3157 ServerResponse: googleapi.ServerResponse{
3158 Header: res.Header,
3159 HTTPStatusCode: res.StatusCode,
3160 },
3161 }
3162 target := &ret
3163 b, err := gensupport.DecodeResponseBytes(target, res)
3164 if err != nil {
3165 return nil, err
3166 }
3167 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.delete", "response", internallog.HTTPResponse(res, b))
3168 return ret, nil
3169 }
3170
3171 type LabelsDeltaCall struct {
3172 s *Service
3173 name string
3174 googleappsdrivelabelsv2deltaupdatelabelrequest *GoogleAppsDriveLabelsV2DeltaUpdateLabelRequest
3175 urlParams_ gensupport.URLParams
3176 ctx_ context.Context
3177 header_ http.Header
3178 }
3179
3180 // Delta: Updates a single label by applying a set of update requests resulting
3181 // in a new draft revision. For more information, see Update a label
3182 // (https://developers.google.com/workspace/drive/labels/guides/update-label).
3183 // The batch update is all-or-nothing: If any of the update requests are
3184 // invalid, no changes are applied. The resulting draft revision must be
3185 // published before the changes may be used with Drive items.
3186 //
3187 // - name: The resource name of the label to update.
3188 func (r *LabelsService) Delta(name string, googleappsdrivelabelsv2deltaupdatelabelrequest *GoogleAppsDriveLabelsV2DeltaUpdateLabelRequest) *LabelsDeltaCall {
3189 c := &LabelsDeltaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3190 c.name = name
3191 c.googleappsdrivelabelsv2deltaupdatelabelrequest = googleappsdrivelabelsv2deltaupdatelabelrequest
3192 return c
3193 }
3194
3195 // Fields allows partial responses to be retrieved. See
3196 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3197 // details.
3198 func (c *LabelsDeltaCall) Fields(s ...googleapi.Field) *LabelsDeltaCall {
3199 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3200 return c
3201 }
3202
3203 // Context sets the context to be used in this call's Do method.
3204 func (c *LabelsDeltaCall) Context(ctx context.Context) *LabelsDeltaCall {
3205 c.ctx_ = ctx
3206 return c
3207 }
3208
3209 // Header returns a http.Header that can be modified by the caller to add
3210 // headers to the request.
3211 func (c *LabelsDeltaCall) Header() http.Header {
3212 if c.header_ == nil {
3213 c.header_ = make(http.Header)
3214 }
3215 return c.header_
3216 }
3217
3218 func (c *LabelsDeltaCall) doRequest(alt string) (*http.Response, error) {
3219 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3220 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2deltaupdatelabelrequest)
3221 if err != nil {
3222 return nil, err
3223 }
3224 c.urlParams_.Set("alt", alt)
3225 c.urlParams_.Set("prettyPrint", "false")
3226 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:delta")
3227 urls += "?" + c.urlParams_.Encode()
3228 req, err := http.NewRequest("POST", urls, body)
3229 if err != nil {
3230 return nil, err
3231 }
3232 req.Header = reqHeaders
3233 googleapi.Expand(req.URL, map[string]string{
3234 "name": c.name,
3235 })
3236 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.delta", "request", internallog.HTTPRequest(req, body.Bytes()))
3237 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3238 }
3239
3240 // Do executes the "drivelabels.labels.delta" call.
3241 // Any non-2xx status code is an error. Response headers are in either
3242 // *GoogleAppsDriveLabelsV2DeltaUpdateLabelResponse.ServerResponse.Header or
3243 // (if a response was returned at all) in error.(*googleapi.Error).Header. Use
3244 // googleapi.IsNotModified to check whether the returned error was because
3245 // http.StatusNotModified was returned.
3246 func (c *LabelsDeltaCall) Do(opts ...googleapi.CallOption) (*GoogleAppsDriveLabelsV2DeltaUpdateLabelResponse, error) {
3247 gensupport.SetOptions(c.urlParams_, opts...)
3248 res, err := c.doRequest("json")
3249 if res != nil && res.StatusCode == http.StatusNotModified {
3250 if res.Body != nil {
3251 res.Body.Close()
3252 }
3253 return nil, gensupport.WrapError(&googleapi.Error{
3254 Code: res.StatusCode,
3255 Header: res.Header,
3256 })
3257 }
3258 if err != nil {
3259 return nil, err
3260 }
3261 defer googleapi.CloseBody(res)
3262 if err := googleapi.CheckResponse(res); err != nil {
3263 return nil, gensupport.WrapError(err)
3264 }
3265 ret := &GoogleAppsDriveLabelsV2DeltaUpdateLabelResponse{
3266 ServerResponse: googleapi.ServerResponse{
3267 Header: res.Header,
3268 HTTPStatusCode: res.StatusCode,
3269 },
3270 }
3271 target := &ret
3272 b, err := gensupport.DecodeResponseBytes(target, res)
3273 if err != nil {
3274 return nil, err
3275 }
3276 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.delta", "response", internallog.HTTPResponse(res, b))
3277 return ret, nil
3278 }
3279
3280 type LabelsDisableCall struct {
3281 s *Service
3282 name string
3283 googleappsdrivelabelsv2disablelabelrequest *GoogleAppsDriveLabelsV2DisableLabelRequest
3284 urlParams_ gensupport.URLParams
3285 ctx_ context.Context
3286 header_ http.Header
3287 }
3288
3289 // Disable: Disable a published label. For more information, see Disable,
3290 // enable, and delete a label
3291 // (https://developers.google.com/workspace/drive/labels/guides/disable-delete-label).
3292 // Disabling a label will result in a new disabled published revision based on
3293 // the current published revision. If there's a draft revision, a new disabled
3294 // draft revision will be created based on the latest draft revision. Older
3295 // draft revisions will be deleted. Once disabled, a label may be deleted with
3296 // `DeleteLabel`.
3297 //
3298 // - name: Label resource name.
3299 func (r *LabelsService) Disable(name string, googleappsdrivelabelsv2disablelabelrequest *GoogleAppsDriveLabelsV2DisableLabelRequest) *LabelsDisableCall {
3300 c := &LabelsDisableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3301 c.name = name
3302 c.googleappsdrivelabelsv2disablelabelrequest = googleappsdrivelabelsv2disablelabelrequest
3303 return c
3304 }
3305
3306 // Fields allows partial responses to be retrieved. See
3307 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3308 // details.
3309 func (c *LabelsDisableCall) Fields(s ...googleapi.Field) *LabelsDisableCall {
3310 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3311 return c
3312 }
3313
3314 // Context sets the context to be used in this call's Do method.
3315 func (c *LabelsDisableCall) Context(ctx context.Context) *LabelsDisableCall {
3316 c.ctx_ = ctx
3317 return c
3318 }
3319
3320 // Header returns a http.Header that can be modified by the caller to add
3321 // headers to the request.
3322 func (c *LabelsDisableCall) Header() http.Header {
3323 if c.header_ == nil {
3324 c.header_ = make(http.Header)
3325 }
3326 return c.header_
3327 }
3328
3329 func (c *LabelsDisableCall) doRequest(alt string) (*http.Response, error) {
3330 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3331 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2disablelabelrequest)
3332 if err != nil {
3333 return nil, err
3334 }
3335 c.urlParams_.Set("alt", alt)
3336 c.urlParams_.Set("prettyPrint", "false")
3337 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:disable")
3338 urls += "?" + c.urlParams_.Encode()
3339 req, err := http.NewRequest("POST", urls, body)
3340 if err != nil {
3341 return nil, err
3342 }
3343 req.Header = reqHeaders
3344 googleapi.Expand(req.URL, map[string]string{
3345 "name": c.name,
3346 })
3347 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.disable", "request", internallog.HTTPRequest(req, body.Bytes()))
3348 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3349 }
3350
3351 // Do executes the "drivelabels.labels.disable" call.
3352 // Any non-2xx status code is an error. Response headers are in either
3353 // *GoogleAppsDriveLabelsV2Label.ServerResponse.Header or (if a response was
3354 // returned at all) in error.(*googleapi.Error).Header. Use
3355 // googleapi.IsNotModified to check whether the returned error was because
3356 // http.StatusNotModified was returned.
3357 func (c *LabelsDisableCall) Do(opts ...googleapi.CallOption) (*GoogleAppsDriveLabelsV2Label, error) {
3358 gensupport.SetOptions(c.urlParams_, opts...)
3359 res, err := c.doRequest("json")
3360 if res != nil && res.StatusCode == http.StatusNotModified {
3361 if res.Body != nil {
3362 res.Body.Close()
3363 }
3364 return nil, gensupport.WrapError(&googleapi.Error{
3365 Code: res.StatusCode,
3366 Header: res.Header,
3367 })
3368 }
3369 if err != nil {
3370 return nil, err
3371 }
3372 defer googleapi.CloseBody(res)
3373 if err := googleapi.CheckResponse(res); err != nil {
3374 return nil, gensupport.WrapError(err)
3375 }
3376 ret := &GoogleAppsDriveLabelsV2Label{
3377 ServerResponse: googleapi.ServerResponse{
3378 Header: res.Header,
3379 HTTPStatusCode: res.StatusCode,
3380 },
3381 }
3382 target := &ret
3383 b, err := gensupport.DecodeResponseBytes(target, res)
3384 if err != nil {
3385 return nil, err
3386 }
3387 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.disable", "response", internallog.HTTPResponse(res, b))
3388 return ret, nil
3389 }
3390
3391 type LabelsEnableCall struct {
3392 s *Service
3393 name string
3394 googleappsdrivelabelsv2enablelabelrequest *GoogleAppsDriveLabelsV2EnableLabelRequest
3395 urlParams_ gensupport.URLParams
3396 ctx_ context.Context
3397 header_ http.Header
3398 }
3399
3400 // Enable: Enable a disabled label and restore it to its published state. For
3401 // more information, see Disable, enable, and delete a label
3402 // (https://developers.google.com/workspace/drive/labels/guides/disable-delete-label).
3403 // This will result in a new published revision based on the current disabled
3404 // published revision. If there's an existing disabled draft revision, a new
3405 // revision will be created based on that draft and will be enabled.
3406 //
3407 // - name: Label resource name.
3408 func (r *LabelsService) Enable(name string, googleappsdrivelabelsv2enablelabelrequest *GoogleAppsDriveLabelsV2EnableLabelRequest) *LabelsEnableCall {
3409 c := &LabelsEnableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3410 c.name = name
3411 c.googleappsdrivelabelsv2enablelabelrequest = googleappsdrivelabelsv2enablelabelrequest
3412 return c
3413 }
3414
3415 // Fields allows partial responses to be retrieved. See
3416 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3417 // details.
3418 func (c *LabelsEnableCall) Fields(s ...googleapi.Field) *LabelsEnableCall {
3419 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3420 return c
3421 }
3422
3423 // Context sets the context to be used in this call's Do method.
3424 func (c *LabelsEnableCall) Context(ctx context.Context) *LabelsEnableCall {
3425 c.ctx_ = ctx
3426 return c
3427 }
3428
3429 // Header returns a http.Header that can be modified by the caller to add
3430 // headers to the request.
3431 func (c *LabelsEnableCall) Header() http.Header {
3432 if c.header_ == nil {
3433 c.header_ = make(http.Header)
3434 }
3435 return c.header_
3436 }
3437
3438 func (c *LabelsEnableCall) doRequest(alt string) (*http.Response, error) {
3439 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3440 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2enablelabelrequest)
3441 if err != nil {
3442 return nil, err
3443 }
3444 c.urlParams_.Set("alt", alt)
3445 c.urlParams_.Set("prettyPrint", "false")
3446 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:enable")
3447 urls += "?" + c.urlParams_.Encode()
3448 req, err := http.NewRequest("POST", urls, body)
3449 if err != nil {
3450 return nil, err
3451 }
3452 req.Header = reqHeaders
3453 googleapi.Expand(req.URL, map[string]string{
3454 "name": c.name,
3455 })
3456 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.enable", "request", internallog.HTTPRequest(req, body.Bytes()))
3457 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3458 }
3459
3460 // Do executes the "drivelabels.labels.enable" call.
3461 // Any non-2xx status code is an error. Response headers are in either
3462 // *GoogleAppsDriveLabelsV2Label.ServerResponse.Header or (if a response was
3463 // returned at all) in error.(*googleapi.Error).Header. Use
3464 // googleapi.IsNotModified to check whether the returned error was because
3465 // http.StatusNotModified was returned.
3466 func (c *LabelsEnableCall) Do(opts ...googleapi.CallOption) (*GoogleAppsDriveLabelsV2Label, error) {
3467 gensupport.SetOptions(c.urlParams_, opts...)
3468 res, err := c.doRequest("json")
3469 if res != nil && res.StatusCode == http.StatusNotModified {
3470 if res.Body != nil {
3471 res.Body.Close()
3472 }
3473 return nil, gensupport.WrapError(&googleapi.Error{
3474 Code: res.StatusCode,
3475 Header: res.Header,
3476 })
3477 }
3478 if err != nil {
3479 return nil, err
3480 }
3481 defer googleapi.CloseBody(res)
3482 if err := googleapi.CheckResponse(res); err != nil {
3483 return nil, gensupport.WrapError(err)
3484 }
3485 ret := &GoogleAppsDriveLabelsV2Label{
3486 ServerResponse: googleapi.ServerResponse{
3487 Header: res.Header,
3488 HTTPStatusCode: res.StatusCode,
3489 },
3490 }
3491 target := &ret
3492 b, err := gensupport.DecodeResponseBytes(target, res)
3493 if err != nil {
3494 return nil, err
3495 }
3496 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.enable", "response", internallog.HTTPResponse(res, b))
3497 return ret, nil
3498 }
3499
3500 type LabelsGetCall struct {
3501 s *Service
3502 name string
3503 urlParams_ gensupport.URLParams
3504 ifNoneMatch_ string
3505 ctx_ context.Context
3506 header_ http.Header
3507 }
3508
3509 // Get: Get a label by its resource name. For more information, see Search for
3510 // labels
3511 // (https://developers.google.com/workspace/drive/labels/guides/search-label).
3512 // Resource name may be any of: * `labels/{id}` - See `labels/{id}@latest` *
3513 // `labels/{id}@latest` - Gets the latest revision of the label. *
3514 // `labels/{id}@published` - Gets the current published revision of the label.
3515 // * `labels/{id}@{revision_id}` - Gets the label at the specified revision ID.
3516 //
3517 // - name: Label resource name. May be any of: * `labels/{id}` (equivalent to
3518 // labels/{id}@latest) * `labels/{id}@latest` * `labels/{id}@published` *
3519 // `labels/{id}@{revision_id}`.
3520 func (r *LabelsService) Get(name string) *LabelsGetCall {
3521 c := &LabelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3522 c.name = name
3523 return c
3524 }
3525
3526 // LanguageCode sets the optional parameter "languageCode": The BCP-47 language
3527 // code to use for evaluating localized field labels. When not specified,
3528 // values in the default configured language are used.
3529 func (c *LabelsGetCall) LanguageCode(languageCode string) *LabelsGetCall {
3530 c.urlParams_.Set("languageCode", languageCode)
3531 return c
3532 }
3533
3534 // UseAdminAccess sets the optional parameter "useAdminAccess": Set to `true`
3535 // in order to use the user's admin credentials. The server verifies that the
3536 // user is an admin for the label before allowing access.
3537 func (c *LabelsGetCall) UseAdminAccess(useAdminAccess bool) *LabelsGetCall {
3538 c.urlParams_.Set("useAdminAccess", fmt.Sprint(useAdminAccess))
3539 return c
3540 }
3541
3542 // View sets the optional parameter "view": When specified, only certain fields
3543 // belonging to the indicated view are returned.
3544 //
3545 // Possible values:
3546 //
3547 // "LABEL_VIEW_BASIC" - Implies the field mask:
3548 //
3549 // `name,id,revision_id,label_type,properties.*`
3550 //
3551 // "LABEL_VIEW_FULL" - All possible fields.
3552 func (c *LabelsGetCall) View(view string) *LabelsGetCall {
3553 c.urlParams_.Set("view", view)
3554 return c
3555 }
3556
3557 // Fields allows partial responses to be retrieved. See
3558 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3559 // details.
3560 func (c *LabelsGetCall) Fields(s ...googleapi.Field) *LabelsGetCall {
3561 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3562 return c
3563 }
3564
3565 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3566 // object's ETag matches the given value. This is useful for getting updates
3567 // only after the object has changed since the last request.
3568 func (c *LabelsGetCall) IfNoneMatch(entityTag string) *LabelsGetCall {
3569 c.ifNoneMatch_ = entityTag
3570 return c
3571 }
3572
3573 // Context sets the context to be used in this call's Do method.
3574 func (c *LabelsGetCall) Context(ctx context.Context) *LabelsGetCall {
3575 c.ctx_ = ctx
3576 return c
3577 }
3578
3579 // Header returns a http.Header that can be modified by the caller to add
3580 // headers to the request.
3581 func (c *LabelsGetCall) Header() http.Header {
3582 if c.header_ == nil {
3583 c.header_ = make(http.Header)
3584 }
3585 return c.header_
3586 }
3587
3588 func (c *LabelsGetCall) doRequest(alt string) (*http.Response, error) {
3589 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3590 if c.ifNoneMatch_ != "" {
3591 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3592 }
3593 c.urlParams_.Set("alt", alt)
3594 c.urlParams_.Set("prettyPrint", "false")
3595 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
3596 urls += "?" + c.urlParams_.Encode()
3597 req, err := http.NewRequest("GET", urls, nil)
3598 if err != nil {
3599 return nil, err
3600 }
3601 req.Header = reqHeaders
3602 googleapi.Expand(req.URL, map[string]string{
3603 "name": c.name,
3604 })
3605 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.get", "request", internallog.HTTPRequest(req, nil))
3606 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3607 }
3608
3609 // Do executes the "drivelabels.labels.get" call.
3610 // Any non-2xx status code is an error. Response headers are in either
3611 // *GoogleAppsDriveLabelsV2Label.ServerResponse.Header or (if a response was
3612 // returned at all) in error.(*googleapi.Error).Header. Use
3613 // googleapi.IsNotModified to check whether the returned error was because
3614 // http.StatusNotModified was returned.
3615 func (c *LabelsGetCall) Do(opts ...googleapi.CallOption) (*GoogleAppsDriveLabelsV2Label, error) {
3616 gensupport.SetOptions(c.urlParams_, opts...)
3617 res, err := c.doRequest("json")
3618 if res != nil && res.StatusCode == http.StatusNotModified {
3619 if res.Body != nil {
3620 res.Body.Close()
3621 }
3622 return nil, gensupport.WrapError(&googleapi.Error{
3623 Code: res.StatusCode,
3624 Header: res.Header,
3625 })
3626 }
3627 if err != nil {
3628 return nil, err
3629 }
3630 defer googleapi.CloseBody(res)
3631 if err := googleapi.CheckResponse(res); err != nil {
3632 return nil, gensupport.WrapError(err)
3633 }
3634 ret := &GoogleAppsDriveLabelsV2Label{
3635 ServerResponse: googleapi.ServerResponse{
3636 Header: res.Header,
3637 HTTPStatusCode: res.StatusCode,
3638 },
3639 }
3640 target := &ret
3641 b, err := gensupport.DecodeResponseBytes(target, res)
3642 if err != nil {
3643 return nil, err
3644 }
3645 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.get", "response", internallog.HTTPResponse(res, b))
3646 return ret, nil
3647 }
3648
3649 type LabelsListCall struct {
3650 s *Service
3651 urlParams_ gensupport.URLParams
3652 ifNoneMatch_ string
3653 ctx_ context.Context
3654 header_ http.Header
3655 }
3656
3657 // List: List labels. For more information, see Search for labels
3658 // (https://developers.google.com/workspace/drive/labels/guides/search-label).
3659 func (r *LabelsService) List() *LabelsListCall {
3660 c := &LabelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3661 return c
3662 }
3663
3664 // Customer sets the optional parameter "customer": The customer to scope this
3665 // list request to. For example: `customers/abcd1234`. If unset, will return
3666 // all labels within the current customer.
3667 func (c *LabelsListCall) Customer(customer string) *LabelsListCall {
3668 c.urlParams_.Set("customer", customer)
3669 return c
3670 }
3671
3672 // LanguageCode sets the optional parameter "languageCode": The BCP-47 language
3673 // code to use for evaluating localized field labels. When not specified,
3674 // values in the default configured language are used.
3675 func (c *LabelsListCall) LanguageCode(languageCode string) *LabelsListCall {
3676 c.urlParams_.Set("languageCode", languageCode)
3677 return c
3678 }
3679
3680 // MinimumRole sets the optional parameter "minimumRole": Specifies the level
3681 // of access the user must have on the returned labels. The minimum role a user
3682 // must have on a label. Defaults to `READER`.
3683 //
3684 // Possible values:
3685 //
3686 // "LABEL_ROLE_UNSPECIFIED" - Unknown role.
3687 // "READER" - A reader can read the label and associated metadata applied to
3688 //
3689 // Drive items.
3690 //
3691 // "APPLIER" - An applier can write associated metadata on Drive items in
3692 //
3693 // which they also have write access to. Implies `READER`.
3694 //
3695 // "ORGANIZER" - An organizer can pin this label in shared drives they manage
3696 //
3697 // and add new appliers to the label.
3698 //
3699 // "EDITOR" - Editors can make any update including deleting the label which
3700 //
3701 // also deletes the associated Drive item metadata. Implies `APPLIER`.
3702 func (c *LabelsListCall) MinimumRole(minimumRole string) *LabelsListCall {
3703 c.urlParams_.Set("minimumRole", minimumRole)
3704 return c
3705 }
3706
3707 // PageSize sets the optional parameter "pageSize": Maximum number of labels to
3708 // return per page. Default: 50. Max: 200.
3709 func (c *LabelsListCall) PageSize(pageSize int64) *LabelsListCall {
3710 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3711 return c
3712 }
3713
3714 // PageToken sets the optional parameter "pageToken": The token of the page to
3715 // return.
3716 func (c *LabelsListCall) PageToken(pageToken string) *LabelsListCall {
3717 c.urlParams_.Set("pageToken", pageToken)
3718 return c
3719 }
3720
3721 // PublishedOnly sets the optional parameter "publishedOnly": Whether to
3722 // include only published labels in the results. * When `true`, only the
3723 // current published label revisions are returned. Disabled labels are
3724 // included. Returned label resource names reference the published revision
3725 // (`labels/{id}/{revision_id}`). * When `false`, the current label revisions
3726 // are returned, which might not be published. Returned label resource names
3727 // don't reference a specific revision (`labels/{id}`).
3728 func (c *LabelsListCall) PublishedOnly(publishedOnly bool) *LabelsListCall {
3729 c.urlParams_.Set("publishedOnly", fmt.Sprint(publishedOnly))
3730 return c
3731 }
3732
3733 // UseAdminAccess sets the optional parameter "useAdminAccess": Set to `true`
3734 // in order to use the user's admin credentials. This will return all labels
3735 // within the customer.
3736 func (c *LabelsListCall) UseAdminAccess(useAdminAccess bool) *LabelsListCall {
3737 c.urlParams_.Set("useAdminAccess", fmt.Sprint(useAdminAccess))
3738 return c
3739 }
3740
3741 // View sets the optional parameter "view": When specified, only certain fields
3742 // belonging to the indicated view are returned.
3743 //
3744 // Possible values:
3745 //
3746 // "LABEL_VIEW_BASIC" - Implies the field mask:
3747 //
3748 // `name,id,revision_id,label_type,properties.*`
3749 //
3750 // "LABEL_VIEW_FULL" - All possible fields.
3751 func (c *LabelsListCall) View(view string) *LabelsListCall {
3752 c.urlParams_.Set("view", view)
3753 return c
3754 }
3755
3756 // Fields allows partial responses to be retrieved. See
3757 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3758 // details.
3759 func (c *LabelsListCall) Fields(s ...googleapi.Field) *LabelsListCall {
3760 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3761 return c
3762 }
3763
3764 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3765 // object's ETag matches the given value. This is useful for getting updates
3766 // only after the object has changed since the last request.
3767 func (c *LabelsListCall) IfNoneMatch(entityTag string) *LabelsListCall {
3768 c.ifNoneMatch_ = entityTag
3769 return c
3770 }
3771
3772 // Context sets the context to be used in this call's Do method.
3773 func (c *LabelsListCall) Context(ctx context.Context) *LabelsListCall {
3774 c.ctx_ = ctx
3775 return c
3776 }
3777
3778 // Header returns a http.Header that can be modified by the caller to add
3779 // headers to the request.
3780 func (c *LabelsListCall) Header() http.Header {
3781 if c.header_ == nil {
3782 c.header_ = make(http.Header)
3783 }
3784 return c.header_
3785 }
3786
3787 func (c *LabelsListCall) doRequest(alt string) (*http.Response, error) {
3788 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3789 if c.ifNoneMatch_ != "" {
3790 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3791 }
3792 c.urlParams_.Set("alt", alt)
3793 c.urlParams_.Set("prettyPrint", "false")
3794 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/labels")
3795 urls += "?" + c.urlParams_.Encode()
3796 req, err := http.NewRequest("GET", urls, nil)
3797 if err != nil {
3798 return nil, err
3799 }
3800 req.Header = reqHeaders
3801 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.list", "request", internallog.HTTPRequest(req, nil))
3802 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3803 }
3804
3805 // Do executes the "drivelabels.labels.list" call.
3806 // Any non-2xx status code is an error. Response headers are in either
3807 // *GoogleAppsDriveLabelsV2ListLabelsResponse.ServerResponse.Header or (if a
3808 // response was returned at all) in error.(*googleapi.Error).Header. Use
3809 // googleapi.IsNotModified to check whether the returned error was because
3810 // http.StatusNotModified was returned.
3811 func (c *LabelsListCall) Do(opts ...googleapi.CallOption) (*GoogleAppsDriveLabelsV2ListLabelsResponse, error) {
3812 gensupport.SetOptions(c.urlParams_, opts...)
3813 res, err := c.doRequest("json")
3814 if res != nil && res.StatusCode == http.StatusNotModified {
3815 if res.Body != nil {
3816 res.Body.Close()
3817 }
3818 return nil, gensupport.WrapError(&googleapi.Error{
3819 Code: res.StatusCode,
3820 Header: res.Header,
3821 })
3822 }
3823 if err != nil {
3824 return nil, err
3825 }
3826 defer googleapi.CloseBody(res)
3827 if err := googleapi.CheckResponse(res); err != nil {
3828 return nil, gensupport.WrapError(err)
3829 }
3830 ret := &GoogleAppsDriveLabelsV2ListLabelsResponse{
3831 ServerResponse: googleapi.ServerResponse{
3832 Header: res.Header,
3833 HTTPStatusCode: res.StatusCode,
3834 },
3835 }
3836 target := &ret
3837 b, err := gensupport.DecodeResponseBytes(target, res)
3838 if err != nil {
3839 return nil, err
3840 }
3841 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.list", "response", internallog.HTTPResponse(res, b))
3842 return ret, nil
3843 }
3844
3845 // Pages invokes f for each page of results.
3846 // A non-nil error returned from f will halt the iteration.
3847 // The provided context supersedes any context provided to the Context method.
3848 func (c *LabelsListCall) Pages(ctx context.Context, f func(*GoogleAppsDriveLabelsV2ListLabelsResponse) error) error {
3849 c.ctx_ = ctx
3850 defer c.PageToken(c.urlParams_.Get("pageToken"))
3851 for {
3852 x, err := c.Do()
3853 if err != nil {
3854 return err
3855 }
3856 if err := f(x); err != nil {
3857 return err
3858 }
3859 if x.NextPageToken == "" {
3860 return nil
3861 }
3862 c.PageToken(x.NextPageToken)
3863 }
3864 }
3865
3866 type LabelsPublishCall struct {
3867 s *Service
3868 name string
3869 googleappsdrivelabelsv2publishlabelrequest *GoogleAppsDriveLabelsV2PublishLabelRequest
3870 urlParams_ gensupport.URLParams
3871 ctx_ context.Context
3872 header_ http.Header
3873 }
3874
3875 // Publish: Publish all draft changes to the label. Once published, the label
3876 // may not return to its draft state. For more information, see Create and
3877 // publish a label
3878 // (https://developers.google.com/workspace/drive/labels/guides/create-label).
3879 // Publishing a label will result in a new published revision. All previous
3880 // draft revisions will be deleted. Previous published revisions will be kept
3881 // but are subject to automated deletion as needed. For more information, see
3882 // Label lifecycle
3883 // (https://developers.google.com/workspace/drive/labels/guides/label-lifecycle).
3884 // Once published, some changes are no longer permitted. Generally, any change
3885 // that would invalidate or cause new restrictions on existing metadata related
3886 // to the label will be rejected. For example, the following changes to a label
3887 // will be rejected after the label is published: * The label cannot be
3888 // directly deleted. It must be disabled first, then deleted. *
3889 // `Field.FieldType` cannot be changed. * Changes to field validation options
3890 // cannot reject something that was previously accepted. * Reducing the maximum
3891 // entries.
3892 //
3893 // - name: Label resource name.
3894 func (r *LabelsService) Publish(name string, googleappsdrivelabelsv2publishlabelrequest *GoogleAppsDriveLabelsV2PublishLabelRequest) *LabelsPublishCall {
3895 c := &LabelsPublishCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3896 c.name = name
3897 c.googleappsdrivelabelsv2publishlabelrequest = googleappsdrivelabelsv2publishlabelrequest
3898 return c
3899 }
3900
3901 // Fields allows partial responses to be retrieved. See
3902 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3903 // details.
3904 func (c *LabelsPublishCall) Fields(s ...googleapi.Field) *LabelsPublishCall {
3905 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3906 return c
3907 }
3908
3909 // Context sets the context to be used in this call's Do method.
3910 func (c *LabelsPublishCall) Context(ctx context.Context) *LabelsPublishCall {
3911 c.ctx_ = ctx
3912 return c
3913 }
3914
3915 // Header returns a http.Header that can be modified by the caller to add
3916 // headers to the request.
3917 func (c *LabelsPublishCall) Header() http.Header {
3918 if c.header_ == nil {
3919 c.header_ = make(http.Header)
3920 }
3921 return c.header_
3922 }
3923
3924 func (c *LabelsPublishCall) doRequest(alt string) (*http.Response, error) {
3925 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3926 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2publishlabelrequest)
3927 if err != nil {
3928 return nil, err
3929 }
3930 c.urlParams_.Set("alt", alt)
3931 c.urlParams_.Set("prettyPrint", "false")
3932 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:publish")
3933 urls += "?" + c.urlParams_.Encode()
3934 req, err := http.NewRequest("POST", urls, body)
3935 if err != nil {
3936 return nil, err
3937 }
3938 req.Header = reqHeaders
3939 googleapi.Expand(req.URL, map[string]string{
3940 "name": c.name,
3941 })
3942 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.publish", "request", internallog.HTTPRequest(req, body.Bytes()))
3943 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3944 }
3945
3946 // Do executes the "drivelabels.labels.publish" call.
3947 // Any non-2xx status code is an error. Response headers are in either
3948 // *GoogleAppsDriveLabelsV2Label.ServerResponse.Header or (if a response was
3949 // returned at all) in error.(*googleapi.Error).Header. Use
3950 // googleapi.IsNotModified to check whether the returned error was because
3951 // http.StatusNotModified was returned.
3952 func (c *LabelsPublishCall) Do(opts ...googleapi.CallOption) (*GoogleAppsDriveLabelsV2Label, error) {
3953 gensupport.SetOptions(c.urlParams_, opts...)
3954 res, err := c.doRequest("json")
3955 if res != nil && res.StatusCode == http.StatusNotModified {
3956 if res.Body != nil {
3957 res.Body.Close()
3958 }
3959 return nil, gensupport.WrapError(&googleapi.Error{
3960 Code: res.StatusCode,
3961 Header: res.Header,
3962 })
3963 }
3964 if err != nil {
3965 return nil, err
3966 }
3967 defer googleapi.CloseBody(res)
3968 if err := googleapi.CheckResponse(res); err != nil {
3969 return nil, gensupport.WrapError(err)
3970 }
3971 ret := &GoogleAppsDriveLabelsV2Label{
3972 ServerResponse: googleapi.ServerResponse{
3973 Header: res.Header,
3974 HTTPStatusCode: res.StatusCode,
3975 },
3976 }
3977 target := &ret
3978 b, err := gensupport.DecodeResponseBytes(target, res)
3979 if err != nil {
3980 return nil, err
3981 }
3982 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.publish", "response", internallog.HTTPResponse(res, b))
3983 return ret, nil
3984 }
3985
3986 type LabelsUpdateLabelCopyModeCall struct {
3987 s *Service
3988 name string
3989 googleappsdrivelabelsv2updatelabelcopymoderequest *GoogleAppsDriveLabelsV2UpdateLabelCopyModeRequest
3990 urlParams_ gensupport.URLParams
3991 ctx_ context.Context
3992 header_ http.Header
3993 }
3994
3995 // UpdateLabelCopyMode: Updates a label's `CopyMode`. Changes to this policy
3996 // aren't revisioned, don't require publishing, and take effect immediately.
3997 //
3998 // - name: The resource name of the label to update.
3999 func (r *LabelsService) UpdateLabelCopyMode(name string, googleappsdrivelabelsv2updatelabelcopymoderequest *GoogleAppsDriveLabelsV2UpdateLabelCopyModeRequest) *LabelsUpdateLabelCopyModeCall {
4000 c := &LabelsUpdateLabelCopyModeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4001 c.name = name
4002 c.googleappsdrivelabelsv2updatelabelcopymoderequest = googleappsdrivelabelsv2updatelabelcopymoderequest
4003 return c
4004 }
4005
4006 // Fields allows partial responses to be retrieved. See
4007 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4008 // details.
4009 func (c *LabelsUpdateLabelCopyModeCall) Fields(s ...googleapi.Field) *LabelsUpdateLabelCopyModeCall {
4010 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4011 return c
4012 }
4013
4014 // Context sets the context to be used in this call's Do method.
4015 func (c *LabelsUpdateLabelCopyModeCall) Context(ctx context.Context) *LabelsUpdateLabelCopyModeCall {
4016 c.ctx_ = ctx
4017 return c
4018 }
4019
4020 // Header returns a http.Header that can be modified by the caller to add
4021 // headers to the request.
4022 func (c *LabelsUpdateLabelCopyModeCall) Header() http.Header {
4023 if c.header_ == nil {
4024 c.header_ = make(http.Header)
4025 }
4026 return c.header_
4027 }
4028
4029 func (c *LabelsUpdateLabelCopyModeCall) doRequest(alt string) (*http.Response, error) {
4030 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4031 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2updatelabelcopymoderequest)
4032 if err != nil {
4033 return nil, err
4034 }
4035 c.urlParams_.Set("alt", alt)
4036 c.urlParams_.Set("prettyPrint", "false")
4037 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:updateLabelCopyMode")
4038 urls += "?" + c.urlParams_.Encode()
4039 req, err := http.NewRequest("POST", urls, body)
4040 if err != nil {
4041 return nil, err
4042 }
4043 req.Header = reqHeaders
4044 googleapi.Expand(req.URL, map[string]string{
4045 "name": c.name,
4046 })
4047 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.updateLabelCopyMode", "request", internallog.HTTPRequest(req, body.Bytes()))
4048 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4049 }
4050
4051 // Do executes the "drivelabels.labels.updateLabelCopyMode" call.
4052 // Any non-2xx status code is an error. Response headers are in either
4053 // *GoogleAppsDriveLabelsV2Label.ServerResponse.Header or (if a response was
4054 // returned at all) in error.(*googleapi.Error).Header. Use
4055 // googleapi.IsNotModified to check whether the returned error was because
4056 // http.StatusNotModified was returned.
4057 func (c *LabelsUpdateLabelCopyModeCall) Do(opts ...googleapi.CallOption) (*GoogleAppsDriveLabelsV2Label, error) {
4058 gensupport.SetOptions(c.urlParams_, opts...)
4059 res, err := c.doRequest("json")
4060 if res != nil && res.StatusCode == http.StatusNotModified {
4061 if res.Body != nil {
4062 res.Body.Close()
4063 }
4064 return nil, gensupport.WrapError(&googleapi.Error{
4065 Code: res.StatusCode,
4066 Header: res.Header,
4067 })
4068 }
4069 if err != nil {
4070 return nil, err
4071 }
4072 defer googleapi.CloseBody(res)
4073 if err := googleapi.CheckResponse(res); err != nil {
4074 return nil, gensupport.WrapError(err)
4075 }
4076 ret := &GoogleAppsDriveLabelsV2Label{
4077 ServerResponse: googleapi.ServerResponse{
4078 Header: res.Header,
4079 HTTPStatusCode: res.StatusCode,
4080 },
4081 }
4082 target := &ret
4083 b, err := gensupport.DecodeResponseBytes(target, res)
4084 if err != nil {
4085 return nil, err
4086 }
4087 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.updateLabelCopyMode", "response", internallog.HTTPResponse(res, b))
4088 return ret, nil
4089 }
4090
4091 type LabelsUpdateLabelEnabledAppSettingsCall struct {
4092 s *Service
4093 name string
4094 googleappsdrivelabelsv2updatelabelenabledappsettingsrequest *GoogleAppsDriveLabelsV2UpdateLabelEnabledAppSettingsRequest
4095 urlParams_ gensupport.URLParams
4096 ctx_ context.Context
4097 header_ http.Header
4098 }
4099
4100 // UpdateLabelEnabledAppSettings: Updates a label's `EnabledAppSettings`.
4101 // Enabling a label in a Google Workspace app allows it to be used in that app.
4102 // This change isn't revisioned, doesn't require publishing, and takes effect
4103 // immediately.
4104 //
4105 // - name: The resource name of the label to update. The resource name of the
4106 // label to update.
4107 func (r *LabelsService) UpdateLabelEnabledAppSettings(name string, googleappsdrivelabelsv2updatelabelenabledappsettingsrequest *GoogleAppsDriveLabelsV2UpdateLabelEnabledAppSettingsRequest) *LabelsUpdateLabelEnabledAppSettingsCall {
4108 c := &LabelsUpdateLabelEnabledAppSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4109 c.name = name
4110 c.googleappsdrivelabelsv2updatelabelenabledappsettingsrequest = googleappsdrivelabelsv2updatelabelenabledappsettingsrequest
4111 return c
4112 }
4113
4114 // Fields allows partial responses to be retrieved. See
4115 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4116 // details.
4117 func (c *LabelsUpdateLabelEnabledAppSettingsCall) Fields(s ...googleapi.Field) *LabelsUpdateLabelEnabledAppSettingsCall {
4118 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4119 return c
4120 }
4121
4122 // Context sets the context to be used in this call's Do method.
4123 func (c *LabelsUpdateLabelEnabledAppSettingsCall) Context(ctx context.Context) *LabelsUpdateLabelEnabledAppSettingsCall {
4124 c.ctx_ = ctx
4125 return c
4126 }
4127
4128 // Header returns a http.Header that can be modified by the caller to add
4129 // headers to the request.
4130 func (c *LabelsUpdateLabelEnabledAppSettingsCall) Header() http.Header {
4131 if c.header_ == nil {
4132 c.header_ = make(http.Header)
4133 }
4134 return c.header_
4135 }
4136
4137 func (c *LabelsUpdateLabelEnabledAppSettingsCall) doRequest(alt string) (*http.Response, error) {
4138 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4139 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2updatelabelenabledappsettingsrequest)
4140 if err != nil {
4141 return nil, err
4142 }
4143 c.urlParams_.Set("alt", alt)
4144 c.urlParams_.Set("prettyPrint", "false")
4145 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:updateLabelEnabledAppSettings")
4146 urls += "?" + c.urlParams_.Encode()
4147 req, err := http.NewRequest("POST", urls, body)
4148 if err != nil {
4149 return nil, err
4150 }
4151 req.Header = reqHeaders
4152 googleapi.Expand(req.URL, map[string]string{
4153 "name": c.name,
4154 })
4155 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.updateLabelEnabledAppSettings", "request", internallog.HTTPRequest(req, body.Bytes()))
4156 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4157 }
4158
4159 // Do executes the "drivelabels.labels.updateLabelEnabledAppSettings" call.
4160 // Any non-2xx status code is an error. Response headers are in either
4161 // *GoogleAppsDriveLabelsV2Label.ServerResponse.Header or (if a response was
4162 // returned at all) in error.(*googleapi.Error).Header. Use
4163 // googleapi.IsNotModified to check whether the returned error was because
4164 // http.StatusNotModified was returned.
4165 func (c *LabelsUpdateLabelEnabledAppSettingsCall) Do(opts ...googleapi.CallOption) (*GoogleAppsDriveLabelsV2Label, error) {
4166 gensupport.SetOptions(c.urlParams_, opts...)
4167 res, err := c.doRequest("json")
4168 if res != nil && res.StatusCode == http.StatusNotModified {
4169 if res.Body != nil {
4170 res.Body.Close()
4171 }
4172 return nil, gensupport.WrapError(&googleapi.Error{
4173 Code: res.StatusCode,
4174 Header: res.Header,
4175 })
4176 }
4177 if err != nil {
4178 return nil, err
4179 }
4180 defer googleapi.CloseBody(res)
4181 if err := googleapi.CheckResponse(res); err != nil {
4182 return nil, gensupport.WrapError(err)
4183 }
4184 ret := &GoogleAppsDriveLabelsV2Label{
4185 ServerResponse: googleapi.ServerResponse{
4186 Header: res.Header,
4187 HTTPStatusCode: res.StatusCode,
4188 },
4189 }
4190 target := &ret
4191 b, err := gensupport.DecodeResponseBytes(target, res)
4192 if err != nil {
4193 return nil, err
4194 }
4195 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.updateLabelEnabledAppSettings", "response", internallog.HTTPResponse(res, b))
4196 return ret, nil
4197 }
4198
4199 type LabelsUpdatePermissionsCall struct {
4200 s *Service
4201 parent string
4202 googleappsdrivelabelsv2labelpermission *GoogleAppsDriveLabelsV2LabelPermission
4203 urlParams_ gensupport.URLParams
4204 ctx_ context.Context
4205 header_ http.Header
4206 }
4207
4208 // UpdatePermissions: Updates a label's permissions. If a permission for the
4209 // indicated principal doesn't exist, a label permission is created, otherwise
4210 // the existing permission is updated. Permissions affect the label resource as
4211 // a whole, aren't revisioned, and don't require publishing.
4212 //
4213 // - parent: The parent label resource name.
4214 func (r *LabelsService) UpdatePermissions(parent string, googleappsdrivelabelsv2labelpermission *GoogleAppsDriveLabelsV2LabelPermission) *LabelsUpdatePermissionsCall {
4215 c := &LabelsUpdatePermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4216 c.parent = parent
4217 c.googleappsdrivelabelsv2labelpermission = googleappsdrivelabelsv2labelpermission
4218 return c
4219 }
4220
4221 // UseAdminAccess sets the optional parameter "useAdminAccess": Set to `true`
4222 // in order to use the user's admin credentials. The server will verify the
4223 // user is an admin for the label before allowing access.
4224 func (c *LabelsUpdatePermissionsCall) UseAdminAccess(useAdminAccess bool) *LabelsUpdatePermissionsCall {
4225 c.urlParams_.Set("useAdminAccess", fmt.Sprint(useAdminAccess))
4226 return c
4227 }
4228
4229 // Fields allows partial responses to be retrieved. See
4230 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4231 // details.
4232 func (c *LabelsUpdatePermissionsCall) Fields(s ...googleapi.Field) *LabelsUpdatePermissionsCall {
4233 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4234 return c
4235 }
4236
4237 // Context sets the context to be used in this call's Do method.
4238 func (c *LabelsUpdatePermissionsCall) Context(ctx context.Context) *LabelsUpdatePermissionsCall {
4239 c.ctx_ = ctx
4240 return c
4241 }
4242
4243 // Header returns a http.Header that can be modified by the caller to add
4244 // headers to the request.
4245 func (c *LabelsUpdatePermissionsCall) Header() http.Header {
4246 if c.header_ == nil {
4247 c.header_ = make(http.Header)
4248 }
4249 return c.header_
4250 }
4251
4252 func (c *LabelsUpdatePermissionsCall) doRequest(alt string) (*http.Response, error) {
4253 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4254 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2labelpermission)
4255 if err != nil {
4256 return nil, err
4257 }
4258 c.urlParams_.Set("alt", alt)
4259 c.urlParams_.Set("prettyPrint", "false")
4260 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/permissions")
4261 urls += "?" + c.urlParams_.Encode()
4262 req, err := http.NewRequest("PATCH", urls, body)
4263 if err != nil {
4264 return nil, err
4265 }
4266 req.Header = reqHeaders
4267 googleapi.Expand(req.URL, map[string]string{
4268 "parent": c.parent,
4269 })
4270 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.updatePermissions", "request", internallog.HTTPRequest(req, body.Bytes()))
4271 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4272 }
4273
4274 // Do executes the "drivelabels.labels.updatePermissions" call.
4275 // Any non-2xx status code is an error. Response headers are in either
4276 // *GoogleAppsDriveLabelsV2LabelPermission.ServerResponse.Header or (if a
4277 // response was returned at all) in error.(*googleapi.Error).Header. Use
4278 // googleapi.IsNotModified to check whether the returned error was because
4279 // http.StatusNotModified was returned.
4280 func (c *LabelsUpdatePermissionsCall) Do(opts ...googleapi.CallOption) (*GoogleAppsDriveLabelsV2LabelPermission, error) {
4281 gensupport.SetOptions(c.urlParams_, opts...)
4282 res, err := c.doRequest("json")
4283 if res != nil && res.StatusCode == http.StatusNotModified {
4284 if res.Body != nil {
4285 res.Body.Close()
4286 }
4287 return nil, gensupport.WrapError(&googleapi.Error{
4288 Code: res.StatusCode,
4289 Header: res.Header,
4290 })
4291 }
4292 if err != nil {
4293 return nil, err
4294 }
4295 defer googleapi.CloseBody(res)
4296 if err := googleapi.CheckResponse(res); err != nil {
4297 return nil, gensupport.WrapError(err)
4298 }
4299 ret := &GoogleAppsDriveLabelsV2LabelPermission{
4300 ServerResponse: googleapi.ServerResponse{
4301 Header: res.Header,
4302 HTTPStatusCode: res.StatusCode,
4303 },
4304 }
4305 target := &ret
4306 b, err := gensupport.DecodeResponseBytes(target, res)
4307 if err != nil {
4308 return nil, err
4309 }
4310 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.updatePermissions", "response", internallog.HTTPResponse(res, b))
4311 return ret, nil
4312 }
4313
4314 type LabelsLocksListCall struct {
4315 s *Service
4316 parent string
4317 urlParams_ gensupport.URLParams
4318 ifNoneMatch_ string
4319 ctx_ context.Context
4320 header_ http.Header
4321 }
4322
4323 // List: Lists the label locks on a label.
4324 //
4325 // - parent: Label on which locks are applied. Format: `labels/{label}`.
4326 func (r *LabelsLocksService) List(parent string) *LabelsLocksListCall {
4327 c := &LabelsLocksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4328 c.parent = parent
4329 return c
4330 }
4331
4332 // PageSize sets the optional parameter "pageSize": Maximum number of locks to
4333 // return per page. Default: 100. Max: 200.
4334 func (c *LabelsLocksListCall) PageSize(pageSize int64) *LabelsLocksListCall {
4335 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4336 return c
4337 }
4338
4339 // PageToken sets the optional parameter "pageToken": The token of the page to
4340 // return.
4341 func (c *LabelsLocksListCall) PageToken(pageToken string) *LabelsLocksListCall {
4342 c.urlParams_.Set("pageToken", pageToken)
4343 return c
4344 }
4345
4346 // Fields allows partial responses to be retrieved. See
4347 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4348 // details.
4349 func (c *LabelsLocksListCall) Fields(s ...googleapi.Field) *LabelsLocksListCall {
4350 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4351 return c
4352 }
4353
4354 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4355 // object's ETag matches the given value. This is useful for getting updates
4356 // only after the object has changed since the last request.
4357 func (c *LabelsLocksListCall) IfNoneMatch(entityTag string) *LabelsLocksListCall {
4358 c.ifNoneMatch_ = entityTag
4359 return c
4360 }
4361
4362 // Context sets the context to be used in this call's Do method.
4363 func (c *LabelsLocksListCall) Context(ctx context.Context) *LabelsLocksListCall {
4364 c.ctx_ = ctx
4365 return c
4366 }
4367
4368 // Header returns a http.Header that can be modified by the caller to add
4369 // headers to the request.
4370 func (c *LabelsLocksListCall) Header() http.Header {
4371 if c.header_ == nil {
4372 c.header_ = make(http.Header)
4373 }
4374 return c.header_
4375 }
4376
4377 func (c *LabelsLocksListCall) doRequest(alt string) (*http.Response, error) {
4378 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4379 if c.ifNoneMatch_ != "" {
4380 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4381 }
4382 c.urlParams_.Set("alt", alt)
4383 c.urlParams_.Set("prettyPrint", "false")
4384 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/locks")
4385 urls += "?" + c.urlParams_.Encode()
4386 req, err := http.NewRequest("GET", urls, nil)
4387 if err != nil {
4388 return nil, err
4389 }
4390 req.Header = reqHeaders
4391 googleapi.Expand(req.URL, map[string]string{
4392 "parent": c.parent,
4393 })
4394 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.locks.list", "request", internallog.HTTPRequest(req, nil))
4395 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4396 }
4397
4398 // Do executes the "drivelabels.labels.locks.list" call.
4399 // Any non-2xx status code is an error. Response headers are in either
4400 // *GoogleAppsDriveLabelsV2ListLabelLocksResponse.ServerResponse.Header or (if
4401 // a response was returned at all) in error.(*googleapi.Error).Header. Use
4402 // googleapi.IsNotModified to check whether the returned error was because
4403 // http.StatusNotModified was returned.
4404 func (c *LabelsLocksListCall) Do(opts ...googleapi.CallOption) (*GoogleAppsDriveLabelsV2ListLabelLocksResponse, error) {
4405 gensupport.SetOptions(c.urlParams_, opts...)
4406 res, err := c.doRequest("json")
4407 if res != nil && res.StatusCode == http.StatusNotModified {
4408 if res.Body != nil {
4409 res.Body.Close()
4410 }
4411 return nil, gensupport.WrapError(&googleapi.Error{
4412 Code: res.StatusCode,
4413 Header: res.Header,
4414 })
4415 }
4416 if err != nil {
4417 return nil, err
4418 }
4419 defer googleapi.CloseBody(res)
4420 if err := googleapi.CheckResponse(res); err != nil {
4421 return nil, gensupport.WrapError(err)
4422 }
4423 ret := &GoogleAppsDriveLabelsV2ListLabelLocksResponse{
4424 ServerResponse: googleapi.ServerResponse{
4425 Header: res.Header,
4426 HTTPStatusCode: res.StatusCode,
4427 },
4428 }
4429 target := &ret
4430 b, err := gensupport.DecodeResponseBytes(target, res)
4431 if err != nil {
4432 return nil, err
4433 }
4434 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.locks.list", "response", internallog.HTTPResponse(res, b))
4435 return ret, nil
4436 }
4437
4438 // Pages invokes f for each page of results.
4439 // A non-nil error returned from f will halt the iteration.
4440 // The provided context supersedes any context provided to the Context method.
4441 func (c *LabelsLocksListCall) Pages(ctx context.Context, f func(*GoogleAppsDriveLabelsV2ListLabelLocksResponse) error) error {
4442 c.ctx_ = ctx
4443 defer c.PageToken(c.urlParams_.Get("pageToken"))
4444 for {
4445 x, err := c.Do()
4446 if err != nil {
4447 return err
4448 }
4449 if err := f(x); err != nil {
4450 return err
4451 }
4452 if x.NextPageToken == "" {
4453 return nil
4454 }
4455 c.PageToken(x.NextPageToken)
4456 }
4457 }
4458
4459 type LabelsPermissionsBatchDeleteCall struct {
4460 s *Service
4461 parent string
4462 googleappsdrivelabelsv2batchdeletelabelpermissionsrequest *GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest
4463 urlParams_ gensupport.URLParams
4464 ctx_ context.Context
4465 header_ http.Header
4466 }
4467
4468 // BatchDelete: Deletes label permissions. Permissions affect the label
4469 // resource as a whole, aren't revisioned, and don't require publishing.
4470 //
4471 // - parent: The parent label resource name shared by all permissions being
4472 // deleted. Format: `labels/{label}`. If this is set, the parent field in the
4473 // `UpdateLabelPermissionRequest` messages must either be empty or match this
4474 // field.
4475 func (r *LabelsPermissionsService) BatchDelete(parent string, googleappsdrivelabelsv2batchdeletelabelpermissionsrequest *GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest) *LabelsPermissionsBatchDeleteCall {
4476 c := &LabelsPermissionsBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4477 c.parent = parent
4478 c.googleappsdrivelabelsv2batchdeletelabelpermissionsrequest = googleappsdrivelabelsv2batchdeletelabelpermissionsrequest
4479 return c
4480 }
4481
4482 // Fields allows partial responses to be retrieved. See
4483 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4484 // details.
4485 func (c *LabelsPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *LabelsPermissionsBatchDeleteCall {
4486 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4487 return c
4488 }
4489
4490 // Context sets the context to be used in this call's Do method.
4491 func (c *LabelsPermissionsBatchDeleteCall) Context(ctx context.Context) *LabelsPermissionsBatchDeleteCall {
4492 c.ctx_ = ctx
4493 return c
4494 }
4495
4496 // Header returns a http.Header that can be modified by the caller to add
4497 // headers to the request.
4498 func (c *LabelsPermissionsBatchDeleteCall) Header() http.Header {
4499 if c.header_ == nil {
4500 c.header_ = make(http.Header)
4501 }
4502 return c.header_
4503 }
4504
4505 func (c *LabelsPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
4506 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4507 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2batchdeletelabelpermissionsrequest)
4508 if err != nil {
4509 return nil, err
4510 }
4511 c.urlParams_.Set("alt", alt)
4512 c.urlParams_.Set("prettyPrint", "false")
4513 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/permissions:batchDelete")
4514 urls += "?" + c.urlParams_.Encode()
4515 req, err := http.NewRequest("POST", urls, body)
4516 if err != nil {
4517 return nil, err
4518 }
4519 req.Header = reqHeaders
4520 googleapi.Expand(req.URL, map[string]string{
4521 "parent": c.parent,
4522 })
4523 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.permissions.batchDelete", "request", internallog.HTTPRequest(req, body.Bytes()))
4524 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4525 }
4526
4527 // Do executes the "drivelabels.labels.permissions.batchDelete" call.
4528 // Any non-2xx status code is an error. Response headers are in either
4529 // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at
4530 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4531 // check whether the returned error was because http.StatusNotModified was
4532 // returned.
4533 func (c *LabelsPermissionsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
4534 gensupport.SetOptions(c.urlParams_, opts...)
4535 res, err := c.doRequest("json")
4536 if res != nil && res.StatusCode == http.StatusNotModified {
4537 if res.Body != nil {
4538 res.Body.Close()
4539 }
4540 return nil, gensupport.WrapError(&googleapi.Error{
4541 Code: res.StatusCode,
4542 Header: res.Header,
4543 })
4544 }
4545 if err != nil {
4546 return nil, err
4547 }
4548 defer googleapi.CloseBody(res)
4549 if err := googleapi.CheckResponse(res); err != nil {
4550 return nil, gensupport.WrapError(err)
4551 }
4552 ret := &GoogleProtobufEmpty{
4553 ServerResponse: googleapi.ServerResponse{
4554 Header: res.Header,
4555 HTTPStatusCode: res.StatusCode,
4556 },
4557 }
4558 target := &ret
4559 b, err := gensupport.DecodeResponseBytes(target, res)
4560 if err != nil {
4561 return nil, err
4562 }
4563 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.permissions.batchDelete", "response", internallog.HTTPResponse(res, b))
4564 return ret, nil
4565 }
4566
4567 type LabelsPermissionsBatchUpdateCall struct {
4568 s *Service
4569 parent string
4570 googleappsdrivelabelsv2batchupdatelabelpermissionsrequest *GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest
4571 urlParams_ gensupport.URLParams
4572 ctx_ context.Context
4573 header_ http.Header
4574 }
4575
4576 // BatchUpdate: Updates label permissions. If a permission for the indicated
4577 // principal doesn't exist, a label permission is created, otherwise the
4578 // existing permission is updated. Permissions affect the label resource as a
4579 // whole, aren't revisioned, and don't require publishing.
4580 //
4581 // - parent: The parent label resource name shared by all permissions being
4582 // updated. Format: `labels/{label}`. If this is set, the parent field in the
4583 // `UpdateLabelPermissionRequest` messages must either be empty or match this
4584 // field.
4585 func (r *LabelsPermissionsService) BatchUpdate(parent string, googleappsdrivelabelsv2batchupdatelabelpermissionsrequest *GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest) *LabelsPermissionsBatchUpdateCall {
4586 c := &LabelsPermissionsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4587 c.parent = parent
4588 c.googleappsdrivelabelsv2batchupdatelabelpermissionsrequest = googleappsdrivelabelsv2batchupdatelabelpermissionsrequest
4589 return c
4590 }
4591
4592 // Fields allows partial responses to be retrieved. See
4593 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4594 // details.
4595 func (c *LabelsPermissionsBatchUpdateCall) Fields(s ...googleapi.Field) *LabelsPermissionsBatchUpdateCall {
4596 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4597 return c
4598 }
4599
4600 // Context sets the context to be used in this call's Do method.
4601 func (c *LabelsPermissionsBatchUpdateCall) Context(ctx context.Context) *LabelsPermissionsBatchUpdateCall {
4602 c.ctx_ = ctx
4603 return c
4604 }
4605
4606 // Header returns a http.Header that can be modified by the caller to add
4607 // headers to the request.
4608 func (c *LabelsPermissionsBatchUpdateCall) Header() http.Header {
4609 if c.header_ == nil {
4610 c.header_ = make(http.Header)
4611 }
4612 return c.header_
4613 }
4614
4615 func (c *LabelsPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
4616 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4617 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2batchupdatelabelpermissionsrequest)
4618 if err != nil {
4619 return nil, err
4620 }
4621 c.urlParams_.Set("alt", alt)
4622 c.urlParams_.Set("prettyPrint", "false")
4623 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/permissions:batchUpdate")
4624 urls += "?" + c.urlParams_.Encode()
4625 req, err := http.NewRequest("POST", urls, body)
4626 if err != nil {
4627 return nil, err
4628 }
4629 req.Header = reqHeaders
4630 googleapi.Expand(req.URL, map[string]string{
4631 "parent": c.parent,
4632 })
4633 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.permissions.batchUpdate", "request", internallog.HTTPRequest(req, body.Bytes()))
4634 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4635 }
4636
4637 // Do executes the "drivelabels.labels.permissions.batchUpdate" call.
4638 // Any non-2xx status code is an error. Response headers are in either
4639 // *GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse.ServerResponse.He
4640 // ader or (if a response was returned at all) in
4641 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4642 // whether the returned error was because http.StatusNotModified was returned.
4643 func (c *LabelsPermissionsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse, error) {
4644 gensupport.SetOptions(c.urlParams_, opts...)
4645 res, err := c.doRequest("json")
4646 if res != nil && res.StatusCode == http.StatusNotModified {
4647 if res.Body != nil {
4648 res.Body.Close()
4649 }
4650 return nil, gensupport.WrapError(&googleapi.Error{
4651 Code: res.StatusCode,
4652 Header: res.Header,
4653 })
4654 }
4655 if err != nil {
4656 return nil, err
4657 }
4658 defer googleapi.CloseBody(res)
4659 if err := googleapi.CheckResponse(res); err != nil {
4660 return nil, gensupport.WrapError(err)
4661 }
4662 ret := &GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse{
4663 ServerResponse: googleapi.ServerResponse{
4664 Header: res.Header,
4665 HTTPStatusCode: res.StatusCode,
4666 },
4667 }
4668 target := &ret
4669 b, err := gensupport.DecodeResponseBytes(target, res)
4670 if err != nil {
4671 return nil, err
4672 }
4673 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.permissions.batchUpdate", "response", internallog.HTTPResponse(res, b))
4674 return ret, nil
4675 }
4676
4677 type LabelsPermissionsCreateCall struct {
4678 s *Service
4679 parent string
4680 googleappsdrivelabelsv2labelpermission *GoogleAppsDriveLabelsV2LabelPermission
4681 urlParams_ gensupport.URLParams
4682 ctx_ context.Context
4683 header_ http.Header
4684 }
4685
4686 // Create: Updates a label's permissions. If a permission for the indicated
4687 // principal doesn't exist, a label permission is created, otherwise the
4688 // existing permission is updated. Permissions affect the label resource as a
4689 // whole, aren't revisioned, and don't require publishing.
4690 //
4691 // - parent: The parent label resource name on the label permission is created.
4692 // Format: `labels/{label}`.
4693 func (r *LabelsPermissionsService) Create(parent string, googleappsdrivelabelsv2labelpermission *GoogleAppsDriveLabelsV2LabelPermission) *LabelsPermissionsCreateCall {
4694 c := &LabelsPermissionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4695 c.parent = parent
4696 c.googleappsdrivelabelsv2labelpermission = googleappsdrivelabelsv2labelpermission
4697 return c
4698 }
4699
4700 // UseAdminAccess sets the optional parameter "useAdminAccess": Set to `true`
4701 // in order to use the user's admin credentials. The server will verify the
4702 // user is an admin for the label before allowing access.
4703 func (c *LabelsPermissionsCreateCall) UseAdminAccess(useAdminAccess bool) *LabelsPermissionsCreateCall {
4704 c.urlParams_.Set("useAdminAccess", fmt.Sprint(useAdminAccess))
4705 return c
4706 }
4707
4708 // Fields allows partial responses to be retrieved. See
4709 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4710 // details.
4711 func (c *LabelsPermissionsCreateCall) Fields(s ...googleapi.Field) *LabelsPermissionsCreateCall {
4712 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4713 return c
4714 }
4715
4716 // Context sets the context to be used in this call's Do method.
4717 func (c *LabelsPermissionsCreateCall) Context(ctx context.Context) *LabelsPermissionsCreateCall {
4718 c.ctx_ = ctx
4719 return c
4720 }
4721
4722 // Header returns a http.Header that can be modified by the caller to add
4723 // headers to the request.
4724 func (c *LabelsPermissionsCreateCall) Header() http.Header {
4725 if c.header_ == nil {
4726 c.header_ = make(http.Header)
4727 }
4728 return c.header_
4729 }
4730
4731 func (c *LabelsPermissionsCreateCall) doRequest(alt string) (*http.Response, error) {
4732 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4733 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2labelpermission)
4734 if err != nil {
4735 return nil, err
4736 }
4737 c.urlParams_.Set("alt", alt)
4738 c.urlParams_.Set("prettyPrint", "false")
4739 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/permissions")
4740 urls += "?" + c.urlParams_.Encode()
4741 req, err := http.NewRequest("POST", urls, body)
4742 if err != nil {
4743 return nil, err
4744 }
4745 req.Header = reqHeaders
4746 googleapi.Expand(req.URL, map[string]string{
4747 "parent": c.parent,
4748 })
4749 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.permissions.create", "request", internallog.HTTPRequest(req, body.Bytes()))
4750 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4751 }
4752
4753 // Do executes the "drivelabels.labels.permissions.create" call.
4754 // Any non-2xx status code is an error. Response headers are in either
4755 // *GoogleAppsDriveLabelsV2LabelPermission.ServerResponse.Header or (if a
4756 // response was returned at all) in error.(*googleapi.Error).Header. Use
4757 // googleapi.IsNotModified to check whether the returned error was because
4758 // http.StatusNotModified was returned.
4759 func (c *LabelsPermissionsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleAppsDriveLabelsV2LabelPermission, error) {
4760 gensupport.SetOptions(c.urlParams_, opts...)
4761 res, err := c.doRequest("json")
4762 if res != nil && res.StatusCode == http.StatusNotModified {
4763 if res.Body != nil {
4764 res.Body.Close()
4765 }
4766 return nil, gensupport.WrapError(&googleapi.Error{
4767 Code: res.StatusCode,
4768 Header: res.Header,
4769 })
4770 }
4771 if err != nil {
4772 return nil, err
4773 }
4774 defer googleapi.CloseBody(res)
4775 if err := googleapi.CheckResponse(res); err != nil {
4776 return nil, gensupport.WrapError(err)
4777 }
4778 ret := &GoogleAppsDriveLabelsV2LabelPermission{
4779 ServerResponse: googleapi.ServerResponse{
4780 Header: res.Header,
4781 HTTPStatusCode: res.StatusCode,
4782 },
4783 }
4784 target := &ret
4785 b, err := gensupport.DecodeResponseBytes(target, res)
4786 if err != nil {
4787 return nil, err
4788 }
4789 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.permissions.create", "response", internallog.HTTPResponse(res, b))
4790 return ret, nil
4791 }
4792
4793 type LabelsPermissionsDeleteCall struct {
4794 s *Service
4795 name string
4796 urlParams_ gensupport.URLParams
4797 ctx_ context.Context
4798 header_ http.Header
4799 }
4800
4801 // Delete: Deletes a label's permission. Permissions affect the label resource
4802 // as a whole, aren't revisioned, and don't require publishing.
4803 //
4804 // - name: Label permission resource name.
4805 func (r *LabelsPermissionsService) Delete(name string) *LabelsPermissionsDeleteCall {
4806 c := &LabelsPermissionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4807 c.name = name
4808 return c
4809 }
4810
4811 // UseAdminAccess sets the optional parameter "useAdminAccess": Set to `true`
4812 // in order to use the user's admin credentials. The server will verify the
4813 // user is an admin for the label before allowing access.
4814 func (c *LabelsPermissionsDeleteCall) UseAdminAccess(useAdminAccess bool) *LabelsPermissionsDeleteCall {
4815 c.urlParams_.Set("useAdminAccess", fmt.Sprint(useAdminAccess))
4816 return c
4817 }
4818
4819 // Fields allows partial responses to be retrieved. See
4820 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4821 // details.
4822 func (c *LabelsPermissionsDeleteCall) Fields(s ...googleapi.Field) *LabelsPermissionsDeleteCall {
4823 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4824 return c
4825 }
4826
4827 // Context sets the context to be used in this call's Do method.
4828 func (c *LabelsPermissionsDeleteCall) Context(ctx context.Context) *LabelsPermissionsDeleteCall {
4829 c.ctx_ = ctx
4830 return c
4831 }
4832
4833 // Header returns a http.Header that can be modified by the caller to add
4834 // headers to the request.
4835 func (c *LabelsPermissionsDeleteCall) Header() http.Header {
4836 if c.header_ == nil {
4837 c.header_ = make(http.Header)
4838 }
4839 return c.header_
4840 }
4841
4842 func (c *LabelsPermissionsDeleteCall) doRequest(alt string) (*http.Response, error) {
4843 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4844 c.urlParams_.Set("alt", alt)
4845 c.urlParams_.Set("prettyPrint", "false")
4846 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
4847 urls += "?" + c.urlParams_.Encode()
4848 req, err := http.NewRequest("DELETE", urls, nil)
4849 if err != nil {
4850 return nil, err
4851 }
4852 req.Header = reqHeaders
4853 googleapi.Expand(req.URL, map[string]string{
4854 "name": c.name,
4855 })
4856 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.permissions.delete", "request", internallog.HTTPRequest(req, nil))
4857 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4858 }
4859
4860 // Do executes the "drivelabels.labels.permissions.delete" call.
4861 // Any non-2xx status code is an error. Response headers are in either
4862 // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at
4863 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4864 // check whether the returned error was because http.StatusNotModified was
4865 // returned.
4866 func (c *LabelsPermissionsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
4867 gensupport.SetOptions(c.urlParams_, opts...)
4868 res, err := c.doRequest("json")
4869 if res != nil && res.StatusCode == http.StatusNotModified {
4870 if res.Body != nil {
4871 res.Body.Close()
4872 }
4873 return nil, gensupport.WrapError(&googleapi.Error{
4874 Code: res.StatusCode,
4875 Header: res.Header,
4876 })
4877 }
4878 if err != nil {
4879 return nil, err
4880 }
4881 defer googleapi.CloseBody(res)
4882 if err := googleapi.CheckResponse(res); err != nil {
4883 return nil, gensupport.WrapError(err)
4884 }
4885 ret := &GoogleProtobufEmpty{
4886 ServerResponse: googleapi.ServerResponse{
4887 Header: res.Header,
4888 HTTPStatusCode: res.StatusCode,
4889 },
4890 }
4891 target := &ret
4892 b, err := gensupport.DecodeResponseBytes(target, res)
4893 if err != nil {
4894 return nil, err
4895 }
4896 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.permissions.delete", "response", internallog.HTTPResponse(res, b))
4897 return ret, nil
4898 }
4899
4900 type LabelsPermissionsListCall struct {
4901 s *Service
4902 parent string
4903 urlParams_ gensupport.URLParams
4904 ifNoneMatch_ string
4905 ctx_ context.Context
4906 header_ http.Header
4907 }
4908
4909 // List: Lists a label's permissions.
4910 //
4911 // - parent: The parent label resource name on which label permissions are
4912 // listed. Format: `labels/{label}`.
4913 func (r *LabelsPermissionsService) List(parent string) *LabelsPermissionsListCall {
4914 c := &LabelsPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4915 c.parent = parent
4916 return c
4917 }
4918
4919 // PageSize sets the optional parameter "pageSize": Maximum number of
4920 // permissions to return per page. Default: 50. Max: 200.
4921 func (c *LabelsPermissionsListCall) PageSize(pageSize int64) *LabelsPermissionsListCall {
4922 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4923 return c
4924 }
4925
4926 // PageToken sets the optional parameter "pageToken": The token of the page to
4927 // return.
4928 func (c *LabelsPermissionsListCall) PageToken(pageToken string) *LabelsPermissionsListCall {
4929 c.urlParams_.Set("pageToken", pageToken)
4930 return c
4931 }
4932
4933 // UseAdminAccess sets the optional parameter "useAdminAccess": Set to `true`
4934 // in order to use the user's admin credentials. The server will verify the
4935 // user is an admin for the label before allowing access.
4936 func (c *LabelsPermissionsListCall) UseAdminAccess(useAdminAccess bool) *LabelsPermissionsListCall {
4937 c.urlParams_.Set("useAdminAccess", fmt.Sprint(useAdminAccess))
4938 return c
4939 }
4940
4941 // Fields allows partial responses to be retrieved. See
4942 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4943 // details.
4944 func (c *LabelsPermissionsListCall) Fields(s ...googleapi.Field) *LabelsPermissionsListCall {
4945 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4946 return c
4947 }
4948
4949 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4950 // object's ETag matches the given value. This is useful for getting updates
4951 // only after the object has changed since the last request.
4952 func (c *LabelsPermissionsListCall) IfNoneMatch(entityTag string) *LabelsPermissionsListCall {
4953 c.ifNoneMatch_ = entityTag
4954 return c
4955 }
4956
4957 // Context sets the context to be used in this call's Do method.
4958 func (c *LabelsPermissionsListCall) Context(ctx context.Context) *LabelsPermissionsListCall {
4959 c.ctx_ = ctx
4960 return c
4961 }
4962
4963 // Header returns a http.Header that can be modified by the caller to add
4964 // headers to the request.
4965 func (c *LabelsPermissionsListCall) Header() http.Header {
4966 if c.header_ == nil {
4967 c.header_ = make(http.Header)
4968 }
4969 return c.header_
4970 }
4971
4972 func (c *LabelsPermissionsListCall) doRequest(alt string) (*http.Response, error) {
4973 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4974 if c.ifNoneMatch_ != "" {
4975 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4976 }
4977 c.urlParams_.Set("alt", alt)
4978 c.urlParams_.Set("prettyPrint", "false")
4979 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/permissions")
4980 urls += "?" + c.urlParams_.Encode()
4981 req, err := http.NewRequest("GET", urls, nil)
4982 if err != nil {
4983 return nil, err
4984 }
4985 req.Header = reqHeaders
4986 googleapi.Expand(req.URL, map[string]string{
4987 "parent": c.parent,
4988 })
4989 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.permissions.list", "request", internallog.HTTPRequest(req, nil))
4990 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4991 }
4992
4993 // Do executes the "drivelabels.labels.permissions.list" call.
4994 // Any non-2xx status code is an error. Response headers are in either
4995 // *GoogleAppsDriveLabelsV2ListLabelPermissionsResponse.ServerResponse.Header
4996 // or (if a response was returned at all) in error.(*googleapi.Error).Header.
4997 // Use googleapi.IsNotModified to check whether the returned error was because
4998 // http.StatusNotModified was returned.
4999 func (c *LabelsPermissionsListCall) Do(opts ...googleapi.CallOption) (*GoogleAppsDriveLabelsV2ListLabelPermissionsResponse, error) {
5000 gensupport.SetOptions(c.urlParams_, opts...)
5001 res, err := c.doRequest("json")
5002 if res != nil && res.StatusCode == http.StatusNotModified {
5003 if res.Body != nil {
5004 res.Body.Close()
5005 }
5006 return nil, gensupport.WrapError(&googleapi.Error{
5007 Code: res.StatusCode,
5008 Header: res.Header,
5009 })
5010 }
5011 if err != nil {
5012 return nil, err
5013 }
5014 defer googleapi.CloseBody(res)
5015 if err := googleapi.CheckResponse(res); err != nil {
5016 return nil, gensupport.WrapError(err)
5017 }
5018 ret := &GoogleAppsDriveLabelsV2ListLabelPermissionsResponse{
5019 ServerResponse: googleapi.ServerResponse{
5020 Header: res.Header,
5021 HTTPStatusCode: res.StatusCode,
5022 },
5023 }
5024 target := &ret
5025 b, err := gensupport.DecodeResponseBytes(target, res)
5026 if err != nil {
5027 return nil, err
5028 }
5029 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.permissions.list", "response", internallog.HTTPResponse(res, b))
5030 return ret, nil
5031 }
5032
5033 // Pages invokes f for each page of results.
5034 // A non-nil error returned from f will halt the iteration.
5035 // The provided context supersedes any context provided to the Context method.
5036 func (c *LabelsPermissionsListCall) Pages(ctx context.Context, f func(*GoogleAppsDriveLabelsV2ListLabelPermissionsResponse) error) error {
5037 c.ctx_ = ctx
5038 defer c.PageToken(c.urlParams_.Get("pageToken"))
5039 for {
5040 x, err := c.Do()
5041 if err != nil {
5042 return err
5043 }
5044 if err := f(x); err != nil {
5045 return err
5046 }
5047 if x.NextPageToken == "" {
5048 return nil
5049 }
5050 c.PageToken(x.NextPageToken)
5051 }
5052 }
5053
5054 type LabelsRevisionsUpdatePermissionsCall struct {
5055 s *Service
5056 parent string
5057 googleappsdrivelabelsv2labelpermission *GoogleAppsDriveLabelsV2LabelPermission
5058 urlParams_ gensupport.URLParams
5059 ctx_ context.Context
5060 header_ http.Header
5061 }
5062
5063 // UpdatePermissions: Updates a label's permissions. If a permission for the
5064 // indicated principal doesn't exist, a label permission is created, otherwise
5065 // the existing permission is updated. Permissions affect the label resource as
5066 // a whole, aren't revisioned, and don't require publishing.
5067 //
5068 // - parent: The parent label resource name.
5069 func (r *LabelsRevisionsService) UpdatePermissions(parent string, googleappsdrivelabelsv2labelpermission *GoogleAppsDriveLabelsV2LabelPermission) *LabelsRevisionsUpdatePermissionsCall {
5070 c := &LabelsRevisionsUpdatePermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5071 c.parent = parent
5072 c.googleappsdrivelabelsv2labelpermission = googleappsdrivelabelsv2labelpermission
5073 return c
5074 }
5075
5076 // UseAdminAccess sets the optional parameter "useAdminAccess": Set to `true`
5077 // in order to use the user's admin credentials. The server will verify the
5078 // user is an admin for the label before allowing access.
5079 func (c *LabelsRevisionsUpdatePermissionsCall) UseAdminAccess(useAdminAccess bool) *LabelsRevisionsUpdatePermissionsCall {
5080 c.urlParams_.Set("useAdminAccess", fmt.Sprint(useAdminAccess))
5081 return c
5082 }
5083
5084 // Fields allows partial responses to be retrieved. See
5085 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5086 // details.
5087 func (c *LabelsRevisionsUpdatePermissionsCall) Fields(s ...googleapi.Field) *LabelsRevisionsUpdatePermissionsCall {
5088 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5089 return c
5090 }
5091
5092 // Context sets the context to be used in this call's Do method.
5093 func (c *LabelsRevisionsUpdatePermissionsCall) Context(ctx context.Context) *LabelsRevisionsUpdatePermissionsCall {
5094 c.ctx_ = ctx
5095 return c
5096 }
5097
5098 // Header returns a http.Header that can be modified by the caller to add
5099 // headers to the request.
5100 func (c *LabelsRevisionsUpdatePermissionsCall) Header() http.Header {
5101 if c.header_ == nil {
5102 c.header_ = make(http.Header)
5103 }
5104 return c.header_
5105 }
5106
5107 func (c *LabelsRevisionsUpdatePermissionsCall) doRequest(alt string) (*http.Response, error) {
5108 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5109 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2labelpermission)
5110 if err != nil {
5111 return nil, err
5112 }
5113 c.urlParams_.Set("alt", alt)
5114 c.urlParams_.Set("prettyPrint", "false")
5115 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/permissions")
5116 urls += "?" + c.urlParams_.Encode()
5117 req, err := http.NewRequest("PATCH", urls, body)
5118 if err != nil {
5119 return nil, err
5120 }
5121 req.Header = reqHeaders
5122 googleapi.Expand(req.URL, map[string]string{
5123 "parent": c.parent,
5124 })
5125 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.revisions.updatePermissions", "request", internallog.HTTPRequest(req, body.Bytes()))
5126 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5127 }
5128
5129 // Do executes the "drivelabels.labels.revisions.updatePermissions" call.
5130 // Any non-2xx status code is an error. Response headers are in either
5131 // *GoogleAppsDriveLabelsV2LabelPermission.ServerResponse.Header or (if a
5132 // response was returned at all) in error.(*googleapi.Error).Header. Use
5133 // googleapi.IsNotModified to check whether the returned error was because
5134 // http.StatusNotModified was returned.
5135 func (c *LabelsRevisionsUpdatePermissionsCall) Do(opts ...googleapi.CallOption) (*GoogleAppsDriveLabelsV2LabelPermission, error) {
5136 gensupport.SetOptions(c.urlParams_, opts...)
5137 res, err := c.doRequest("json")
5138 if res != nil && res.StatusCode == http.StatusNotModified {
5139 if res.Body != nil {
5140 res.Body.Close()
5141 }
5142 return nil, gensupport.WrapError(&googleapi.Error{
5143 Code: res.StatusCode,
5144 Header: res.Header,
5145 })
5146 }
5147 if err != nil {
5148 return nil, err
5149 }
5150 defer googleapi.CloseBody(res)
5151 if err := googleapi.CheckResponse(res); err != nil {
5152 return nil, gensupport.WrapError(err)
5153 }
5154 ret := &GoogleAppsDriveLabelsV2LabelPermission{
5155 ServerResponse: googleapi.ServerResponse{
5156 Header: res.Header,
5157 HTTPStatusCode: res.StatusCode,
5158 },
5159 }
5160 target := &ret
5161 b, err := gensupport.DecodeResponseBytes(target, res)
5162 if err != nil {
5163 return nil, err
5164 }
5165 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.revisions.updatePermissions", "response", internallog.HTTPResponse(res, b))
5166 return ret, nil
5167 }
5168
5169 type LabelsRevisionsLocksListCall struct {
5170 s *Service
5171 parent string
5172 urlParams_ gensupport.URLParams
5173 ifNoneMatch_ string
5174 ctx_ context.Context
5175 header_ http.Header
5176 }
5177
5178 // List: Lists the label locks on a label.
5179 //
5180 // - parent: Label on which locks are applied. Format: `labels/{label}`.
5181 func (r *LabelsRevisionsLocksService) List(parent string) *LabelsRevisionsLocksListCall {
5182 c := &LabelsRevisionsLocksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5183 c.parent = parent
5184 return c
5185 }
5186
5187 // PageSize sets the optional parameter "pageSize": Maximum number of locks to
5188 // return per page. Default: 100. Max: 200.
5189 func (c *LabelsRevisionsLocksListCall) PageSize(pageSize int64) *LabelsRevisionsLocksListCall {
5190 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5191 return c
5192 }
5193
5194 // PageToken sets the optional parameter "pageToken": The token of the page to
5195 // return.
5196 func (c *LabelsRevisionsLocksListCall) PageToken(pageToken string) *LabelsRevisionsLocksListCall {
5197 c.urlParams_.Set("pageToken", pageToken)
5198 return c
5199 }
5200
5201 // Fields allows partial responses to be retrieved. See
5202 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5203 // details.
5204 func (c *LabelsRevisionsLocksListCall) Fields(s ...googleapi.Field) *LabelsRevisionsLocksListCall {
5205 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5206 return c
5207 }
5208
5209 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5210 // object's ETag matches the given value. This is useful for getting updates
5211 // only after the object has changed since the last request.
5212 func (c *LabelsRevisionsLocksListCall) IfNoneMatch(entityTag string) *LabelsRevisionsLocksListCall {
5213 c.ifNoneMatch_ = entityTag
5214 return c
5215 }
5216
5217 // Context sets the context to be used in this call's Do method.
5218 func (c *LabelsRevisionsLocksListCall) Context(ctx context.Context) *LabelsRevisionsLocksListCall {
5219 c.ctx_ = ctx
5220 return c
5221 }
5222
5223 // Header returns a http.Header that can be modified by the caller to add
5224 // headers to the request.
5225 func (c *LabelsRevisionsLocksListCall) Header() http.Header {
5226 if c.header_ == nil {
5227 c.header_ = make(http.Header)
5228 }
5229 return c.header_
5230 }
5231
5232 func (c *LabelsRevisionsLocksListCall) doRequest(alt string) (*http.Response, error) {
5233 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5234 if c.ifNoneMatch_ != "" {
5235 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5236 }
5237 c.urlParams_.Set("alt", alt)
5238 c.urlParams_.Set("prettyPrint", "false")
5239 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/locks")
5240 urls += "?" + c.urlParams_.Encode()
5241 req, err := http.NewRequest("GET", urls, nil)
5242 if err != nil {
5243 return nil, err
5244 }
5245 req.Header = reqHeaders
5246 googleapi.Expand(req.URL, map[string]string{
5247 "parent": c.parent,
5248 })
5249 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.revisions.locks.list", "request", internallog.HTTPRequest(req, nil))
5250 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5251 }
5252
5253 // Do executes the "drivelabels.labels.revisions.locks.list" call.
5254 // Any non-2xx status code is an error. Response headers are in either
5255 // *GoogleAppsDriveLabelsV2ListLabelLocksResponse.ServerResponse.Header or (if
5256 // a response was returned at all) in error.(*googleapi.Error).Header. Use
5257 // googleapi.IsNotModified to check whether the returned error was because
5258 // http.StatusNotModified was returned.
5259 func (c *LabelsRevisionsLocksListCall) Do(opts ...googleapi.CallOption) (*GoogleAppsDriveLabelsV2ListLabelLocksResponse, error) {
5260 gensupport.SetOptions(c.urlParams_, opts...)
5261 res, err := c.doRequest("json")
5262 if res != nil && res.StatusCode == http.StatusNotModified {
5263 if res.Body != nil {
5264 res.Body.Close()
5265 }
5266 return nil, gensupport.WrapError(&googleapi.Error{
5267 Code: res.StatusCode,
5268 Header: res.Header,
5269 })
5270 }
5271 if err != nil {
5272 return nil, err
5273 }
5274 defer googleapi.CloseBody(res)
5275 if err := googleapi.CheckResponse(res); err != nil {
5276 return nil, gensupport.WrapError(err)
5277 }
5278 ret := &GoogleAppsDriveLabelsV2ListLabelLocksResponse{
5279 ServerResponse: googleapi.ServerResponse{
5280 Header: res.Header,
5281 HTTPStatusCode: res.StatusCode,
5282 },
5283 }
5284 target := &ret
5285 b, err := gensupport.DecodeResponseBytes(target, res)
5286 if err != nil {
5287 return nil, err
5288 }
5289 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.revisions.locks.list", "response", internallog.HTTPResponse(res, b))
5290 return ret, nil
5291 }
5292
5293 // Pages invokes f for each page of results.
5294 // A non-nil error returned from f will halt the iteration.
5295 // The provided context supersedes any context provided to the Context method.
5296 func (c *LabelsRevisionsLocksListCall) Pages(ctx context.Context, f func(*GoogleAppsDriveLabelsV2ListLabelLocksResponse) error) error {
5297 c.ctx_ = ctx
5298 defer c.PageToken(c.urlParams_.Get("pageToken"))
5299 for {
5300 x, err := c.Do()
5301 if err != nil {
5302 return err
5303 }
5304 if err := f(x); err != nil {
5305 return err
5306 }
5307 if x.NextPageToken == "" {
5308 return nil
5309 }
5310 c.PageToken(x.NextPageToken)
5311 }
5312 }
5313
5314 type LabelsRevisionsPermissionsBatchDeleteCall struct {
5315 s *Service
5316 parent string
5317 googleappsdrivelabelsv2batchdeletelabelpermissionsrequest *GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest
5318 urlParams_ gensupport.URLParams
5319 ctx_ context.Context
5320 header_ http.Header
5321 }
5322
5323 // BatchDelete: Deletes label permissions. Permissions affect the label
5324 // resource as a whole, aren't revisioned, and don't require publishing.
5325 //
5326 // - parent: The parent label resource name shared by all permissions being
5327 // deleted. Format: `labels/{label}`. If this is set, the parent field in the
5328 // `UpdateLabelPermissionRequest` messages must either be empty or match this
5329 // field.
5330 func (r *LabelsRevisionsPermissionsService) BatchDelete(parent string, googleappsdrivelabelsv2batchdeletelabelpermissionsrequest *GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest) *LabelsRevisionsPermissionsBatchDeleteCall {
5331 c := &LabelsRevisionsPermissionsBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5332 c.parent = parent
5333 c.googleappsdrivelabelsv2batchdeletelabelpermissionsrequest = googleappsdrivelabelsv2batchdeletelabelpermissionsrequest
5334 return c
5335 }
5336
5337 // Fields allows partial responses to be retrieved. See
5338 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5339 // details.
5340 func (c *LabelsRevisionsPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *LabelsRevisionsPermissionsBatchDeleteCall {
5341 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5342 return c
5343 }
5344
5345 // Context sets the context to be used in this call's Do method.
5346 func (c *LabelsRevisionsPermissionsBatchDeleteCall) Context(ctx context.Context) *LabelsRevisionsPermissionsBatchDeleteCall {
5347 c.ctx_ = ctx
5348 return c
5349 }
5350
5351 // Header returns a http.Header that can be modified by the caller to add
5352 // headers to the request.
5353 func (c *LabelsRevisionsPermissionsBatchDeleteCall) Header() http.Header {
5354 if c.header_ == nil {
5355 c.header_ = make(http.Header)
5356 }
5357 return c.header_
5358 }
5359
5360 func (c *LabelsRevisionsPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
5361 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5362 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2batchdeletelabelpermissionsrequest)
5363 if err != nil {
5364 return nil, err
5365 }
5366 c.urlParams_.Set("alt", alt)
5367 c.urlParams_.Set("prettyPrint", "false")
5368 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/permissions:batchDelete")
5369 urls += "?" + c.urlParams_.Encode()
5370 req, err := http.NewRequest("POST", urls, body)
5371 if err != nil {
5372 return nil, err
5373 }
5374 req.Header = reqHeaders
5375 googleapi.Expand(req.URL, map[string]string{
5376 "parent": c.parent,
5377 })
5378 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.revisions.permissions.batchDelete", "request", internallog.HTTPRequest(req, body.Bytes()))
5379 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5380 }
5381
5382 // Do executes the "drivelabels.labels.revisions.permissions.batchDelete" call.
5383 // Any non-2xx status code is an error. Response headers are in either
5384 // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at
5385 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5386 // check whether the returned error was because http.StatusNotModified was
5387 // returned.
5388 func (c *LabelsRevisionsPermissionsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
5389 gensupport.SetOptions(c.urlParams_, opts...)
5390 res, err := c.doRequest("json")
5391 if res != nil && res.StatusCode == http.StatusNotModified {
5392 if res.Body != nil {
5393 res.Body.Close()
5394 }
5395 return nil, gensupport.WrapError(&googleapi.Error{
5396 Code: res.StatusCode,
5397 Header: res.Header,
5398 })
5399 }
5400 if err != nil {
5401 return nil, err
5402 }
5403 defer googleapi.CloseBody(res)
5404 if err := googleapi.CheckResponse(res); err != nil {
5405 return nil, gensupport.WrapError(err)
5406 }
5407 ret := &GoogleProtobufEmpty{
5408 ServerResponse: googleapi.ServerResponse{
5409 Header: res.Header,
5410 HTTPStatusCode: res.StatusCode,
5411 },
5412 }
5413 target := &ret
5414 b, err := gensupport.DecodeResponseBytes(target, res)
5415 if err != nil {
5416 return nil, err
5417 }
5418 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.revisions.permissions.batchDelete", "response", internallog.HTTPResponse(res, b))
5419 return ret, nil
5420 }
5421
5422 type LabelsRevisionsPermissionsBatchUpdateCall struct {
5423 s *Service
5424 parent string
5425 googleappsdrivelabelsv2batchupdatelabelpermissionsrequest *GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest
5426 urlParams_ gensupport.URLParams
5427 ctx_ context.Context
5428 header_ http.Header
5429 }
5430
5431 // BatchUpdate: Updates label permissions. If a permission for the indicated
5432 // principal doesn't exist, a label permission is created, otherwise the
5433 // existing permission is updated. Permissions affect the label resource as a
5434 // whole, aren't revisioned, and don't require publishing.
5435 //
5436 // - parent: The parent label resource name shared by all permissions being
5437 // updated. Format: `labels/{label}`. If this is set, the parent field in the
5438 // `UpdateLabelPermissionRequest` messages must either be empty or match this
5439 // field.
5440 func (r *LabelsRevisionsPermissionsService) BatchUpdate(parent string, googleappsdrivelabelsv2batchupdatelabelpermissionsrequest *GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest) *LabelsRevisionsPermissionsBatchUpdateCall {
5441 c := &LabelsRevisionsPermissionsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5442 c.parent = parent
5443 c.googleappsdrivelabelsv2batchupdatelabelpermissionsrequest = googleappsdrivelabelsv2batchupdatelabelpermissionsrequest
5444 return c
5445 }
5446
5447 // Fields allows partial responses to be retrieved. See
5448 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5449 // details.
5450 func (c *LabelsRevisionsPermissionsBatchUpdateCall) Fields(s ...googleapi.Field) *LabelsRevisionsPermissionsBatchUpdateCall {
5451 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5452 return c
5453 }
5454
5455 // Context sets the context to be used in this call's Do method.
5456 func (c *LabelsRevisionsPermissionsBatchUpdateCall) Context(ctx context.Context) *LabelsRevisionsPermissionsBatchUpdateCall {
5457 c.ctx_ = ctx
5458 return c
5459 }
5460
5461 // Header returns a http.Header that can be modified by the caller to add
5462 // headers to the request.
5463 func (c *LabelsRevisionsPermissionsBatchUpdateCall) Header() http.Header {
5464 if c.header_ == nil {
5465 c.header_ = make(http.Header)
5466 }
5467 return c.header_
5468 }
5469
5470 func (c *LabelsRevisionsPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
5471 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5472 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2batchupdatelabelpermissionsrequest)
5473 if err != nil {
5474 return nil, err
5475 }
5476 c.urlParams_.Set("alt", alt)
5477 c.urlParams_.Set("prettyPrint", "false")
5478 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/permissions:batchUpdate")
5479 urls += "?" + c.urlParams_.Encode()
5480 req, err := http.NewRequest("POST", urls, body)
5481 if err != nil {
5482 return nil, err
5483 }
5484 req.Header = reqHeaders
5485 googleapi.Expand(req.URL, map[string]string{
5486 "parent": c.parent,
5487 })
5488 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.revisions.permissions.batchUpdate", "request", internallog.HTTPRequest(req, body.Bytes()))
5489 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5490 }
5491
5492 // Do executes the "drivelabels.labels.revisions.permissions.batchUpdate" call.
5493 // Any non-2xx status code is an error. Response headers are in either
5494 // *GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse.ServerResponse.He
5495 // ader or (if a response was returned at all) in
5496 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5497 // whether the returned error was because http.StatusNotModified was returned.
5498 func (c *LabelsRevisionsPermissionsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse, error) {
5499 gensupport.SetOptions(c.urlParams_, opts...)
5500 res, err := c.doRequest("json")
5501 if res != nil && res.StatusCode == http.StatusNotModified {
5502 if res.Body != nil {
5503 res.Body.Close()
5504 }
5505 return nil, gensupport.WrapError(&googleapi.Error{
5506 Code: res.StatusCode,
5507 Header: res.Header,
5508 })
5509 }
5510 if err != nil {
5511 return nil, err
5512 }
5513 defer googleapi.CloseBody(res)
5514 if err := googleapi.CheckResponse(res); err != nil {
5515 return nil, gensupport.WrapError(err)
5516 }
5517 ret := &GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse{
5518 ServerResponse: googleapi.ServerResponse{
5519 Header: res.Header,
5520 HTTPStatusCode: res.StatusCode,
5521 },
5522 }
5523 target := &ret
5524 b, err := gensupport.DecodeResponseBytes(target, res)
5525 if err != nil {
5526 return nil, err
5527 }
5528 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.revisions.permissions.batchUpdate", "response", internallog.HTTPResponse(res, b))
5529 return ret, nil
5530 }
5531
5532 type LabelsRevisionsPermissionsCreateCall struct {
5533 s *Service
5534 parent string
5535 googleappsdrivelabelsv2labelpermission *GoogleAppsDriveLabelsV2LabelPermission
5536 urlParams_ gensupport.URLParams
5537 ctx_ context.Context
5538 header_ http.Header
5539 }
5540
5541 // Create: Updates a label's permissions. If a permission for the indicated
5542 // principal doesn't exist, a label permission is created, otherwise the
5543 // existing permission is updated. Permissions affect the label resource as a
5544 // whole, aren't revisioned, and don't require publishing.
5545 //
5546 // - parent: The parent label resource name on the label permission is created.
5547 // Format: `labels/{label}`.
5548 func (r *LabelsRevisionsPermissionsService) Create(parent string, googleappsdrivelabelsv2labelpermission *GoogleAppsDriveLabelsV2LabelPermission) *LabelsRevisionsPermissionsCreateCall {
5549 c := &LabelsRevisionsPermissionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5550 c.parent = parent
5551 c.googleappsdrivelabelsv2labelpermission = googleappsdrivelabelsv2labelpermission
5552 return c
5553 }
5554
5555 // UseAdminAccess sets the optional parameter "useAdminAccess": Set to `true`
5556 // in order to use the user's admin credentials. The server will verify the
5557 // user is an admin for the label before allowing access.
5558 func (c *LabelsRevisionsPermissionsCreateCall) UseAdminAccess(useAdminAccess bool) *LabelsRevisionsPermissionsCreateCall {
5559 c.urlParams_.Set("useAdminAccess", fmt.Sprint(useAdminAccess))
5560 return c
5561 }
5562
5563 // Fields allows partial responses to be retrieved. See
5564 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5565 // details.
5566 func (c *LabelsRevisionsPermissionsCreateCall) Fields(s ...googleapi.Field) *LabelsRevisionsPermissionsCreateCall {
5567 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5568 return c
5569 }
5570
5571 // Context sets the context to be used in this call's Do method.
5572 func (c *LabelsRevisionsPermissionsCreateCall) Context(ctx context.Context) *LabelsRevisionsPermissionsCreateCall {
5573 c.ctx_ = ctx
5574 return c
5575 }
5576
5577 // Header returns a http.Header that can be modified by the caller to add
5578 // headers to the request.
5579 func (c *LabelsRevisionsPermissionsCreateCall) Header() http.Header {
5580 if c.header_ == nil {
5581 c.header_ = make(http.Header)
5582 }
5583 return c.header_
5584 }
5585
5586 func (c *LabelsRevisionsPermissionsCreateCall) doRequest(alt string) (*http.Response, error) {
5587 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5588 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googleappsdrivelabelsv2labelpermission)
5589 if err != nil {
5590 return nil, err
5591 }
5592 c.urlParams_.Set("alt", alt)
5593 c.urlParams_.Set("prettyPrint", "false")
5594 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/permissions")
5595 urls += "?" + c.urlParams_.Encode()
5596 req, err := http.NewRequest("POST", urls, body)
5597 if err != nil {
5598 return nil, err
5599 }
5600 req.Header = reqHeaders
5601 googleapi.Expand(req.URL, map[string]string{
5602 "parent": c.parent,
5603 })
5604 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.revisions.permissions.create", "request", internallog.HTTPRequest(req, body.Bytes()))
5605 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5606 }
5607
5608 // Do executes the "drivelabels.labels.revisions.permissions.create" call.
5609 // Any non-2xx status code is an error. Response headers are in either
5610 // *GoogleAppsDriveLabelsV2LabelPermission.ServerResponse.Header or (if a
5611 // response was returned at all) in error.(*googleapi.Error).Header. Use
5612 // googleapi.IsNotModified to check whether the returned error was because
5613 // http.StatusNotModified was returned.
5614 func (c *LabelsRevisionsPermissionsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleAppsDriveLabelsV2LabelPermission, error) {
5615 gensupport.SetOptions(c.urlParams_, opts...)
5616 res, err := c.doRequest("json")
5617 if res != nil && res.StatusCode == http.StatusNotModified {
5618 if res.Body != nil {
5619 res.Body.Close()
5620 }
5621 return nil, gensupport.WrapError(&googleapi.Error{
5622 Code: res.StatusCode,
5623 Header: res.Header,
5624 })
5625 }
5626 if err != nil {
5627 return nil, err
5628 }
5629 defer googleapi.CloseBody(res)
5630 if err := googleapi.CheckResponse(res); err != nil {
5631 return nil, gensupport.WrapError(err)
5632 }
5633 ret := &GoogleAppsDriveLabelsV2LabelPermission{
5634 ServerResponse: googleapi.ServerResponse{
5635 Header: res.Header,
5636 HTTPStatusCode: res.StatusCode,
5637 },
5638 }
5639 target := &ret
5640 b, err := gensupport.DecodeResponseBytes(target, res)
5641 if err != nil {
5642 return nil, err
5643 }
5644 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.revisions.permissions.create", "response", internallog.HTTPResponse(res, b))
5645 return ret, nil
5646 }
5647
5648 type LabelsRevisionsPermissionsDeleteCall struct {
5649 s *Service
5650 name string
5651 urlParams_ gensupport.URLParams
5652 ctx_ context.Context
5653 header_ http.Header
5654 }
5655
5656 // Delete: Deletes a label's permission. Permissions affect the label resource
5657 // as a whole, aren't revisioned, and don't require publishing.
5658 //
5659 // - name: Label permission resource name.
5660 func (r *LabelsRevisionsPermissionsService) Delete(name string) *LabelsRevisionsPermissionsDeleteCall {
5661 c := &LabelsRevisionsPermissionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5662 c.name = name
5663 return c
5664 }
5665
5666 // UseAdminAccess sets the optional parameter "useAdminAccess": Set to `true`
5667 // in order to use the user's admin credentials. The server will verify the
5668 // user is an admin for the label before allowing access.
5669 func (c *LabelsRevisionsPermissionsDeleteCall) UseAdminAccess(useAdminAccess bool) *LabelsRevisionsPermissionsDeleteCall {
5670 c.urlParams_.Set("useAdminAccess", fmt.Sprint(useAdminAccess))
5671 return c
5672 }
5673
5674 // Fields allows partial responses to be retrieved. See
5675 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5676 // details.
5677 func (c *LabelsRevisionsPermissionsDeleteCall) Fields(s ...googleapi.Field) *LabelsRevisionsPermissionsDeleteCall {
5678 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5679 return c
5680 }
5681
5682 // Context sets the context to be used in this call's Do method.
5683 func (c *LabelsRevisionsPermissionsDeleteCall) Context(ctx context.Context) *LabelsRevisionsPermissionsDeleteCall {
5684 c.ctx_ = ctx
5685 return c
5686 }
5687
5688 // Header returns a http.Header that can be modified by the caller to add
5689 // headers to the request.
5690 func (c *LabelsRevisionsPermissionsDeleteCall) Header() http.Header {
5691 if c.header_ == nil {
5692 c.header_ = make(http.Header)
5693 }
5694 return c.header_
5695 }
5696
5697 func (c *LabelsRevisionsPermissionsDeleteCall) doRequest(alt string) (*http.Response, error) {
5698 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5699 c.urlParams_.Set("alt", alt)
5700 c.urlParams_.Set("prettyPrint", "false")
5701 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
5702 urls += "?" + c.urlParams_.Encode()
5703 req, err := http.NewRequest("DELETE", urls, nil)
5704 if err != nil {
5705 return nil, err
5706 }
5707 req.Header = reqHeaders
5708 googleapi.Expand(req.URL, map[string]string{
5709 "name": c.name,
5710 })
5711 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.revisions.permissions.delete", "request", internallog.HTTPRequest(req, nil))
5712 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5713 }
5714
5715 // Do executes the "drivelabels.labels.revisions.permissions.delete" call.
5716 // Any non-2xx status code is an error. Response headers are in either
5717 // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at
5718 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5719 // check whether the returned error was because http.StatusNotModified was
5720 // returned.
5721 func (c *LabelsRevisionsPermissionsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
5722 gensupport.SetOptions(c.urlParams_, opts...)
5723 res, err := c.doRequest("json")
5724 if res != nil && res.StatusCode == http.StatusNotModified {
5725 if res.Body != nil {
5726 res.Body.Close()
5727 }
5728 return nil, gensupport.WrapError(&googleapi.Error{
5729 Code: res.StatusCode,
5730 Header: res.Header,
5731 })
5732 }
5733 if err != nil {
5734 return nil, err
5735 }
5736 defer googleapi.CloseBody(res)
5737 if err := googleapi.CheckResponse(res); err != nil {
5738 return nil, gensupport.WrapError(err)
5739 }
5740 ret := &GoogleProtobufEmpty{
5741 ServerResponse: googleapi.ServerResponse{
5742 Header: res.Header,
5743 HTTPStatusCode: res.StatusCode,
5744 },
5745 }
5746 target := &ret
5747 b, err := gensupport.DecodeResponseBytes(target, res)
5748 if err != nil {
5749 return nil, err
5750 }
5751 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.revisions.permissions.delete", "response", internallog.HTTPResponse(res, b))
5752 return ret, nil
5753 }
5754
5755 type LabelsRevisionsPermissionsListCall struct {
5756 s *Service
5757 parent string
5758 urlParams_ gensupport.URLParams
5759 ifNoneMatch_ string
5760 ctx_ context.Context
5761 header_ http.Header
5762 }
5763
5764 // List: Lists a label's permissions.
5765 //
5766 // - parent: The parent label resource name on which label permissions are
5767 // listed. Format: `labels/{label}`.
5768 func (r *LabelsRevisionsPermissionsService) List(parent string) *LabelsRevisionsPermissionsListCall {
5769 c := &LabelsRevisionsPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5770 c.parent = parent
5771 return c
5772 }
5773
5774 // PageSize sets the optional parameter "pageSize": Maximum number of
5775 // permissions to return per page. Default: 50. Max: 200.
5776 func (c *LabelsRevisionsPermissionsListCall) PageSize(pageSize int64) *LabelsRevisionsPermissionsListCall {
5777 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5778 return c
5779 }
5780
5781 // PageToken sets the optional parameter "pageToken": The token of the page to
5782 // return.
5783 func (c *LabelsRevisionsPermissionsListCall) PageToken(pageToken string) *LabelsRevisionsPermissionsListCall {
5784 c.urlParams_.Set("pageToken", pageToken)
5785 return c
5786 }
5787
5788 // UseAdminAccess sets the optional parameter "useAdminAccess": Set to `true`
5789 // in order to use the user's admin credentials. The server will verify the
5790 // user is an admin for the label before allowing access.
5791 func (c *LabelsRevisionsPermissionsListCall) UseAdminAccess(useAdminAccess bool) *LabelsRevisionsPermissionsListCall {
5792 c.urlParams_.Set("useAdminAccess", fmt.Sprint(useAdminAccess))
5793 return c
5794 }
5795
5796 // Fields allows partial responses to be retrieved. See
5797 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5798 // details.
5799 func (c *LabelsRevisionsPermissionsListCall) Fields(s ...googleapi.Field) *LabelsRevisionsPermissionsListCall {
5800 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5801 return c
5802 }
5803
5804 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5805 // object's ETag matches the given value. This is useful for getting updates
5806 // only after the object has changed since the last request.
5807 func (c *LabelsRevisionsPermissionsListCall) IfNoneMatch(entityTag string) *LabelsRevisionsPermissionsListCall {
5808 c.ifNoneMatch_ = entityTag
5809 return c
5810 }
5811
5812 // Context sets the context to be used in this call's Do method.
5813 func (c *LabelsRevisionsPermissionsListCall) Context(ctx context.Context) *LabelsRevisionsPermissionsListCall {
5814 c.ctx_ = ctx
5815 return c
5816 }
5817
5818 // Header returns a http.Header that can be modified by the caller to add
5819 // headers to the request.
5820 func (c *LabelsRevisionsPermissionsListCall) Header() http.Header {
5821 if c.header_ == nil {
5822 c.header_ = make(http.Header)
5823 }
5824 return c.header_
5825 }
5826
5827 func (c *LabelsRevisionsPermissionsListCall) doRequest(alt string) (*http.Response, error) {
5828 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5829 if c.ifNoneMatch_ != "" {
5830 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5831 }
5832 c.urlParams_.Set("alt", alt)
5833 c.urlParams_.Set("prettyPrint", "false")
5834 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/permissions")
5835 urls += "?" + c.urlParams_.Encode()
5836 req, err := http.NewRequest("GET", urls, nil)
5837 if err != nil {
5838 return nil, err
5839 }
5840 req.Header = reqHeaders
5841 googleapi.Expand(req.URL, map[string]string{
5842 "parent": c.parent,
5843 })
5844 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.labels.revisions.permissions.list", "request", internallog.HTTPRequest(req, nil))
5845 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5846 }
5847
5848 // Do executes the "drivelabels.labels.revisions.permissions.list" call.
5849 // Any non-2xx status code is an error. Response headers are in either
5850 // *GoogleAppsDriveLabelsV2ListLabelPermissionsResponse.ServerResponse.Header
5851 // or (if a response was returned at all) in error.(*googleapi.Error).Header.
5852 // Use googleapi.IsNotModified to check whether the returned error was because
5853 // http.StatusNotModified was returned.
5854 func (c *LabelsRevisionsPermissionsListCall) Do(opts ...googleapi.CallOption) (*GoogleAppsDriveLabelsV2ListLabelPermissionsResponse, error) {
5855 gensupport.SetOptions(c.urlParams_, opts...)
5856 res, err := c.doRequest("json")
5857 if res != nil && res.StatusCode == http.StatusNotModified {
5858 if res.Body != nil {
5859 res.Body.Close()
5860 }
5861 return nil, gensupport.WrapError(&googleapi.Error{
5862 Code: res.StatusCode,
5863 Header: res.Header,
5864 })
5865 }
5866 if err != nil {
5867 return nil, err
5868 }
5869 defer googleapi.CloseBody(res)
5870 if err := googleapi.CheckResponse(res); err != nil {
5871 return nil, gensupport.WrapError(err)
5872 }
5873 ret := &GoogleAppsDriveLabelsV2ListLabelPermissionsResponse{
5874 ServerResponse: googleapi.ServerResponse{
5875 Header: res.Header,
5876 HTTPStatusCode: res.StatusCode,
5877 },
5878 }
5879 target := &ret
5880 b, err := gensupport.DecodeResponseBytes(target, res)
5881 if err != nil {
5882 return nil, err
5883 }
5884 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.labels.revisions.permissions.list", "response", internallog.HTTPResponse(res, b))
5885 return ret, nil
5886 }
5887
5888 // Pages invokes f for each page of results.
5889 // A non-nil error returned from f will halt the iteration.
5890 // The provided context supersedes any context provided to the Context method.
5891 func (c *LabelsRevisionsPermissionsListCall) Pages(ctx context.Context, f func(*GoogleAppsDriveLabelsV2ListLabelPermissionsResponse) error) error {
5892 c.ctx_ = ctx
5893 defer c.PageToken(c.urlParams_.Get("pageToken"))
5894 for {
5895 x, err := c.Do()
5896 if err != nil {
5897 return err
5898 }
5899 if err := f(x); err != nil {
5900 return err
5901 }
5902 if x.NextPageToken == "" {
5903 return nil
5904 }
5905 c.PageToken(x.NextPageToken)
5906 }
5907 }
5908
5909 type LimitsGetLabelCall struct {
5910 s *Service
5911 urlParams_ gensupport.URLParams
5912 ifNoneMatch_ string
5913 ctx_ context.Context
5914 header_ http.Header
5915 }
5916
5917 // GetLabel: Get the constraints on the structure of a label; such as, the
5918 // maximum number of fields allowed and maximum length of the label title.
5919 func (r *LimitsService) GetLabel() *LimitsGetLabelCall {
5920 c := &LimitsGetLabelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5921 return c
5922 }
5923
5924 // Name sets the optional parameter "name": Required. Label revision resource
5925 // name must be: "limits/label".
5926 func (c *LimitsGetLabelCall) Name(name string) *LimitsGetLabelCall {
5927 c.urlParams_.Set("name", name)
5928 return c
5929 }
5930
5931 // Fields allows partial responses to be retrieved. See
5932 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5933 // details.
5934 func (c *LimitsGetLabelCall) Fields(s ...googleapi.Field) *LimitsGetLabelCall {
5935 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5936 return c
5937 }
5938
5939 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5940 // object's ETag matches the given value. This is useful for getting updates
5941 // only after the object has changed since the last request.
5942 func (c *LimitsGetLabelCall) IfNoneMatch(entityTag string) *LimitsGetLabelCall {
5943 c.ifNoneMatch_ = entityTag
5944 return c
5945 }
5946
5947 // Context sets the context to be used in this call's Do method.
5948 func (c *LimitsGetLabelCall) Context(ctx context.Context) *LimitsGetLabelCall {
5949 c.ctx_ = ctx
5950 return c
5951 }
5952
5953 // Header returns a http.Header that can be modified by the caller to add
5954 // headers to the request.
5955 func (c *LimitsGetLabelCall) Header() http.Header {
5956 if c.header_ == nil {
5957 c.header_ = make(http.Header)
5958 }
5959 return c.header_
5960 }
5961
5962 func (c *LimitsGetLabelCall) doRequest(alt string) (*http.Response, error) {
5963 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5964 if c.ifNoneMatch_ != "" {
5965 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5966 }
5967 c.urlParams_.Set("alt", alt)
5968 c.urlParams_.Set("prettyPrint", "false")
5969 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/limits/label")
5970 urls += "?" + c.urlParams_.Encode()
5971 req, err := http.NewRequest("GET", urls, nil)
5972 if err != nil {
5973 return nil, err
5974 }
5975 req.Header = reqHeaders
5976 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.limits.getLabel", "request", internallog.HTTPRequest(req, nil))
5977 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5978 }
5979
5980 // Do executes the "drivelabels.limits.getLabel" call.
5981 // Any non-2xx status code is an error. Response headers are in either
5982 // *GoogleAppsDriveLabelsV2LabelLimits.ServerResponse.Header or (if a response
5983 // was returned at all) in error.(*googleapi.Error).Header. Use
5984 // googleapi.IsNotModified to check whether the returned error was because
5985 // http.StatusNotModified was returned.
5986 func (c *LimitsGetLabelCall) Do(opts ...googleapi.CallOption) (*GoogleAppsDriveLabelsV2LabelLimits, error) {
5987 gensupport.SetOptions(c.urlParams_, opts...)
5988 res, err := c.doRequest("json")
5989 if res != nil && res.StatusCode == http.StatusNotModified {
5990 if res.Body != nil {
5991 res.Body.Close()
5992 }
5993 return nil, gensupport.WrapError(&googleapi.Error{
5994 Code: res.StatusCode,
5995 Header: res.Header,
5996 })
5997 }
5998 if err != nil {
5999 return nil, err
6000 }
6001 defer googleapi.CloseBody(res)
6002 if err := googleapi.CheckResponse(res); err != nil {
6003 return nil, gensupport.WrapError(err)
6004 }
6005 ret := &GoogleAppsDriveLabelsV2LabelLimits{
6006 ServerResponse: googleapi.ServerResponse{
6007 Header: res.Header,
6008 HTTPStatusCode: res.StatusCode,
6009 },
6010 }
6011 target := &ret
6012 b, err := gensupport.DecodeResponseBytes(target, res)
6013 if err != nil {
6014 return nil, err
6015 }
6016 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.limits.getLabel", "response", internallog.HTTPResponse(res, b))
6017 return ret, nil
6018 }
6019
6020 type UsersGetCapabilitiesCall struct {
6021 s *Service
6022 name string
6023 urlParams_ gensupport.URLParams
6024 ifNoneMatch_ string
6025 ctx_ context.Context
6026 header_ http.Header
6027 }
6028
6029 // GetCapabilities: Gets the user capabilities.
6030 //
6031 // - name: The resource name of the user. Only "users/me/capabilities" is
6032 // supported.
6033 func (r *UsersService) GetCapabilities(name string) *UsersGetCapabilitiesCall {
6034 c := &UsersGetCapabilitiesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6035 c.name = name
6036 return c
6037 }
6038
6039 // Customer sets the optional parameter "customer": The customer to scope this
6040 // request to. For example: `customers/abcd1234`. If unset, it will return
6041 // settings within the current customer.
6042 func (c *UsersGetCapabilitiesCall) Customer(customer string) *UsersGetCapabilitiesCall {
6043 c.urlParams_.Set("customer", customer)
6044 return c
6045 }
6046
6047 // Fields allows partial responses to be retrieved. See
6048 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6049 // details.
6050 func (c *UsersGetCapabilitiesCall) Fields(s ...googleapi.Field) *UsersGetCapabilitiesCall {
6051 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6052 return c
6053 }
6054
6055 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6056 // object's ETag matches the given value. This is useful for getting updates
6057 // only after the object has changed since the last request.
6058 func (c *UsersGetCapabilitiesCall) IfNoneMatch(entityTag string) *UsersGetCapabilitiesCall {
6059 c.ifNoneMatch_ = entityTag
6060 return c
6061 }
6062
6063 // Context sets the context to be used in this call's Do method.
6064 func (c *UsersGetCapabilitiesCall) Context(ctx context.Context) *UsersGetCapabilitiesCall {
6065 c.ctx_ = ctx
6066 return c
6067 }
6068
6069 // Header returns a http.Header that can be modified by the caller to add
6070 // headers to the request.
6071 func (c *UsersGetCapabilitiesCall) Header() http.Header {
6072 if c.header_ == nil {
6073 c.header_ = make(http.Header)
6074 }
6075 return c.header_
6076 }
6077
6078 func (c *UsersGetCapabilitiesCall) doRequest(alt string) (*http.Response, error) {
6079 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6080 if c.ifNoneMatch_ != "" {
6081 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6082 }
6083 c.urlParams_.Set("alt", alt)
6084 c.urlParams_.Set("prettyPrint", "false")
6085 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
6086 urls += "?" + c.urlParams_.Encode()
6087 req, err := http.NewRequest("GET", urls, nil)
6088 if err != nil {
6089 return nil, err
6090 }
6091 req.Header = reqHeaders
6092 googleapi.Expand(req.URL, map[string]string{
6093 "name": c.name,
6094 })
6095 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "drivelabels.users.getCapabilities", "request", internallog.HTTPRequest(req, nil))
6096 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6097 }
6098
6099 // Do executes the "drivelabels.users.getCapabilities" call.
6100 // Any non-2xx status code is an error. Response headers are in either
6101 // *GoogleAppsDriveLabelsV2UserCapabilities.ServerResponse.Header or (if a
6102 // response was returned at all) in error.(*googleapi.Error).Header. Use
6103 // googleapi.IsNotModified to check whether the returned error was because
6104 // http.StatusNotModified was returned.
6105 func (c *UsersGetCapabilitiesCall) Do(opts ...googleapi.CallOption) (*GoogleAppsDriveLabelsV2UserCapabilities, error) {
6106 gensupport.SetOptions(c.urlParams_, opts...)
6107 res, err := c.doRequest("json")
6108 if res != nil && res.StatusCode == http.StatusNotModified {
6109 if res.Body != nil {
6110 res.Body.Close()
6111 }
6112 return nil, gensupport.WrapError(&googleapi.Error{
6113 Code: res.StatusCode,
6114 Header: res.Header,
6115 })
6116 }
6117 if err != nil {
6118 return nil, err
6119 }
6120 defer googleapi.CloseBody(res)
6121 if err := googleapi.CheckResponse(res); err != nil {
6122 return nil, gensupport.WrapError(err)
6123 }
6124 ret := &GoogleAppsDriveLabelsV2UserCapabilities{
6125 ServerResponse: googleapi.ServerResponse{
6126 Header: res.Header,
6127 HTTPStatusCode: res.StatusCode,
6128 },
6129 }
6130 target := &ret
6131 b, err := gensupport.DecodeResponseBytes(target, res)
6132 if err != nil {
6133 return nil, err
6134 }
6135 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "drivelabels.users.getCapabilities", "response", internallog.HTTPResponse(res, b))
6136 return ret, nil
6137 }