Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions ArtikCloud.podspec
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@

Pod::Spec.new do |s|
s.name = "ArtikCloud"
s.version = "2.2.3"
s.version = "2.2.4"

s.summary = "ARTIK Cloud API"
s.description = <<-DESC
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
ARTIK Cloud cocoapod: https://deverloper.artik.cloud
DESC

s.platform = :ios, '7.0'
s.platform = :ios, '9.0'
s.requires_arc = true

s.framework = 'SystemConfiguration'

s.homepage = "https://github.com/artikcloud/artikcloud-objc"
s.license = "Proprietary"
s.license = "Apache License, Version 2.0"
s.source = { :git => "https://github.com/artikcloud/artikcloud-objc.git", :tag => "#{s.version}" }
s.author = { "Samsung Artik Cloud" => "developer@artik.cloud" }
s.author = { "Samsung ArtikCloud" => "support@artik.cloud" }

s.source_files = 'ArtikCloud/**/*.{m,h}'
s.public_header_files = 'ArtikCloud/**/*.h'


s.dependency 'AFNetworking', '~> 3'
s.dependency 'JSONModel', '~> 1.2'
s.dependency 'ISO8601', '~> 0.6'
s.dependency 'ISO8601', '~> 0.5'
end

43 changes: 43 additions & 0 deletions ArtikCloud/Api/ACDefaultApi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#import <Foundation/Foundation.h>
#import "ACScenesEnvelope.h"
#import "ACApi.h"

