summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLAppServiceManifest.h
blob: 94069d104ad5696cce8d4249e7d18053d31bf5df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
//
//  SDLAppServiceManifest.h
//  SmartDeviceLink
//
//  Created by Nicole on 1/25/19.
//  Copyright © 2019 smartdevicelink. All rights reserved.
//

#import "SDLRPCRequest.h"

#import "SDLAppServiceType.h"

@class SDLFunctionID;
@class SDLImage;
@class SDLMediaServiceManifest;
@class SDLNavigationServiceManifest;
@class SDLSyncMsgVersion;
@class SDLMsgVersion;
@class SDLWeatherServiceManifest;


NS_ASSUME_NONNULL_BEGIN

/**
 *  This manifest contains all the information necessary for the service to be published, activated, and allow consumers to interact with it
 */
@interface SDLAppServiceManifest : SDLRPCStruct

/**
 *  Convenience init for serviceType.
 *
 *  @param serviceType The type of service that is to be offered by this app
 *  @return            A SDLAppServiceManifest object
 */
- (instancetype)initWithAppServiceType:(SDLAppServiceType)serviceType NS_DESIGNATED_INITIALIZER;

/**
 *  Convenience init for a media service manifest.
 *
 *  @param serviceName              Unique name of this service
 *  @param serviceIcon              The file name of the icon to be associated with this service
 *  @param allowAppConsumers        If true, app service consumers beyond the IVI system will be able to access this service. If false, only the IVI system will be able consume the service. If not provided, it is assumed to be false
 *  @param rpcSpecVersion           This is the max RPC Spec version the app service understands
 *  @param handledRPCs              This field contains the Function IDs for the RPCs that this service intends to handle correctly
 *  @param mediaServiceManifest     A media service manifest
 *  @return                         A SDLAppServiceManifest object
 */
- (instancetype)initWithMediaServiceName:(nullable NSString *)serviceName serviceIcon:(nullable SDLImage *)serviceIcon allowAppConsumers:(BOOL)allowAppConsumers rpcSpecVersion:(nullable SDLSyncMsgVersion *)rpcSpecVersion handledRPCs:(nullable NSArray<NSNumber<SDLInt> *> *)handledRPCs mediaServiceManifest:(nullable SDLMediaServiceManifest *)mediaServiceManifest __deprecated_msg(("Use initWithMediaServiceName:serviceIcon:allowAppConsumers:maxRPCSpecVersion:handledRPCs:mediaServiceManifest instead"));

/**
 *  Convenience init for a media service manifest.
 *
 *  @param serviceName              Unique name of this service
 *  @param serviceIcon              The file name of the icon to be associated with this service
 *  @param allowAppConsumers        If true, app service consumers beyond the IVI system will be able to access this service. If false, only the IVI system will be able consume the service. If not provided, it is assumed to be false
 *  @param maxRPCSpecVersion        This is the max RPC Spec version the app service understands
 *  @param handledRPCs              This field contains the Function IDs for the RPCs that this service intends to handle correctly
 *  @param mediaServiceManifest     A media service manifest
 *  @return                         A SDLAppServiceManifest object
 */
- (instancetype)initWithMediaServiceName:(nullable NSString *)serviceName serviceIcon:(nullable SDLImage *)serviceIcon allowAppConsumers:(BOOL)allowAppConsumers maxRPCSpecVersion:(nullable SDLMsgVersion *)maxRPCSpecVersion handledRPCs:(nullable NSArray<NSNumber<SDLInt> *> *)handledRPCs mediaServiceManifest:(nullable SDLMediaServiceManifest *)mediaServiceManifest;

/**
 *  Convenience init for a weather service manifest.
 *
 *  @param serviceName              Unique name of this service
 *  @param serviceIcon              The file name of the icon to be associated with this service
 *  @param allowAppConsumers        If true, app service consumers beyond the IVI system will be able to access this service. If false, only the IVI system will be able consume the service. If not provided, it is assumed to be false
 *  @param rpcSpecVersion           This is the max RPC Spec version the app service understands
 *  @param handledRPCs              This field contains the Function IDs for the RPCs that this service intends to handle correctly
 *  @param weatherServiceManifest   A weather service manifest
 *  @return                         A SDLAppServiceManifest object
 */
- (instancetype)initWithWeatherServiceName:(nullable NSString *)serviceName serviceIcon:(nullable SDLImage *)serviceIcon allowAppConsumers:(BOOL)allowAppConsumers rpcSpecVersion:(nullable SDLSyncMsgVersion *)rpcSpecVersion handledRPCs:(nullable NSArray<NSNumber<SDLInt> *> *)handledRPCs weatherServiceManifest:(nullable SDLWeatherServiceManifest *)weatherServiceManifest __deprecated_msg(("Use initWithWeatherServiceName:serviceIcon:allowAppConsumers::maxRPCSpecVersion:handledRPCs:weatherServiceManifest instead"));

