text:
#import "OAIRemoteAccessApi.h"
#import "OAIQueryParamCollection.h"
#import "OAIApiClient.h"
#import "OAIComputerSet.h"
#import "OAIFreeStyleBuild.h"
#import "OAIFreeStyleProject.h"
#import "OAIHudson.h"
#import "OAIListView.h"
#import "OAIQueue.h"

@interface OAIRemoteAccessApi ()

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

@end

@implementation OAIRemoteAccessApi

NSString* kOAIRemoteAccessApiErrorDomain = @"OAIRemoteAccessApiErrorDomain";
NSInteger kOAIRemoteAccessApiMissingParamErrorCode = 234513;

@synthesize apiClient = _apiClient;

#pragma mark - Initialize methods

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

-(instancetype) initWithApiClient:(OAIApiClient *)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

///
///
/// Retrieve computer details
///  @param depth Recursion depth in response model
///
///  @returns OAIComputerSet*
///
-(NSURLSessionTask*) getComputerWithDepth: (NSNumber*) depth
    completionHandler: (void (^)(OAIComputerSet* output, NSError* error)) handler {
    // verify the required parameter 'depth' is set
    if (depth == nil) {
        NSParameterAssert(depth);
        if(handler) {
            NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"depth"] };
            NSError* error = [NSError errorWithDomain:kOAIRemoteAccessApiErrorDomain code:kOAIRemoteAccessApiMissingParamErrorCode userInfo:userInfo];
            handler(nil, error);
        }
        return nil;
    }

    NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/computer/api/json"];

    NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];

    NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
    if (depth != nil) {
        queryParams[@"depth"] = depth;
    }
    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 = @[@"jenkins_auth"];

    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: @"OAIComputerSet*"
                           completionBlock: ^(id data, NSError *error) {
                                if(handler) {
                                    handler((OAIComputerSet*)data, error);
                                }
                            }];
}

///
///
/// Retrieve Jenkins details
///  @returns OAIHudson*
///
-(NSURLSessionTask*) getJenkinsWithCompletionHandler:
    (void (^)(OAIHudson* output, NSError* error)) handler {
    NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/json"];

    NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];

    NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
    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 = @[@"jenkins_auth"];

    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: @"OAIHudson*"
                           completionBlock: ^(id data, NSError *error) {
                                if(handler) {
                                    handler((OAIHudson*)data, error);
                                }
                            }];
}

///
///
/// Retrieve job details
///  @param name Name of the job
///
///  @returns OAIFreeStyleProject*
///
-(NSURLSessionTask*) getJobWithName: (NSString*) name
    completionHandler: (void (^)(OAIFreeStyleProject* output, NSError* error)) handler {
    // verify the required parameter 'name' is set
    if (name == nil) {
        NSParameterAssert(name);
        if(handler) {
            NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"name"] };
            NSError* error = [NSError errorWithDomain:kOAIRemoteAccessApiErrorDomain code:kOAIRemoteAccessApiMissingParamErrorCode userInfo:userInfo];
            handler(nil, error);
        }
        return nil;
    }

    NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/job/{name}/api/json"];

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

    NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
    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 = @[@"jenkins_auth"];

    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: @"OAIFreeStyleProject*"
                           completionBlock: ^(id data, NSError *error) {
                                if(handler) {
                                    handler((OAIFreeStyleProject*)data, error);
                                }
                            }];
}

///
///
/// Retrieve job configuration
///  @param name Name of the job
///
///  @returns NSString*
///
-(NSURLSessionTask*) getJobConfigWithName: (NSString*) name
    completionHandler: (void (^)(NSString* output, NSError* error)) handler {
    // verify the required parameter 'name' is set
    if (name == nil) {
        NSParameterAssert(name);
        if(handler) {
            NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"name"] };
            NSError* error = [NSError errorWithDomain:kOAIRemoteAccessApiErrorDomain code:kOAIRemoteAccessApiMissingParamErrorCode userInfo:userInfo];
            handler(nil, error);
        }
        return nil;
    }

    NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/job/{name}/config.xml"];

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

    NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
    NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders];
    [headerParams addEntriesFromDictionary:self.defaultHeaders];
    // HTTP header `Accept`
    NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"text/xml"]];
    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 = @[@"jenkins_auth"];

    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: @"NSString*"
                           completionBlock: ^(id data, NSError *error) {
                                if(handler) {
                                    handler((NSString*)data, error);
                                }
                            }];
}

///
///
/// Retrieve job's last build details
///  @param name Name of the job
///
///  @returns OAIFreeStyleBuild*
///
-(NSURLSessionTask*) getJobLastBuildWithName: (NSString*) name
    completionHandler: (void (^)(OAIFreeStyleBuild* output, NSError* error)) handler {
    // verify the required parameter 'name' is set
    if (name == nil) {
        NSParameterAssert(name);
        if(handler) {
            NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"name"] };
            NSError* error = [NSError errorWithDomain:kOAIRemoteAccessApiErrorDomain code:kOAIRemoteAccessApiMissingParamErrorCode userInfo:userInfo];
            handler(nil, error);
        }
        return nil;
    }

    NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/job/{name}/lastBuild/api/json"];

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

    NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
    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 = @[@"jenkins_auth"];

    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: @"OAIFreeStyleBuild*"
                           completionBlock: ^(id data, NSError *error) {
                                if(handler) {
                                    handler((OAIFreeStyleBuild*)data, error);
                                }
                            }];
}

///
///
/// Retrieve job's build progressive text output
///  @param name Name of the job
///
///  @param number Build number
///
///  @param start Starting point of progressive text output
///
///  @returns void
///
-(NSURLSessionTask*) getJobProgressiveTextWithName: (NSString*) name
    number: (NSString*) number
    start: (NSString*) start
    completionHandler: (void (^)(NSError* error)) handler {
    // verify the required parameter 'name' is set
    if (name == nil) {
        NSParameterAssert(name);
        if(handler) {
            NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"name"] };
            NSError* error = [NSError errorWithDomain:kOAIRemoteAccessApiErrorDomain code:kOAIRemoteAccessApiMissingParamErrorCode userInfo:userInfo];
            handler(error);
        }
        return nil;
    }

    // verify the required parameter 'number' is set
    if (number == nil) {
        NSParameterAssert(number);
        if(handler) {
            NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"number"] };
            NSError* error = [NSError errorWithDomain:kOAIRemoteAccessApiErrorDomain code:kOAIRemoteAccessApiMissingParamErrorCode userInfo:userInfo];
            handler(error);
        }
        return nil;
    }

    // verify the required parameter 'start' is set
    if (start == nil) {
        NSParameterAssert(start);
        if(handler) {
            NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"start"] };
            NSError* error = [NSError errorWithDomain:kOAIRemoteAccessApiErrorDomain code:kOAIRemoteAccessApiMissingParamErrorCode userInfo:userInfo];
            handler(error);
        }
        return nil;
    }

    NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/job/{name}/{number}/logText/progressiveText"];

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

    NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
    if (start != nil) {
        queryParams[@"start"] = start;
    }
    NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders];
    [headerParams addEntriesFromDictionary:self.defaultHeaders];
    // HTTP header `Accept`
    NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]];
    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 = @[@"jenkins_auth"];

    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: nil
                           completionBlock: ^(id data, NSError *error) {
                                if(handler) {
                                    handler(error);
                                }
                            }];
}

