31 #import <Foundation/Foundation.h>
35 #if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
36 #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
39 #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
40 #import <Protobuf/Any.pbobjc.h>
41 #import <Protobuf/Duration.pbobjc.h>
42 #import <Protobuf/Timestamp.pbobjc.h>
49 NS_ASSUME_NONNULL_BEGIN
57 typedef NS_ENUM(NSInteger, GPBWellKnownTypesErrorCode) {
59 GPBWellKnownTypesErrorCodeFailedToComputeTypeURL = -100,
61 GPBWellKnownTypesErrorCodeTypeURLMismatch = -101,
64 #pragma mark - GPBTimestamp
72 @property(nonatomic, readwrite, strong) NSDate *date;
80 @property(nonatomic, readwrite) NSTimeInterval timeIntervalSince1970;
89 - (instancetype)initWithDate:(NSDate *)date;
98 - (instancetype)initWithTimeIntervalSince1970:(NSTimeInterval)timeIntervalSince1970;
102 #pragma mark - GPBDuration
115 @property(nonatomic, readwrite) NSTimeInterval timeInterval;
124 - (instancetype)initWithTimeInterval:(NSTimeInterval)timeInterval;
131 @property(nonatomic, readwrite) NSTimeInterval timeIntervalSince1970
132 __attribute__((deprecated(
"Use timeInterval")));
134 - (instancetype)initWithTimeIntervalSince1970:(NSTimeInterval)timeIntervalSince1970
135 __attribute__((deprecated("Use initWithTimeInterval:")));
139 #pragma mark - GPBAny
156 + (nullable instancetype)anyWithMessage:(nonnull
GPBMessage *)message
157 error:(NSError **)errorPtr;
169 + (nullable instancetype)anyWithMessage:(nonnull
GPBMessage *)message
170 typeURLPrefix:(nonnull NSString *)typeURLPrefix
171 error:(NSError **)errorPtr;
183 - (nullable instancetype)initWithMessage:(nonnull
GPBMessage *)message
184 error:(NSError **)errorPtr;
196 - (nullable instancetype)initWithMessage:(nonnull
GPBMessage *)message
197 typeURLPrefix:(nonnull NSString *)typeURLPrefix
198 error:(NSError **)errorPtr;
210 - (BOOL)packWithMessage:(nonnull
GPBMessage *)message
211 error:(NSError **)errorPtr;
223 - (BOOL)packWithMessage:(nonnull
GPBMessage *)message
224 typeURLPrefix:(nonnull NSString *)typeURLPrefix
225 error:(NSError **)errorPtr;
240 - (nullable
GPBMessage *)unpackMessageClass:(Class)messageClass
241 error:(NSError **)errorPtr;
245 NS_ASSUME_NONNULL_END