/**
 *  Convenience init for a weather service manifest.
 *
 *  @param serviceName              Unique name of this service
 *  @param serviceIcon              The file name of the icon to be associated with this service
 *  @param allowAppConsumers        If true, app service consumers beyond the IVI system will be able to access this service. If false, only the IVI system will be able consume the service. If not provided, it is assumed to be false
 *  @param maxRPCSpecVersion        This is the max RPC Spec version the app service understands
 *  @param handledRPCs              This field contains the Function IDs for the RPCs that this service intends to handle correctly
 *  @param weatherServiceManifest   A weather service manifest
 *  @return                         A SDLAppServiceManifest object
 */
- (instancetype)initWithWeatherServiceName:(nullable NSString *)serviceName serviceIcon:(nullable SDLImage *)serviceIcon allowAppConsumers:(BOOL)allowAppConsumers maxRPCSpecVersion:(nullable SDLMsgVersion *)maxRPCSpecVersion handledRPCs:(nullable NSArray<NSNumber<SDLInt> *> *)handledRPCs weatherServiceManifest:(nullable SDLWeatherServiceManifest *)weatherServiceManifest;

/**
 *  Convenience init for a navigation service manifest.
 *
 *  @param serviceName                  Unique name of this service
 *  @param serviceIcon                  The file name of the icon to be associated with this service
 *  @param allowAppConsumers            If true, app service consumers beyond the IVI system will be able to access this service. If false, only the IVI system will be able consume the service. If not provided, it is assumed to be false
 *  @param rpcSpecVersion               This is the max RPC Spec version the app service understands
 *  @param handledRPCs                  This field contains the Function IDs for the RPCs that this service intends to handle correctly
 *  @param navigationServiceManifest    A navigation service manifest
 *  @return                             A SDLAppServiceManifest object
 */
- (instancetype)initWithNavigationServiceName:(nullable NSString *)serviceName serviceIcon:(nullable SDLImage *)serviceIcon allowAppConsumers:(BOOL)allowAppConsumers rpcSpecVersion:(nullable SDLSyncMsgVersion *)rpcSpecVersion handledRPCs:(nullable NSArray<NSNumber<SDLInt> *> *)handledRPCs navigationServiceManifest:(nullable SDLNavigationServiceManifest *)navigationServiceManifest __deprecated_msg(("Use initWithNavigationServiceName:serviceIcon:allowAppConsumers:macRPCSpecVersion:handledRPCs:navigationServiceManifest instead"));

/**
 *  Convenience init for a navigation service manifest.
 *
 *  @param serviceName                  Unique name of this service
 *  @param serviceIcon                  The file name of the icon to be associated with this service
 *  @param allowAppConsumers            If true, app service consumers beyond the IVI system will be able to access this service. If false, only the IVI system will be able consume the service. If not provided, it is assumed to be false
 *  @param maxRPCSpecVersion            This is the max RPC Spec version the app service understands
 *  @param handledRPCs                  This field contains the Function IDs for the RPCs that this service intends to handle correctly
 *  @param navigationServiceManifest    A navigation service manifest
 *  @return                             A SDLAppServiceManifest object
 */
- (instancetype)initWithNavigationServiceName:(nullable NSString *)serviceName serviceIcon:(nullable SDLImage *)serviceIcon allowAppConsumers:(BOOL)allowAppConsumers maxRPCSpecVersion:(nullable SDLMsgVersion *)maxRPCSpecVersion handledRPCs:(nullable NSArray<NSNumber<SDLInt> *> *)handledRPCs navigationServiceManifest:(nullable SDLNavigationServiceManifest *)navigationServiceManifest;

/**
 *  Convenience init for all parameters.
 *
 *  @param serviceName                  Unique name of this service
 *  @param serviceType                  The type of service that is to be offered by this app
 *  @param serviceIcon                  The file name of the icon to be associated with this service
 *  @param allowAppConsumers            If true, app service consumers beyond the IVI system will be able to access this service. If false, only the IVI system will be able consume the service. If not provided, it is assumed to be false
 *  @param rpcSpecVersion               This is the max RPC Spec version the app service understands
 *  @param handledRPCs                  This field contains the Function IDs for the RPCs that this service intends to handle correctly
 *  @param mediaServiceManifest         A media service manifest
 *  @param weatherServiceManifest       A weather service manifest
 *  @param navigationServiceManifest    A navigation service manifest
 *  @return                             A SDLAppServiceManifest object
 */