///
///
/// Retrieve queue details
///  @returns OAIQueue*
///
-(NSURLSessionTask*) getQueueWithCompletionHandler:
    (void (^)(OAIQueue* output, NSError* error)) handler {
    NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/queue/api/json"];

    NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];

    NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
    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 = @[@"jenkins_auth"];

    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: @"OAIQueue*"
                           completionBlock: ^(id data, NSError *error) {
                                if(handler) {
                                    handler((OAIQueue*)data, error);
                                }
                            }];
}

///
///
/// Retrieve queued item details
///  @param number Queue number
///
///  @returns OAIQueue*
///
-(NSURLSessionTask*) getQueueItemWithNumber: (NSString*) number
    completionHandler: (void (^)(OAIQueue* output, NSError* error)) handler {
    // verify the required parameter 'number' is set
    if (number == nil) {
        NSParameterAssert(number);
        if(handler) {
            NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"number"] };
            NSError* error = [NSError errorWithDomain:kOAIRemoteAccessApiErrorDomain code:kOAIRemoteAccessApiMissingParamErrorCode userInfo:userInfo];
            handler(nil, error);
        }
        return nil;
    }

    NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/queue/item/{number}/api/json"];

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

    NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
    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 = @[@"jenkins_auth"];

    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: @"OAIQueue*"
                           completionBlock: ^(id data, NSError *error) {
                                if(handler) {
                                    handler((OAIQueue*)data, error);
                                }
                            }];
}

///
///
/// Retrieve view details
///  @param name Name of the view
///
///  @returns OAIListView*
///
-(NSURLSessionTask*) getViewWithName: (NSString*) name
    completionHandler: (void (^)(OAIListView* output, NSError* error)) handler {
    // verify the required parameter 'name' is set
    if (name == nil) {
        NSParameterAssert(name);
        if(handler) {
            NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"name"] };
            NSError* error = [NSError errorWithDomain:kOAIRemoteAccessApiErrorDomain code:kOAIRemoteAccessApiMissingParamErrorCode userInfo:userInfo];
            handler(nil, error);
        }
        return nil;
    }

    NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/view/{name}/api/json"];

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

    NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
    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 = @[@"jenkins_auth"];

    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: @"OAIListView*"
                           completionBlock: ^(id data, NSError *error) {
                                if(handler) {
                                    handler((OAIListView*)data, error);
                                }
                            }];
}

///
///
/// Retrieve view configuration
///  @param name Name of the view
///
///  @returns NSString*
///
-(NSURLSessionTask*) getViewConfigWithName: (NSString*) name
    completionHandler: (void (^)(NSString* output, NSError* error)) handler {
    // verify the required parameter 'name' is set
    if (name == nil) {
        NSParameterAssert(name);
        if(handler) {
            NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"name"] };
            NSError* error = [NSError errorWithDomain:kOAIRemoteAccessApiErrorDomain code:kOAIRemoteAccessApiMissingParamErrorCode userInfo:userInfo];
            handler(nil, error);
        }
        return nil;
    }

    NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/view/{name}/config.xml"];

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

    NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
    NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders];
    [headerParams addEntriesFromDictionary:self.defaultHeaders];
    // HTTP header `Accept`
    NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"text/xml"]];
    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 = @[@"jenkins_auth"];

    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: @"NSString*"
                           completionBlock: ^(id data, NSError *error) {
                                if(handler) {
                                    handler((NSString*)data, error);
                                }
                            }];
}

///
///
/// Retrieve Jenkins headers
///  @returns void
///
-(NSURLSessionTask*) headJenkinsWithCompletionHandler:
    (void (^)(NSError* error)) handler {
    NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/json"];

    NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];

    NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
    NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders];
    [headerParams addEntriesFromDictionary:self.defaultHeaders];
    // HTTP header `Accept`
    NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]];
    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 = @[@"jenkins_auth"];

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

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

///
///
/// Create a new job using job configuration, or copied from an existing job
///  @param name Name of the new job
///
///  @param from Existing job to copy from (optional)
///
///  @param mode Set to 'copy' for copying an existing job (optional)
///
///  @param jenkinsCrumb CSRF protection token (optional)
///
///  @param contentType Content type header application/xml (optional)
///
///  @param body Job configuration in config.xml format (optional)
///
///  @returns void
///
-(NSURLSessionTask*) postCreateItemWithName: (NSString*) name
    from: (NSString*) from
    mode: (NSString*) mode
    jenkinsCrumb: (NSString*) jenkinsCrumb
    contentType: (NSString*) contentType
    body: (NSString*) body
    completionHandler: (void (^)(NSError* error)) handler {
    // verify the required parameter 'name' is set
    if (name == nil) {
        NSParameterAssert(name);
        if(handler) {
            NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"name"] };
            NSError* error = [NSError errorWithDomain:kOAIRemoteAccessApiErrorDomain code:kOAIRemoteAccessApiMissingParamErrorCode userInfo:userInfo];
            handler(error);
        }
        return nil;
    }

    NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/createItem"];

    NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];

    NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
    if (name != nil) {
        queryParams[@"name"] = name;
    }
    if (from != nil) {
        queryParams[@"from"] = from;
    }
    if (mode != nil) {
        queryParams[@"mode"] = mode;
    }
    NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders];
    [headerParams addEntriesFromDictionary:self.defaultHeaders];
    if (jenkinsCrumb != nil) {
        headerParams[@"Jenkins-Crumb"] = jenkinsCrumb;
    }
    if (contentType != nil) {
        headerParams[@"Content-Type"] = contentType;
    }
    // HTTP header `Accept`
    NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"*/*"]];
    if(acceptHeader.length > 0) {
        headerParams[@"Accept"] = acceptHeader;
    }

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

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

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

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

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

