error_details.proto 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. // Copyright 2022 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. syntax = "proto3";
  15. package google.apps.drive.labels.v2;
  16. option go_package = "google.golang.org/genproto/googleapis/apps/drive/labels/v2;labels";
  17. option java_multiple_files = true;
  18. option java_outer_classname = "ErrorDetailsProto";
  19. option java_package = "com.google.apps.drive.labels.v2";
  20. // Describes violations in a request to create or update a Label or its
  21. // Fields.
  22. message InvalidArgument {
  23. // Describes the Field in which the violation occurred.
  24. message FieldViolation {
  25. // Possible reasons a field is invalid.
  26. enum Reason {
  27. // Unknown reason.
  28. REASON_UNSPECIFIED = 0;
  29. // The referenced field is required.
  30. FIELD_REQUIRED = 1;
  31. // The referenced value was invalid.
  32. INVALID_VALUE = 2;
  33. // The specified numeric value is out of the allowed range.
  34. VALUE_OUT_OF_RANGE = 3;
  35. // The specified string value was too long.
  36. STRING_VALUE_TOO_LONG = 4;
  37. // The number of entries exceeded the maximum.
  38. MAX_ENTRIES_EXCEEDED = 5;
  39. // The specified field is not found in the Label.
  40. FIELD_NOT_FOUND = 6;
  41. // The specified choice is not found in the Field.
  42. CHOICE_NOT_FOUND = 7;
  43. }
  44. // The path to the field where this violation occurred. This path is
  45. // specified using `FieldMask` format:
  46. // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
  47. string field = 1;
  48. // The detailed reason for this FieldViolation.
  49. Reason reason = 2;
  50. // A message that describes the violation. This message is intended to
  51. // be shown to end users, and is localized into the requesting user's
  52. // preferred language.
  53. string display_message = 3;
  54. }
  55. // Describes all violations in a client request.
  56. repeated FieldViolation field_violations = 1;
  57. }
  58. // Describes what preconditions have failed.
  59. message PreconditionFailure {
  60. // Specific failure reason.
  61. message Violation {
  62. // The possible reasons a the violation occurred.
  63. enum Reason {
  64. // Unknown violation type.
  65. REASON_UNSPECIFIED = 0;
  66. // This Resource cannot be Disabled. Only Published resources can be
  67. // Disabled.
  68. CANNOT_DISABLE = 1;
  69. // This Resource cannot be Enabled. Only Disabled resources can be
  70. // Enabled.
  71. CANNOT_ENABLE = 2;
  72. // This Resource cannot be Published. Only Draft or Disabled resources
  73. // can be Published.
  74. CANNOT_PUBLISH = 3;
  75. // This Resource cannot be Unpublished. Once published, resources may
  76. // not be set in "Draft" state.
  77. CANNOT_UNPUBLISH = 4;
  78. // This Resource cannot be Deleted. Only Disabled resources
  79. // can be Deleted.
  80. CANNOT_DELETE = 5;
  81. // The request modified a range in a Field, but the new range does
  82. // not include the previous range. When this error happens, `field` points
  83. // at the Field where the violation occurred.
  84. CANNOT_RESTRICT_RANGE = 6;
  85. // The specified change cannot be made to published Resources.
  86. CANNOT_CHANGE_PUBLISHED_FIELD = 7;
  87. // The customer cannot create new labels because the maximum number
  88. // of labels for the customer has been reached.
  89. CANNOT_CREATE_MORE_LABELS = 8;
  90. // The Field type cannot be changed because the Field has been published.
  91. CANNOT_CHANGE_PUBLISHED_FIELD_TYPE = 9;
  92. // The Label component is locked and cannot be modified
  93. CANNOT_MODIFY_LOCKED_COMPONENT = 10;
  94. }
  95. // The path to the field where this violation occurred. This path is
  96. // specified using `FieldMask` format:
  97. // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
  98. string field = 1;
  99. // The type of this violation.
  100. Reason reason = 2;
  101. // A message that describes the violation. This message is intended to
  102. // be shown to end users, and is localized into the requesting user's
  103. // preferred language.
  104. string display_message = 3;
  105. }
  106. // Describes all violations in a client request.
  107. repeated Violation violation = 1;
  108. }