• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.apps.drive.labels.v2beta;
18
19option go_package = "google.golang.org/genproto/googleapis/apps/drive/labels/v2beta;labels";
20option java_multiple_files = true;
21option java_outer_classname = "ErrorDetailsProto";
22option java_package = "com.google.apps.drive.labels.v2beta";
23
24// Describes violations in a request to create or update a Label or its
25// Fields.
26message InvalidArgument {
27  // Describes the Field in which the violation occurred.
28  message FieldViolation {
29    // Possible reasons a field is invalid.
30    enum Reason {
31      // Unknown reason.
32      REASON_UNSPECIFIED = 0;
33
34      // The referenced field is required.
35      FIELD_REQUIRED = 1;
36
37      // The referenced value was invalid.
38      INVALID_VALUE = 2;
39
40      // The specified numeric value is out of the allowed range.
41      VALUE_OUT_OF_RANGE = 3;
42
43      // The specified string value was too long.
44      STRING_VALUE_TOO_LONG = 4;
45
46      // The number of entries exceeded the maximum.
47      MAX_ENTRIES_EXCEEDED = 5;
48
49      // The specified field is not found in the Label.
50      FIELD_NOT_FOUND = 6;
51
52      // The specified choice is not found in the Field.
53      CHOICE_NOT_FOUND = 7;
54    }
55
56    // The path to the field where this violation occurred. This path is
57    // specified using `FieldMask` format:
58    // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
59    string field = 1;
60
61    // The detailed reason for this FieldViolation.
62    Reason reason = 2;
63
64    // A message that describes the violation. This message is intended to
65    // be shown to end users, and is localized into the requesting user's
66    // preferred language.
67    string display_message = 3;
68  }
69
70  // Describes all violations in a client request.
71  repeated FieldViolation field_violations = 1;
72}
73
74// Describes what preconditions have failed.
75message PreconditionFailure {
76  // Specific failure reason.
77  message Violation {
78    // The possible reasons a the violation occurred.
79    enum Reason {
80      // Unknown violation type.
81      REASON_UNSPECIFIED = 0;
82
83      // This Resource cannot be Disabled. Only Published resources can be
84      // Disabled.
85      CANNOT_DISABLE = 1;
86
87      // This Resource cannot be Enabled. Only Disabled resources can be
88      // Enabled.
89      CANNOT_ENABLE = 2;
90
91      // This Resource cannot be Published. Only Draft or Disabled resources
92      // can be Published.
93      CANNOT_PUBLISH = 3;
94
95      // This Resource cannot be Unpublished. Once published, resources may
96      // not be set in "Draft" state.
97      CANNOT_UNPUBLISH = 4;
98
99      // This Resource cannot be Deleted. Only Disabled resources
100      // can be Deleted.
101      CANNOT_DELETE = 5;
102
103      // The request modified a range in a Field, but the new range does
104      // not include the previous range. When this error happens, `field` points
105      // at the Field where the violation occurred.
106      CANNOT_RESTRICT_RANGE = 6;
107
108      // The specified change cannot be made to published Resources.
109      CANNOT_CHANGE_PUBLISHED_FIELD = 7;
110
111      // The customer cannot create new labels because the maximum number
112      // of labels for the customer has been reached.
113      CANNOT_CREATE_MORE_LABELS = 8;
114
115      // The Field type cannot be changed because the Field has been published.
116      CANNOT_CHANGE_PUBLISHED_FIELD_TYPE = 9;
117
118      // The Label component is locked and cannot be modified
119      CANNOT_MODIFY_LOCKED_COMPONENT = 10;
120    }
121
122    // The path to the field where this violation occurred. This path is
123    // specified using `FieldMask` format:
124    // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
125    string field = 1;
126
127    // The type of this violation.
128    Reason reason = 2;
129
130    // A message that describes the violation. This message is intended to
131    // be shown to end users, and is localized into the requesting user's
132    // preferred language.
133    string display_message = 3;
134  }
135
136  // Describes all violations in a client request.
137  repeated Violation violation = 1;
138}
139