///
///
/// Create a new view using view configuration
///  @param name Name of the new view
///
///  @param jenkinsCrumb CSRF protection token (optional)
///
///  @param contentType Content type header application/xml (optional)
///
///  @param body View configuration in config.xml format (optional)
///
///  @returns void
///
-(NSURLSessionTask*) postCreateViewWithName: (NSString*) name
    jenkinsCrumb: (NSString*) jenkinsCrumb
    contentType: (NSString*) contentType
    body: (NSString*) body
    completionHandler: (void (^)(NSError* error)) handler {
    // verify the required parameter 'name' is set
    if (name == nil) {
        NSParameterAssert(name);
        if(handler) {
            NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"name"] };
            NSError* error = [NSError errorWithDomain:kOAIRemoteAccessApiErrorDomain code:kOAIRemoteAccessApiMissingParamErrorCode userInfo:userInfo];
            handler(error);
        }
        return nil;
    }

    NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/createView"];

    NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init];

    NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
    if (name != nil) {
        queryParams[@"name"] = name;
    }
    NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders];
    [headerParams addEntriesFromDictionary:self.defaultHeaders];
    if (jenkinsCrumb != nil) {
        headerParams[@"Jenkins-Crumb"] = jenkinsCrumb;
    }
    if (contentType != nil) {
        headerParams[@"Content-Type"] = contentType;
    }
    // HTTP header `Accept`
    NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"*/*"]];
    if(acceptHeader.length > 0) {
        headerParams[@"Accept"] = acceptHeader;
    }

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

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

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

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

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

///
///
/// Build a job
///  @param name Name of the job
///
///  @param json
///
///  @param token  (optional)
///
///  @param jenkinsCrumb CSRF protection token (optional)
///
///  @returns void
///
-(NSURLSessionTask*) postJobBuildWithName: (NSString*) name
    json: (NSString*) json
    token: (NSString*) token
    jenkinsCrumb: (NSString*) jenkinsCrumb
    completionHandler: (void (^)(NSError* error)) handler {
    // verify the required parameter 'name' is set
    if (name == nil) {
        NSParameterAssert(name);
        if(handler) {
            NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"name"] };
            NSError* error = [NSError errorWithDomain:kOAIRemoteAccessApiErrorDomain code:kOAIRemoteAccessApiMissingParamErrorCode userInfo:userInfo];
            handler(error);
        }
        return nil;
    }

    // verify the required parameter 'json' is set
    if (json == nil) {
        NSParameterAssert(json);
        if(handler) {
            NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"json"] };
            NSError* error = [NSError errorWithDomain:kOAIRemoteAccessApiErrorDomain code:kOAIRemoteAccessApiMissingParamErrorCode userInfo:userInfo];
            handler(error);
        }
        return nil;
    }

    NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/job/{name}/build"];

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

    NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
    if (json != nil) {
        queryParams[@"json"] = json;
    }
    if (token != nil) {
        queryParams[@"token"] = token;
    }
    NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders];
    [headerParams addEntriesFromDictionary:self.defaultHeaders];
    if (jenkinsCrumb != nil) {
        headerParams[@"Jenkins-Crumb"] = jenkinsCrumb;
    }
    // HTTP header `Accept`
    NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]];
    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 = @[@"jenkins_auth"];

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

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

///
///
/// Update job configuration
///  @param name Name of the job
///
///  @param body Job configuration in config.xml format
///
///  @param jenkinsCrumb CSRF protection token (optional)
///
///  @returns void
///
-(NSURLSessionTask*) postJobConfigWithName: (NSString*) name
    body: (NSString*) body
    jenkinsCrumb: (NSString*) jenkinsCrumb
    completionHandler: (void (^)(NSError* error)) handler {
    // verify the required parameter 'name' is set
    if (name == nil) {
        NSParameterAssert(name);
        if(handler) {
            NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"name"] };
            NSError* error = [NSError errorWithDomain:kOAIRemoteAccessApiErrorDomain code:kOAIRemoteAccessApiMissingParamErrorCode userInfo:userInfo];
            handler(error);
        }
        return nil;
    }

    // verify the required parameter 'body' is set
    if (body == nil) {
        NSParameterAssert(body);
        if(handler) {
            NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"body"] };
            NSError* error = [NSError errorWithDomain:kOAIRemoteAccessApiErrorDomain code:kOAIRemoteAccessApiMissingParamErrorCode userInfo:userInfo];
            handler(error);
        }
        return nil;
    }

    NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/job/{name}/config.xml"];

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

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

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

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

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

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

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

///
///
/// Delete a job
///  @param name Name of the job
///
///  @param jenkinsCrumb CSRF protection token (optional)
///
///  @returns void
///
-(NSURLSessionTask*) postJobDeleteWithName: (NSString*) name
    jenkinsCrumb: (NSString*) jenkinsCrumb
    completionHandler: (void (^)(NSError* error)) handler {
    // verify the required parameter 'name' is set
    if (name == nil) {
        NSParameterAssert(name);
        if(handler) {
            NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"name"] };
            NSError* error = [NSError errorWithDomain:kOAIRemoteAccessApiErrorDomain code:kOAIRemoteAccessApiMissingParamErrorCode userInfo:userInfo];
            handler(error);
        }
        return nil;
    }

    NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/job/{name}/doDelete"];

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

    NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
    NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders];
    [headerParams addEntriesFromDictionary:self.defaultHeaders];
    if (jenkinsCrumb != nil) {
        headerParams[@"Jenkins-Crumb"] = jenkinsCrumb;
    }
    // HTTP header `Accept`
    NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]];
    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 = @[@"jenkins_auth"];

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

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

///
///
/// Disable a job
///  @param name Name of the job
///
///  @param jenkinsCrumb CSRF protection token (optional)
///
///  @returns void
///
-(NSURLSessionTask*) postJobDisableWithName: (NSString*) name
    jenkinsCrumb: (NSString*) jenkinsCrumb
    completionHandler: (void (^)(NSError* error)) handler {
    // verify the required parameter 'name' is set
    if (name == nil) {
        NSParameterAssert(name);
        if(handler) {
            NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"name"] };
            NSError* error = [NSError errorWithDomain:kOAIRemoteAccessApiErrorDomain code:kOAIRemoteAccessApiMissingParamErrorCode userInfo:userInfo];
            handler(error);
        }
        return nil;
    }

    NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/job/{name}/disable"];

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

    NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
    NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders];
    [headerParams addEntriesFromDictionary:self.defaultHeaders];
    if (jenkinsCrumb != nil) {
        headerParams[@"Jenkins-Crumb"] = jenkinsCrumb;
    }
    // HTTP header `Accept`
    NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]];
    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 = @[@"jenkins_auth"];

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

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

