Status.pbobjc.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /*
  2. * Copyright 2017 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. // Generated by the protocol buffer compiler. DO NOT EDIT!
  17. // source: google/rpc/status.proto
  18. // This CPP symbol can be defined to use imports that match up to the framework
  19. // imports needed when using CocoaPods.
  20. #if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
  21. #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
  22. #endif
  23. #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
  24. #import <Protobuf/GPBProtocolBuffers.h>
  25. #else
  26. #import "GPBProtocolBuffers.h"
  27. #endif
  28. #if GOOGLE_PROTOBUF_OBJC_VERSION < 30002
  29. #error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.
  30. #endif
  31. #if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION
  32. #error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources.
  33. #endif
  34. // @@protoc_insertion_point(imports)
  35. #pragma clang diagnostic push
  36. #pragma clang diagnostic ignored "-Wdeprecated-declarations"
  37. CF_EXTERN_C_BEGIN
  38. @class GPBAny;
  39. NS_ASSUME_NONNULL_BEGIN
  40. #pragma mark - RPCStatusRoot
  41. /**
  42. * Exposes the extension registry for this file.
  43. *
  44. * The base class provides:
  45. * @code
  46. * + (GPBExtensionRegistry *)extensionRegistry;
  47. * @endcode
  48. * which is a @c GPBExtensionRegistry that includes all the extensions defined by
  49. * this file and all files that it depends on.
  50. **/
  51. @interface RPCStatusRoot : GPBRootObject
  52. @end
  53. #pragma mark - RPCStatus
  54. typedef GPB_ENUM(RPCStatus_FieldNumber) {
  55. RPCStatus_FieldNumber_Code = 1,
  56. RPCStatus_FieldNumber_Message = 2,
  57. RPCStatus_FieldNumber_DetailsArray = 3,
  58. };
  59. /**
  60. * The `Status` type defines a logical error model that is suitable for different
  61. * programming environments, including REST APIs and RPC APIs. It is used by
  62. * [gRPC](https://github.com/grpc). The error model is designed to be:
  63. *
  64. * - Simple to use and understand for most users
  65. * - Flexible enough to meet unexpected needs
  66. *
  67. * # Overview
  68. *
  69. * The `Status` message contains three pieces of data: error code, error message,
  70. * and error details. The error code should be an enum value of
  71. * [google.rpc.Code][google.rpc.Code], but it may accept additional error codes if needed. The
  72. * error message should be a developer-facing English message that helps
  73. * developers *understand* and *resolve* the error. If a localized user-facing
  74. * error message is needed, put the localized message in the error details or
  75. * localize it in the client. The optional error details may contain arbitrary
  76. * information about the error. There is a predefined set of error detail types
  77. * in the package `google.rpc` that can be used for common error conditions.
  78. *
  79. * # Language mapping
  80. *
  81. * The `Status` message is the logical representation of the error model, but it
  82. * is not necessarily the actual wire format. When the `Status` message is
  83. * exposed in different client libraries and different wire protocols, it can be
  84. * mapped differently. For example, it will likely be mapped to some exceptions
  85. * in Java, but more likely mapped to some error codes in C.
  86. *
  87. * # Other uses
  88. *
  89. * The error model and the `Status` message can be used in a variety of
  90. * environments, either with or without APIs, to provide a
  91. * consistent developer experience across different environments.
  92. *
  93. * Example uses of this error model include:
  94. *
  95. * - Partial errors. If a service needs to return partial errors to the client,
  96. * it may embed the `Status` in the normal response to indicate the partial
  97. * errors.
  98. *
  99. * - Workflow errors. A typical workflow has multiple steps. Each step may
  100. * have a `Status` message for error reporting.
  101. *
  102. * - Batch operations. If a client uses batch request and batch response, the
  103. * `Status` message should be used directly inside batch response, one for
  104. * each error sub-response.
  105. *
  106. * - Asynchronous operations. If an API call embeds asynchronous operation
  107. * results in its response, the status of those operations should be
  108. * represented directly using the `Status` message.
  109. *
  110. * - Logging. If some API errors are stored in logs, the message `Status` could
  111. * be used directly after any stripping needed for security/privacy reasons.
  112. **/
  113. @interface RPCStatus : GPBMessage
  114. /** The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. */
  115. @property(nonatomic, readwrite) int32_t code;
  116. /**
  117. * A developer-facing error message, which should be in English. Any
  118. * user-facing error message should be localized and sent in the
  119. * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
  120. **/
  121. @property(nonatomic, readwrite, copy, null_resettable) NSString *message;
  122. /**
  123. * A list of messages that carry the error details. There is a common set of
  124. * message types for APIs to use.
  125. **/
  126. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBAny*> *detailsArray;
  127. /** The number of items in @c detailsArray without causing the array to be created. */
  128. @property(nonatomic, readonly) NSUInteger detailsArray_Count;
  129. @end
  130. NS_ASSUME_NONNULL_END
  131. CF_EXTERN_C_END
  132. #pragma clang diagnostic pop
  133. // @@protoc_insertion_point(global_scope)