- (instancetype)initWithServiceName:(nullable NSString *)serviceName serviceType:(SDLAppServiceType)serviceType serviceIcon:(nullable SDLImage *)serviceIcon allowAppConsumers:(BOOL)allowAppConsumers rpcSpecVersion:(nullable SDLSyncMsgVersion *)rpcSpecVersion handledRPCs:(nullable NSArray<NSNumber<SDLInt> *> *)handledRPCs mediaServiceManifest:(nullable SDLMediaServiceManifest *)mediaServiceManifest weatherServiceManifest:(nullable SDLWeatherServiceManifest *)weatherServiceManifest navigationServiceManifest:(nullable SDLNavigationServiceManifest *)navigationServiceManifest __deprecated_msg(("Use initWithServiceName:serviceType:serviceIcon:allowAppConsumers:maxRPCSpecVersion:handledRPCs:mediaServiceManifest:weatherServiceManifest:navigationServiceManifest instead"));

/**
 *  Convenience init for all parameters.
 *
 *  @param serviceName                  Unique name of this service
 *  @param serviceType                  The type of service that is to be offered by this app
 *  @param serviceIcon                  The file name of the icon to be associated with this service
 *  @param allowAppConsumers            If true, app service consumers beyond the IVI system will be able to access this service. If false, only the IVI system will be able consume the service. If not provided, it is assumed to be false
 *  @param maxRPCSpecVersion            This is the max RPC Spec version the app service understands
 *  @param handledRPCs                  This field contains the Function IDs for the RPCs that this service intends to handle correctly
 *  @param mediaServiceManifest         A media service manifest
 *  @param weatherServiceManifest       A weather service manifest
 *  @param navigationServiceManifest    A navigation service manifest
 *  @return                             A SDLAppServiceManifest object
 */
- (instancetype)initWithServiceName:(nullable NSString *)serviceName serviceType:(SDLAppServiceType)serviceType serviceIcon:(nullable SDLImage *)serviceIcon allowAppConsumers:(BOOL)allowAppConsumers maxRPCSpecVersion:(nullable SDLMsgVersion *)maxRPCSpecVersion handledRPCs:(nullable NSArray<NSNumber<SDLInt> *> *)handledRPCs mediaServiceManifest:(nullable SDLMediaServiceManifest *)mediaServiceManifest weatherServiceManifest:(nullable SDLWeatherServiceManifest *)weatherServiceManifest navigationServiceManifest:(nullable SDLNavigationServiceManifest *)navigationServiceManifest;

/**
 *  Unique name of this service.
 *
 *  String, Optional
 */
@property (nullable, strong, nonatomic) NSString *serviceName;

/**
 *  The type of service that is to be offered by this app. See AppServiceType for known enum equivalent types. Parameter is a string to allow for new service types to be used by apps on older versions of SDL Core.
 *
 *  String, See `SDLAppServiceType`, Required
 */
@property (strong, nonatomic) NSString *serviceType;

/**
 *  The file name of the icon to be associated with this service. Most likely the same as the appIcon.
 *
 *  String, Optional
 */
@property (nullable, strong, nonatomic) SDLImage *serviceIcon;

/**
 *  If true, app service consumers beyond the IVI system will be able to access this service. If false, only the IVI system will be able consume the service. If not provided, it is assumed to be false.
 *
 *  Boolean, Optional, default = NO
 */
@property (nullable, strong, nonatomic) NSNumber<SDLBool> *allowAppConsumers;

/**
 *  This is the max RPC Spec version the app service understands. This is important during the RPC passthrough functionality. If not included, it is assumed the max version of the module is acceptable.
 *
 *  SyncMsgVersion, Optional
 */
@property (nullable, strong, nonatomic) SDLSyncMsgVersion *rpcSpecVersion __deprecated_msg(("Use maxRPCSpecVersion instead"));

/**
 *  This is the max RPC Spec version the app service understands. This is important during the RPC passthrough functionality. If not included, it is assumed the max version of the module is acceptable.
 *
 *  SDLMsgVersion, Optional
 */
@property (nullable, strong, nonatomic) SDLMsgVersion *maxRPCSpecVersion;

/**
 *  This field contains the Function IDs for the RPCs that this service intends to handle correctly. This means the service will provide meaningful responses. See FunctionID for enum equivalent values. This parameter is an integer to allow for new function IDs to be used by apps on older versions of SDL Core.
 *
 *  Array of Integers, See `SDLFunctionID`, Optional
 */
@property (nullable, strong, nonatomic) NSArray<NSNumber<SDLInt> *> *handledRPCs;

/**
 *  A media service manifest.
 *
 *  SDLMediaServiceManifest, Optional
 */
@property (nullable, strong, nonatomic) SDLMediaServiceManifest *mediaServiceManifest;

/**
 *  A weather service manifest.
 *
 *  SDLWeatherServiceManifest, Optional
 */
@property (nullable, strong, nonatomic) SDLWeatherServiceManifest *weatherServiceManifest;

/**
 *  A navigation service manifest.
 *
 *  SDLNavigationServiceManifest, Optional
 */
@property (nullable, strong, nonatomic) SDLNavigationServiceManifest *navigationServiceManifest;

@end

NS_ASSUME_NONNULL_END