///
///
/// Enable a job
///  @param name Name of the job
///
///  @param jenkinsCrumb CSRF protection token (optional)
///
///  @returns void
///
-(NSURLSessionTask*) postJobEnableWithName: (NSString*) name
    jenkinsCrumb: (NSString*) jenkinsCrumb
    completionHandler: (void (^)(NSError* error)) handler {
    // verify the required parameter 'name' is set
    if (name == nil) {
        NSParameterAssert(name);
        if(handler) {
            NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"name"] };
            NSError* error = [NSError errorWithDomain:kOAIRemoteAccessApiErrorDomain code:kOAIRemoteAccessApiMissingParamErrorCode userInfo:userInfo];
            handler(error);
        }
        return nil;
    }

    NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/job/{name}/enable"];

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

    NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
    NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders];
    [headerParams addEntriesFromDictionary:self.defaultHeaders];
    if (jenkinsCrumb != nil) {
        headerParams[@"Jenkins-Crumb"] = jenkinsCrumb;
    }
    // HTTP header `Accept`
    NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]];
    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 = @[@"jenkins_auth"];

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

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

///
///
/// Stop a job
///  @param name Name of the job
///
///  @param jenkinsCrumb CSRF protection token (optional)
///
///  @returns void
///
-(NSURLSessionTask*) postJobLastBuildStopWithName: (NSString*) name
    jenkinsCrumb: (NSString*) jenkinsCrumb
    completionHandler: (void (^)(NSError* error)) handler {
    // verify the required parameter 'name' is set
    if (name == nil) {
        NSParameterAssert(name);
        if(handler) {
            NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"name"] };
            NSError* error = [NSError errorWithDomain:kOAIRemoteAccessApiErrorDomain code:kOAIRemoteAccessApiMissingParamErrorCode userInfo:userInfo];
            handler(error);
        }
        return nil;
    }

    NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/job/{name}/lastBuild/stop"];

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

    NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
    NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders];
    [headerParams addEntriesFromDictionary:self.defaultHeaders];
    if (jenkinsCrumb != nil) {
        headerParams[@"Jenkins-Crumb"] = jenkinsCrumb;
    }
    // HTTP header `Accept`
    NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]];
    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 = @[@"jenkins_auth"];

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

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

///
///
/// Update view configuration
///  @param name Name of the view
///
///  @param body View configuration in config.xml format
///
///  @param jenkinsCrumb CSRF protection token (optional)
///
///  @returns void
///
-(NSURLSessionTask*) postViewConfigWithName: (NSString*) name
    body: (NSString*) body
    jenkinsCrumb: (NSString*) jenkinsCrumb
    completionHandler: (void (^)(NSError* error)) handler {
    // verify the required parameter 'name' is set
    if (name == nil) {
        NSParameterAssert(name);
        if(handler) {
            NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"name"] };
            NSError* error = [NSError errorWithDomain:kOAIRemoteAccessApiErrorDomain code:kOAIRemoteAccessApiMissingParamErrorCode userInfo:userInfo];
            handler(error);
        }
        return nil;
    }

    // verify the required parameter 'body' is set
    if (body == nil) {
        NSParameterAssert(body);
        if(handler) {
            NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"body"] };
            NSError* error = [NSError errorWithDomain:kOAIRemoteAccessApiErrorDomain code:kOAIRemoteAccessApiMissingParamErrorCode userInfo:userInfo];
            handler(error);
        }
        return nil;
    }

    NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/view/{name}/config.xml"];

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

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

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

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

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

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

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

@end


text:
#ifndef EL_TRR2K_TTNN_HPP
#define EL_TRR2K_TTNN_HPP

#include "./NNTT.hpp"

namespace El {
namespace trr2k {

// E := alpha A' B' + beta C D + E
template<typename T>
void Trr2kTTNN
( UpperOrLower uplo,
  Orientation orientA, Orientation orientB,
  T alpha, const AbstractDistMatrix<T>& A, const AbstractDistMatrix<T>& B,
  T beta,  const AbstractDistMatrix<T>& C, const AbstractDistMatrix<T>& D,
                 AbstractDistMatrix<T>& E )
{
    DEBUG_ONLY(CSE cse("trr2k::Trr2kTTNN"))
    Trr2kNNTT( uplo, orientA, orientB, beta, C, D, alpha, A, B, E );
}

} // namespace trr2k
} // namespace El

#endif // ifndef EL_TRR2K_TTNN_HPP

redpajama_set_name: RedPajamaGithub


text:
Given a binary tree, find the maximum path sum.

For this problem, a path is defined as any sequence of nodes from some starting node to any node in the tree along the parent-child connections. The path does not need to go through the root.

For example:

Given the below binary tree,

       1
      / \
     2   3

Return `6`.


text:
export { default as Button } from './Button';
export { default as ButtonQR } from './ButtonQR';
export { default as Small } from './Small';
export { default as Text } from './Text';


text:
<?php

namespace App\Http\Controllers;

use App\TokensUsers;
use Auth;

/**
 * Class HomeController
 * @package App\Http\Controllers
 */
class HomeController extends Controller
{
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('auth');
    }

    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        return view('home', [
            'linkedMeetup' => Auth::user()
                ->tokens()
                ->where('type', TokensUsers::$MEETUP)
                ->where('expired', false)
                ->first(),
            'linkedGithub' => Auth::user()
                ->tokens()
                ->where('type', TokensUsers::$GITHUB)
                ->where('expired', false)
                ->first()
        ]);
    }
}


text:
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Mi Auto - Todo auto tiene una historia que contar</title>

	<!-- Global stylesheets -->
<!-- 	<link href="https://fonts.googleapis.com/css?family=Roboto:400,300,100,500,700,900" rel="stylesheet" type="text/css"> -->
	<link rel="shortcut icon" href="<?= base_url('resources/images/mifavicon.png') ?>">
  	<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

	<?php $this->view('partialayout/csslayout'); ?>
	<style>