/**
* ARTIK Cloud API
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: 2.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/



@interface ACDefaultApi: NSObject <ACApi>

extern NSString* kACDefaultApiErrorDomain;
extern NSInteger kACDefaultApiMissingParamErrorCode;

-(instancetype) initWithApiClient:(ACApiClient *)apiClient NS_DESIGNATED_INITIALIZER;

/// Get all user scenes
/// Get all user scenes
///
/// @param uid User id
/// @param count count (optional)
/// @param offset offset (optional)
///
/// code:0 message:"success"
///
/// @return ACScenesEnvelope*
-(NSURLSessionTask*) getUserScenesWithUid: (NSString*) uid
count: (NSString*) count
offset: (NSString*) offset
completionHandler: (void (^)(ACScenesEnvelope* output, NSError* error)) handler;



@end
137 changes: 137 additions & 0 deletions ArtikCloud/Api/ACDefaultApi.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
#import "ACDefaultApi.h"
#import "ACQueryParamCollection.h"
#import "ACApiClient.h"
#import "ACScenesEnvelope.h"


@interface ACDefaultApi ()

@property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDefaultHeaders;

@end

@implementation ACDefaultApi

NSString* kACDefaultApiErrorDomain = @"ACDefaultApiErrorDomain";
NSInteger kACDefaultApiMissingParamErrorCode = 234513;

@synthesize apiClient = _apiClient;

#pragma mark - Initialize methods

- (instancetype) init {
return [self initWithApiClient:[ACApiClient sharedClient]];
}


-(instancetype) initWithApiClient:(ACApiClient *)apiClient {
self = [super init];
if (self) {
_apiClient = apiClient;
_mutableDefaultHeaders = [NSMutableDictionary dictionary];
}
return self;
}

#pragma mark -

-(NSString*) defaultHeaderForKey:(NSString*)key {
return self.mutableDefaultHeaders[key];
}

-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key {
[self.mutableDefaultHeaders setValue:value forKey:key];
}

-(NSDictionary *)defaultHeaders {
return self.mutableDefaultHeaders;
}

#pragma mark - Api Methods

///
/// Get all user scenes
/// Get all user scenes
/// @param uid User id
///
/// @param count count (optional)
///
/// @param offset offset (optional)
///
/// @returns ACScenesEnvelope*
///
-(NSURLSessionTask*) getUserScenesWithUid: (NSString*) uid
count: (NSString*) count
offset: (NSString*) offset
completionHandler: (void (^)(ACScenesEnvelope* output, NSError* error)) handler {
// verify the required parameter 'uid' is set
if (uid == nil) {
NSParameterAssert(uid);
if(handler) {
NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"uid"] };
NSError* error = [NSError errorWithDomain:kACDefaultApiErrorDomain code:kACDefaultApiMissingParamErrorCode userInfo:userInfo];
handler(nil, error);
}
return nil;
}

NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/users/{uid}/scenes"];

// remove format in URL if needed
[resourcePath replaceOccurrencesOfString:@".{format}" withString:@".json" options:0 range:NSMakeRange(0,resourcePath.length)];

NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];
if (uid != nil) {
pathParams[@"uid"] = uid;
}

NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
if (count != nil) {
queryParams[@"count"] = count;
}
if (offset != nil) {
queryParams[@"offset"] = offset;
}
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders];
[headerParams addEntriesFromDictionary:self.defaultHeaders];
// HTTP header `Accept`
NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]];
if(acceptHeader.length > 0) {
headerParams[@"Accept"] = acceptHeader;
}

// response content type
NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @"";

// request content type
NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]];

// Authentication setting
NSArray *authSettings = @[@"artikcloud_oauth"];

id bodyParam = nil;
NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init];
NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init];

return [self.apiClient requestWithPath: resourcePath
method: @"GET"
pathParams: pathParams
queryParams: queryParams
formParams: formParams
files: localVarFiles
body: bodyParam
headerParams: headerParams
authSettings: authSettings
requestContentType: requestContentType
responseContentType: responseContentType
responseType: @"ACScenesEnvelope*"
completionBlock: ^(id data, NSError *error) {
if(handler) {
handler((ACScenesEnvelope*)data, error);
}
}];
}



@end
29 changes: 29 additions & 0 deletions ArtikCloud/Api/ACDevicesManagementApi.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#import <Foundation/Foundation.h>
#import "ACAcceptanceStatusResponse.h"
#import "ACDeviceTaskUpdateRequest.h"
#import "ACDeviceTaskUpdateResponse.h"
#import "ACDeviceTypesInfo.h"
#import "ACDeviceTypesInfoEnvelope.h"
#import "ACMetadataEnvelope.h"
#import "ACMetadataPropertiesEnvelope.h"
#import "ACMetadataQueryEnvelope.h"
#import "ACPendingTasksList.h"
#import "ACTaskByDidListEnvelope.h"
#import "ACTaskEnvelope.h"
#import "ACTaskListEnvelope.h"
Expand Down Expand Up @@ -83,6 +85,17 @@ extern NSInteger kACDevicesManagementApiMissingParamErrorCode;
completionHandler: (void (^)(ACTaskByDidListEnvelope* output, NSError* error)) handler;


/// Returns the list of pending tasks for a particular device id.
/// Returns the list of all pending tasks (where acceptanceStatus is equal to WAITING ) for a particular device id.
///
///
/// code:0 message:"success"
///
/// @return ACPendingTasksList*
-(NSURLSessionTask*) getAllPendingTasksByDidWithCompletionHandler:
(void (^)(ACPendingTasksList* output, NSError* error)) handler;


/// Read a device type device management information.
/// Read a device type device management information.
///
Expand Down Expand Up @@ -189,6 +202,22 @@ extern NSInteger kACDevicesManagementApiMissingParamErrorCode;
completionHandler: (void (^)(ACTaskListEnvelope* output, NSError* error)) handler;


/// Notify/Inform about task acceptance status
/// User notify/informs to ARTIKCloud about task acceptance status
///
/// @param tid Task ID.
/// @param did Device ID.
/// @param notifyAboutAcceptanceStatus Notify about task acceptance status
///
/// code:0 message:"success"
///
/// @return ACAcceptanceStatusResponse*
-(NSURLSessionTask*) notifyAboutAcceptanceWithTid: (NSString*) tid
did: (NSString*) did
notifyAboutAcceptanceStatus: (ACAcceptanceStatusResponse*) notifyAboutAcceptanceStatus
completionHandler: (void (^)(ACAcceptanceStatusResponse* output, NSError* error)) handler;


/// Query device properties across devices.
/// Query device properties across devices.
///
Expand Down
Loading