Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to support the current version of the Automatic API #1

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions BDKAutomatic.podspec

This file was deleted.

14 changes: 14 additions & 0 deletions Classes/AFHTTPRequestOperation+NLAutomaticOperation.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// AFHTTPRequestOperation+NLAutomaticOperation.h
// Pods
//
// Created by Nelson LeDuc on 4/6/15.
//
//

#import <AFNetworking/AFHTTPRequestOperation.h>
#import "NLAutomaticOperation.h"

@interface AFHTTPRequestOperation (NLAutomaticOperation) <NLAutomaticOperation>

@end
28 changes: 28 additions & 0 deletions Classes/AFHTTPRequestOperation+NLAutomaticOperation.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// AFHTTPRequestOperation+NLAutomaticOperation.m
// Pods
//
// Created by Nelson LeDuc on 4/6/15.
//
//

#import "AFHTTPRequestOperation+NLAutomaticOperation.h"

@implementation AFHTTPRequestOperation (NLAutomaticOperation)

- (void)cancelAutomaticOperation
{
[self cancel];
}

- (void)pauseAutomaticOperation
{
[self pause];
}

- (void)resumeAutomaticOperation
{
[self resume];
}

@end
53 changes: 0 additions & 53 deletions Classes/BDKAutomatic.h

This file was deleted.

137 changes: 0 additions & 137 deletions Classes/BDKAutomatic.m

This file was deleted.

22 changes: 0 additions & 22 deletions Classes/BDKAutomaticScopes.h

This file was deleted.

22 changes: 0 additions & 22 deletions Classes/BDKAutomaticScopes.m

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import MapKit;

@interface MKPolyline (BDKEncodedString)
@interface MKPolyline (NLEncodedString)

/**
Praise be to http://stackoverflow.com/a/9219856/194869
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "MKPolyline+BDKEncodedString.h"
#import "MKPolyline+NLEncodedString.h"

@implementation MKPolyline (BDKEncodedString)
@implementation MKPolyline (NLEncodedString)

+ (MKPolyline *)polylineWithEncodedString:(NSString *)encodedString {
const char *bytes = [encodedString UTF8String];
Expand Down
63 changes: 63 additions & 0 deletions Classes/NLAutomatic.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
//
// NLAutomatic.h
// NLAutomatic
//
// Created by Ben Kreeger on 1/20/14.
// Copyright (c) 2014 Ben Kreeger. All rights reserved.
//

@import Foundation;
#import "NLAutomaticScopes.h"

@class NLAutomaticToken;
@protocol NLAutomaticOperation;

typedef void(^NLAutomaticCompletionBlock)(NSError *error, id responseObject);
typedef void(^NLAutomaticTokenCompletionBlock)(NSError *error, NLAutomaticToken *token);

@interface NLAutomatic : NSObject

@property (nonatomic, strong, readonly) NSString *clientId;
@property (nonatomic, strong, readonly) NSString *clientSecret;
@property (nonatomic, strong, readonly) NSURL *redirectUrl;
@property (nonatomic, strong) NLAutomaticToken *token;

#pragma mark - Lifecycle

- (instancetype)initWithClientId:(NSString *)clientId
clientSecret:(NSString *)clientSecret
redirectUrl:(NSURL *)redirectUrl;
- (instancetype)initWithClientId:(NSString *)clientId
clientSecret:(NSString *)clientSecret
redirectUrl:(NSURL *)redirectUrl
token:(NLAutomaticToken *)token;

#pragma mark - Authentication and authorization

- (NSURLRequest *)authenticationRequestForAllScopes;
- (NSURLRequest *)authenticationRequestForStandardScopes;
- (NSURLRequest *)authenticationRequestForScopes:(NSArray *)scopes;
- (void)getAccessTokenForCode:(NSString *)code completion:(NLAutomaticTokenCompletionBlock)completion;

#pragma mark - Trip data

- (id<NLAutomaticOperation>)getTrips:(NLAutomaticCompletionBlock)completion;
- (id<NLAutomaticOperation>)getTripForId:(NSString *)identifier completion:(NLAutomaticCompletionBlock)completion;

#pragma mark - User data

- (id<NLAutomaticOperation>)getUser:(NLAutomaticCompletionBlock)completion;

#pragma mark - Vehicle data

- (id<NLAutomaticOperation>)getVehicles:(NLAutomaticCompletionBlock)completion;
- (id<NLAutomaticOperation>)getVehicleForId:(NSString *)identifier completion:(NLAutomaticCompletionBlock)completion;

@end


@interface NSString (URLEncoding)

- (NSString *)urlEncodeUsingEncoding:(NSStringEncoding)encoding;

@end
Loading