#country-list {float:left;list-style:none;margin-top:-3px;padding:0;width:517px;position: absolute;}
#country-list li{padding: 10px; background: #f0f0f0; border-bottom: #bbb9b9 1px solid;}
#country-list li:hover{background:#ece3d2;cursor: pointer;}
#autocomplete {padding: 10px;border: #a8d4b1 1px solid;border-radius:4px;}
#country-list2 {float:left;list-style:none;margin-top:-3px;padding:0;width:517px;position: absolute;}
#country-list2 li{padding: 10px; background: #f0f0f0; border-bottom: #bbb9b9 1px solid;}
#country-list2 li:hover{background:#ece3d2;cursor: pointer;}
#autocomplete2 {padding: 10px;border: #a8d4b1 1px solid;border-radius:4px;}
#myBar {
    width: 10%;
    height: 30px;
    background-color: green;
    text-align: center; /* To center it horizontally (if you want) */
    line-height: 30px; /* To center it vertically */
    color: white;
}
#myProgress {
    width: 80%;
    background-color: #EBF1EB;
    margin: 0 auto;
    text-align: center;
    color: white;
    line-height: 30px;
}
@media print and (orientation: landscape) {
    body, html, #wrapper {
     width: 100%;
    }
   div {
     overflow: visible !important;
    }
    .fc{
        max-width: 100% !important;
    }
@page {
  size: landscape;
}
}
.nover {
    display: none;

}
</style>

</head>


text:
var gulp = require('gulp'), concat = require('gulp-concat'), uglify = require('gulp-uglify'),
    less = require('gulp-less'), path = require('path'),
    livereload = require('gulp-livereload'),
    path = require('path'), changed = require('gulp-changed'), prettify = require('gulp-html-prettify'),
    w3cjs = require('gulp-w3cjs'), rename = require('gulp-rename'),
    through = require('through2'), gutil = require('gulp-util'), htmlify = require('gulp-angular-htmlify'),
    minifyCSS = require('gulp-minify-css'), gulpFilter = require('gulp-filter'), expect = require('gulp-expect-file'),
    gulpsync = require('gulp-sync')(gulp), ngAnnotate = require('gulp-ng-annotate'),
    sourcemaps = require('gulp-sourcemaps'), del = require('del'), jsoncombine = require('gulp-jsoncombine'),
    ngConstant = require('gulp-ng-constant'), foreach = require('gulp-foreach'),
    gcallback = require('gulp-callback'), changeCase = require('change-case'),
    tag_version = require('gulp-tag-version'), PluginError = gutil.PluginError;

// LiveReload port. Change it only if there's a conflict
var lvr_port = 35729;

var W3C_OPTIONS = {
  // Set here your local validator if your using one. leave it empty if not
  // uri: 'http://validator/check',
  doctype: 'HTML5',
  output: 'json',
  // Remove some messages that angular will always display.
  filter: function(message) {
    if (/Element head is missing a required instance of child element title/.test(message)) { return false; }
    if (/Attribute .+ not allowed on element .+ at this point/.test(message)) { return false; }
    if (/Element .+ not allowed as child of element .+ in this context/.test(message)) { return false; }
    if (/Comments seen before doctype./.test(message)) { return false; }
  }
};

// production mode (see build task)
var isProduction = false;
var useSourceMaps = false;

// ignore everything that begins with underscore
var hidden_files = '**/_*.*';
var ignored_files = '!' + hidden_files;

var output_folder = '../app';

// VENDOR CONFIG
var vendor = {
  // vendor scripts required to start the app
  base: {
    source: require('./vendor.base.json'),
    dest: '../app/assets/js',
    name: 'base.js'
  },
  // vendor scripts to make to app work. Usually via lazy loading
  app: {
    // instead of the bower downloaded versions of some files, we
    // pull hand edited versions from the shared/vendor directory.
    source: require('./vendor.json'),
    dest: '../app/vendor'
  }
};

// SOURCES CONFIG
var source = {
  scripts: {
    app: [
      'js/app.preinit.js',
      'js/app.init.js',
      'js/app.config.js',
      'js/app.directive.js',
      'js/app.run.js',
      'js/app.service.js',
      'js/app.provider.js',
      'js/tabs.js',
      'js/sections.js',
      'shared/config/generated-config.js',
      'shared/js/modules/*.js',
      'shared/js/modules/controllers/*.js',
      'shared/js/modules/directives/*.js',
      'shared/js/modules/services/*.js',
      'components/**/js/**/*.js'
    ],
    dest: {
      name: 'app.js',
      dir: '../app/assets/js'
    },
    watch: [
      'manifest.json',
      'js/**/*.js',
      'shared/**/*.js',
      'shared/config/*.json',
      'components/*/js/**/*.js',
      'components/*/config/*.json'
      ]
  },

  styles: {
    app: {
      source: ['less/app/base.less', 'components/*/less/*.less'],
      paths: ['less/app', 'components'],
      dest: '../app/assets/css',
      watch: ['less/*.less', 'less/**/*.less', 'components/**/less/*.less', 'components/**/less/**/*.less']

    }
  },

  html: {
    app: {
      source: ['shared/index.html'],
      dest: '../app'
    },
    views: {
      source: ['shared/views/**/*.*'],
      dest: '../app'
    },
    watch: ['shared/index.html', 'shared/views/**/*.*']
  },

  components: {
    source: [
      'components/**/*.*',
      '!components/**/js/**/*.*',
      '!components/**/config/**/*.*',
      '!components/**/protractor/**/*.*',
      '!components/**/test/**/*.*',
      '!components/**/less/**/*.*',
      '!components/**/README.md'
    ],
    dest: '../app/components',
    watch: [
      'components/**/*.*',
      '!components/**/js/**/*.*',
      '!components/**/config/**/*.*',
      '!components/**/protractor/**/*.*',
      '!components/**/test/**/*.*',
      '!components/**/less/**/*.*',
      '!components/**/README.md'
    ]
  },

  config: {
    dest: 'shared/config'
  },

  assets: {
    source: ['shared/assets/**/*.*'],
    dest: '../app/assets',
    watch: ['shared/assets/**/*.*']
  }
};

function stringSrc(filename, string) {
  var src = require('stream').Readable({objectMode: true});
  src._read = function() {
    this.push(new gutil.File({cwd: "", base: "", path: filename, contents: new Buffer(string)}));
    this.push(null);
  };
  return src;
}

// Error handler
function handleError(err) {
  console.log(err.toString());
  this.emit('end');
  process.exit(1);
}

//---------------
// TASKS
//---------------

var manifestDirectory = function(manifestFile) {
  return manifestFile.relative.slice(0, '/manifest.json'.length * -1);
};

gulp.task('bundle-manifest', function() {
  var components = [];
  var namespace = [];
  gulp.src('./components/*/manifest.json')
      .pipe(foreach (function(stream, file) {
        var component = manifestDirectory(file);
        components.push(component);
        namespace.push(changeCase.camelCase(component));
        return stream;
      }))
      .pipe(gcallback(function() {
        var tabs = [];
        components.forEach(function(component) {
          tabs.push({component: component, title: changeCase.titleCase(component)});
        });
        stringSrc("tabs.js", 'app.value("tabs", ' + JSON.stringify(tabs) + ');').pipe(gulp.dest("js"));
        var _appNS = 'kubernetesApp.components.';
        var _appSkeleton = require('./js/app.skeleton.json');
        stringSrc("app.preinit.js",
                  _appSkeleton.appSkeleton.replace('%s', '"' + _appNS + namespace.join('", "' + _appNS) + '"'))
            .pipe(gulp.dest("js"));
      }));
});

gulp.task('bundle-manifest-routes', function() {
  var sections = [];
  gulp.src('./components/*/manifest.json')
      .pipe(foreach (function(stream, file) {
        var component = manifestDirectory(file);
        var manifestFile = require(file.path);
        var routes = [];
        if (manifestFile.routes) {
          manifestFile.routes.forEach(function(r) {
            // Hacky deep copy. Modifying manifestFile here will be repeated
            // each time the task is called (consider watch/reload) due to
            // cached file reads.
            var route = JSON.parse(JSON.stringify(r));
            if (route.url) {
              route.url = '/' + component + route.url;
            }
            routes.push(route);
          });
        }
        sections = sections.concat(routes);
        return stream;
      }))
      .pipe(gcallback(function() {
        var output_sections = JSON.stringify(sections);
        var _file_contents = 'app.constant("manifestRoutes", ' + output_sections + ');\n';
        stringSrc("sections.js", _file_contents).pipe(gulp.dest("js"));
      }));
});

// JS APP
gulp.task('scripts:app', gulpsync.sync(['bundle-manifest', 'bundle-manifest-routes', 'config', 'scripts:app:base']));

// JS APP BUILD
gulp.task('scripts:app:base', function() {
  // Minify and copy all JavaScript (except vendor scripts)
  return gulp.src(source.scripts.app)
      .pipe(useSourceMaps ? sourcemaps.init() : gutil.noop())
      .pipe(concat(source.scripts.dest.name))
      .pipe(ngAnnotate())
      // Now that we run a production build, uglification is breaking angular injection,
      // so disable it for now.
      // TODO: Find out which dependencies are not string based and upgrade them accordingly.
      // .pipe(isProduction ? uglify({preserveComments: 'some'}) : gutil.noop())
      .pipe(useSourceMaps ? sourcemaps.write() : gutil.noop())
      .pipe(gulp.dest(source.scripts.dest.dir))
      .on("error", handleError);
});

// VENDOR BUILD
gulp.task('scripts:vendor', gulpsync.sync(['scripts:vendor:base', 'scripts:vendor:app']));

//  This will be included vendor files statically
gulp.task('scripts:vendor:base', function() {

  // Minify and copy all JavaScript (except vendor scripts)
  return gulp.src(vendor.base.source)
      .pipe(expect({ errorOnFailure: true }, vendor.base.source))
      .pipe(isProduction ? uglify() : gutil.noop())
      .pipe(concat(vendor.base.name))
      .pipe(gulp.dest(vendor.base.dest))
      .on("error", handleError);
});

// copy file from bower folder into the app vendor folder
gulp.task('scripts:vendor:app', function() {

  var jsFilter = gulpFilter('**/*.js');
  var cssFilter = gulpFilter('**/*.css');

  return gulp.src(vendor.app.source)
      .pipe(expect({ errorOnFailure: true }, vendor.app.source))
      .pipe(jsFilter)
      .pipe(isProduction ? uglify() : gutil.noop())
      .pipe(jsFilter.restore())
      .pipe(cssFilter)
      .pipe(isProduction ? minifyCSS() : gutil.noop())
      .pipe(cssFilter.restore())
      .pipe(gulp.dest(vendor.app.dest))
      .on("error", handleError);

});

// APP LESS
gulp.task('styles:app', function() {
  return gulp.src(source.styles.app.source)
      .pipe(foreach (function(stream, file) { return stringSrc('import.less', '@import "' + file.relative + '";\n'); }))
      .pipe(concat('app.less'))
      .pipe(useSourceMaps ? sourcemaps.init() : gutil.noop())
      .pipe(less({paths: source.styles.app.paths}))
      .pipe(isProduction ? minifyCSS() : gutil.noop())
      .pipe(useSourceMaps ? sourcemaps.write() : gutil.noop())
      .pipe(gulp.dest(source.styles.app.dest))
      .on("error", handleError);
});

gulp.task('config', gulpsync.sync(['config:base', 'config:copy']));

gulp.task('config:base', function() {
  return stringSrc('generated-config.js', 'angular.module("kubernetesApp.config", [])' +
                                              '\n' +
                                              '.constant("ENV", {})').pipe(gulp.dest(source.config.dest));
});

gulp.task('config:copy', function() {
  var environment = isProduction ? 'production' : 'development';
  return gulp.src(['shared/config/' + environment + '.json', 'components/**/config/' + environment + '.json'])
    .pipe(expect({ errorOnFailure: true }, 'shared/config/' + environment + '.json'))
    .on("error", handleError)
    .pipe(jsoncombine('generated-config.js',
      function(data) {
        var env = Object.keys(data).reduce(function(result, key) {
          // Map the key "environment" to "/" and the keys "component/config/environment" to "component".
          var newKey = key.replace(environment, '/').replace(/\/config\/\/$/, '');
          result[newKey] = data[key];
          return result;
        }, {});

        return new Buffer(JSON.stringify({'ENV': env}));
      }))
    .pipe(ngConstant({name: 'kubernetesApp.config', deps: [], constants: {ngConstant: true}}))
    .pipe(gulp.dest(source.config.dest));
});

gulp.task('copy:components', function() {

  var jsFilter = gulpFilter('**/*.js');
  var cssFilter = gulpFilter('**/*.css');

  return gulp.src(source.components.source, {base: 'components'})
      .pipe(expect({ errorOnFailure: true }, source.components.source))
      .pipe(jsFilter)
      .pipe(isProduction ? uglify() : gutil.noop())
      .pipe(jsFilter.restore())
      .pipe(cssFilter)
      .pipe(isProduction ? minifyCSS() : gutil.noop())
      .pipe(cssFilter.restore())
      .pipe(gulp.dest(source.components.dest))
      .on("error", handleError);
});

gulp.task('copy:shared-assets', function() {
  return gulp.src(source.assets.source, {base: 'shared/assets'})
      .pipe(gulp.dest(source.assets.dest));
});

// Assuming there's "version: 1.2.3" in package.json,
// tag the last commit as "v1.2.3"//
gulp.task('tag', function() { return gulp.src(['./package.json']).pipe(tag_version()); });

// VIEWS
gulp.task('content:html', gulpsync.sync(['content:html:app', 'content:html:views']));

gulp.task('content:html:app', function() {
  return gulp.src(source.html.app.source, {base: 'shared'})
    .pipe(prettify({
        indent_char: ' ',
        indent_size: 4,
        unformatted: ['a', 'sub', 'sup', 'b', 'i', 'u']
    }))
    .pipe(gulp.dest(source.html.app.dest))
    .on("error", handleError);
});

gulp.task('content:html:views', function() {
  return gulp.src(source.html.views.source, {base: 'shared'})
    .pipe(prettify({
        indent_char: ' ',
        indent_size: 4,
        unformatted: ['a', 'sub', 'sup', 'b', 'i', 'u']
    }))
    .pipe(gulp.dest(source.html.views.dest))
    .on("error", handleError);
});

//---------------
// WATCH
//---------------

// Rerun the task when a file changes
gulp.task('watch', function() {
  livereload.listen();

  gulp.watch(source.html.watch, ['content:html']);
  gulp.watch(source.scripts.watch, ['scripts:app']);
  gulp.watch(source.styles.app.watch, ['styles:app']);
  gulp.watch(source.components.watch, ['copy:components']);
  gulp.watch(source.assets.watch, ['copy:shared-assets']);

  gulp.watch(['../app/**'])
      .on('change', function(event) {
        livereload.changed(event.path);
      });
});

//---------------
// ENTRY POINTS
//---------------

// build for production (minify)
gulp.task('build', gulpsync.sync(['prod', 'clean', 'compile']));
gulp.task('prod', function() { isProduction = true; });

// build with sourcemaps (no minify)
gulp.task('sourcemaps', gulpsync.sync(['usesources', 'compile']));
gulp.task('usesources', function() { useSourceMaps = true; });

// build for development (no minify)
gulp.task('default', gulpsync.sync(['clean', 'compile', 'watch']), function() {
  gutil.log(gutil.colors.cyan('************'));
  gutil.log('You can start editing your code. LiveReload will update your browser after any change.');
  gutil.log(gutil.colors.cyan('************'));
});

gulp.task('clean', function() {
  del.sync(['shared/config/generated-config.js'], {force: true});
  del.sync([output_folder], {force: true});
});

gulp.task('compile', gulpsync.sync([
  'copy:shared-assets',
  'copy:components',
  'content:html',
  'scripts:vendor',
  'scripts:app',
  'styles:app'
]));


text:
import os

from trove.common import cfg
from trove.common import exception
from trove.common import instance as ds_instance
from trove.guestagent import dbaas
from trove.guestagent import volume
from trove.guestagent.common import operating_system
from trove.guestagent.datastore.mongodb import service as mongo_service
from trove.guestagent.datastore.mongodb import system
from trove.openstack.common import log as logging
from trove.openstack.common.gettextutils import _
from trove.openstack.common import periodic_task

LOG = logging.getLogger(__name__)
CONF = cfg.CONF
MANAGER = CONF.datastore_manager

class Manager(periodic_task.PeriodicTasks):

    def __init__(self):
        self.status = mongo_service.MongoDbAppStatus()
        self.app = mongo_service.MongoDBApp(self.status)

    @periodic_task.periodic_task(ticks_between_runs=3)
    def update_status(self, context):
        """Update the status of the MongoDB service."""
        self.status.update()

    def prepare(self, context, packages, databases, memory_mb, users,
                device_path=None, mount_point=None, backup_info=None,
                config_contents=None, root_password=None, overrides=None,
                cluster_config=None):
        """Makes ready DBAAS on a Guest container."""
        LOG.debug("Prepare MongoDB instance")

        self.status.begin_install()
        self.app.install_if_needed(packages)
        self.app.stop_db()
        self.app.clear_storage()
        mount_point = system.MONGODB_MOUNT_POINT
        if device_path:
            device = volume.VolumeDevice(device_path)
            # unmount if device is already mounted
            device.unmount_device(device_path)
            device.format()
            if os.path.exists(system.MONGODB_MOUNT_POINT):
                device.migrate_data(mount_point)
            device.mount(mount_point)
            operating_system.update_owner('mongodb', 'mongodb', mount_point)

            LOG.debug("Mounted the volume %(path)s as %(mount)s" %
                      {'path': device_path, "mount": mount_point})

        conf_changes = self.get_config_changes(cluster_config, mount_point)
        config_contents = self.app.update_config_contents(
            config_contents, conf_changes)
        if cluster_config is None:
            self.app.start_db_with_conf_changes(config_contents)
        else:
            if cluster_config['instance_type'] == "query_router":
                self.app.reset_configuration({'config_contents':
                                              config_contents})
                self.app.write_mongos_upstart()
                self.app.status.is_query_router = True
                # don't start mongos until add_config_servers is invoked

            elif cluster_config['instance_type'] == "config_server":
                self.app.status.is_config_server = True
                self.app.start_db_with_conf_changes(config_contents)

            elif cluster_config['instance_type'] == "member":
                self.app.start_db_with_conf_changes(config_contents)

            else:
                LOG.error("Bad cluster configuration; instance type given "
                          "as %s" % cluster_config['instance_type'])
                self.status.set_status(ds_instance.ServiceStatuses.FAILED)
                return

            self.status.set_status(ds_instance.ServiceStatuses.BUILD_PENDING)
        LOG.info(_('"prepare" call has finished.'))

    def get_config_changes(self, cluster_config, mount_point=None):
        config_changes = {}
        if cluster_config is not None:
            config_changes['bind_ip'] = operating_system.get_ip_address()
            # TODO(ramashri) remove smallfiles config at end of dev testing
            if cluster_config["instance_type"] == "config_server":
                config_changes["configsvr"] = "true"
                config_changes["smallfiles"] = "true"
            elif cluster_config["instance_type"] == "member":
                config_changes["replSet"] = cluster_config["replica_set_name"]
                config_changes["smallfiles"] = "true"
        if (mount_point is not None and
                (cluster_config is None or
                 cluster_config['instance_type'] != "query_router")):
            config_changes['dbpath'] = mount_point

        return config_changes

    def restart(self, context):
        self.app.restart()

    def start_db_with_conf_changes(self, context, config_contents):
        self.app.start_db_with_conf_changes(config_contents)

    def stop_db(self, context, do_not_start_on_reboot=False):
        self.app.stop_db(do_not_start_on_reboot=do_not_start_on_reboot)

    def reset_configuration(self, context, configuration):
        self.app.reset_configuration(configuration)

    def get_filesystem_stats(self, context, fs_path):
        """Gets the filesystem stats for the path given."""
        return dbaas.get_filesystem_volume_stats(system.MONGODB_MOUNT_POINT)

    def change_passwords(self, context, users):
        raise exception.DatastoreOperationNotSupported(
            operation='change_passwords', datastore=MANAGER)

    def update_attributes(self, context, username, hostname, user_attrs):
        raise exception.DatastoreOperationNotSupported(
            operation='update_attributes', datastore=MANAGER)

    def create_database(self, context, databases):
        raise exception.DatastoreOperationNotSupported(
            operation='create_database', datastore=MANAGER)

    def create_user(self, context, users):
        raise exception.DatastoreOperationNotSupported(
            operation='create_user', datastore=MANAGER)

    def delete_database(self, context, database):
        raise exception.DatastoreOperationNotSupported(
            operation='delete_database', datastore=MANAGER)

    def delete_user(self, context, user):
        raise exception.DatastoreOperationNotSupported(
            operation='delete_user', datastore=MANAGER)

    def get_user(self, context, username, hostname):
        raise exception.DatastoreOperationNotSupported(
            operation='get_user', datastore=MANAGER)

    def grant_access(self, context, username, hostname, databases):
        raise exception.DatastoreOperationNotSupported(
            operation='grant_access', datastore=MANAGER)

    def revoke_access(self, context, username, hostname, database):
        raise exception.DatastoreOperationNotSupported(
            operation='revoke_access', datastore=MANAGER)

    def list_access(self, context, username, hostname):
        raise exception.DatastoreOperationNotSupported(
            operation='list_access', datastore=MANAGER)

    def list_databases(self, context, limit=None, marker=None,
                       include_marker=False):
        raise exception.DatastoreOperationNotSupported(
            operation='list_databases', datastore=MANAGER)

    def list_users(self, context, limit=None, marker=None,
                   include_marker=False):
        raise exception.DatastoreOperationNotSupported(
            operation='list_users', datastore=MANAGER)

    def enable_root(self, context):
        raise exception.DatastoreOperationNotSupported(
            operation='enable_root', datastore=MANAGER)

    def is_root_enabled(self, context):
        raise exception.DatastoreOperationNotSupported(
            operation='is_root_enabled', datastore=MANAGER)

    def _perform_restore(self, backup_info, context, restore_location, app):
        raise exception.DatastoreOperationNotSupported(
            operation='_perform_restore', datastore=MANAGER)

    def create_backup(self, context, backup_info):
        raise exception.DatastoreOperationNotSupported(
            operation='create_backup', datastore=MANAGER)

    def mount_volume(self, context, device_path=None, mount_point=None):
        device = volume.VolumeDevice(device_path)
        device.mount(mount_point, write_to_fstab=False)
        LOG.debug("Mounted the volume.")

    def unmount_volume(self, context, device_path=None, mount_point=None):
        device = volume.VolumeDevice(device_path)
        device.unmount(mount_point)
        LOG.debug("Unmounted the volume.")

    def resize_fs(self, context, device_path=None, mount_point=None):
        device = volume.VolumeDevice(device_path)
        device.resize_fs(mount_point)
        LOG.debug("Resized the filesystem")

    def update_overrides(self, context, overrides, remove=False):
        raise exception.DatastoreOperationNotSupported(
            operation='update_overrides', datastore=MANAGER)

    def apply_overrides(self, context, overrides):
        raise exception.DatastoreOperationNotSupported(
            operation='apply_overrides', datastore=MANAGER)

    def get_replication_snapshot(self, context, snapshot_info):
        raise exception.DatastoreOperationNotSupported(
            operation='get_replication_snapshot', datastore=MANAGER)

    def attach_replication_slave(self, context, snapshot, slave_config):
        raise exception.DatastoreOperationNotSupported(
            operation='attach_replication_slave', datastore=MANAGER)

    def detach_replica(self, context):
        raise exception.DatastoreOperationNotSupported(
            operation='detach_replica', datastore=MANAGER)

    def demote_replication_master(self, context):
        raise exception.DatastoreOperationNotSupported(
            operation='demote_replication_master', datastore=MANAGER)

    def add_members(self, context, members):
        try:
            LOG.debug("add_members called")
            LOG.debug("args: members=%s" % members)
            self.app.add_members(members)
            LOG.debug("add_members call has finished")
        except Exception:
            self.status.set_status(ds_instance.ServiceStatuses.FAILED)
            raise

    def add_config_servers(self, context, config_servers):
        try:
            LOG.debug("add_config_servers called")
            LOG.debug("args: config_servers=%s" % config_servers)
            self.app.add_config_servers(config_servers)
            LOG.debug("add_config_servers call has finished")
        except Exception:
            self.status.set_status(ds_instance.ServiceStatuses.FAILED)
            raise

    def add_shard(self, context, replica_set_name, replica_set_member):
        try:
            LOG.debug("add_shard called")
            LOG.debug("args: replica_set_name=%s, replica_set_member=%s" % (
                replica_set_name, replica_set_member))
            self.app.add_shard(replica_set_name, replica_set_member)
            LOG.debug("add_shard call has finished")
        except Exception:
            self.status.set_status(ds_instance.ServiceStatuses.FAILED)
            raise

    def cluster_complete(self, context):
        # Now that cluster creation is complete, start status checks
        status = self.status._get_actual_db_status()
        self.status.set_status(status)


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--

 Copyright 2003 - 2016 The eFaps Team

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

-->
<datamodel-type xmlns="http://www.efaps.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.efaps.org/xsd http://www.efaps.org/xsd/eFaps_1.0.xsd">
    <uuid>241f2d28-3626-4ca7-8c38-18404324080e</uuid>
    <file-application>eFapsApp-Products</file-application>
    <definition>
        <version-expression>(version==latest)</version-expression>
        <name>Products_StaticInventoryPosition</name>
        <parent>Products_StaticStoragePosition</parent>
        <attribute>
            <name>StaticInventoryLink</name>
            <type>Link</type>
            <typelink>Products_StaticInventory</typelink>
            <sqltable>Products_StaticStoragePositionSQLTable</sqltable>
            <sqlcolumn>STORAGEID</sqlcolumn>
        </attribute>
    </definition>
</datamodel-type>