Skip to content

Commit

Permalink
Merge pull request #3 from maduraPradeep/master
Browse files Browse the repository at this point in the history
updated package + readme to squarelabs
  • Loading branch information
asanka-x authored Jul 14, 2016
2 parents d2bc4ba + 00757c4 commit 880b72b
Show file tree
Hide file tree
Showing 28 changed files with 187 additions and 65 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Add this dependency to your project's POM:

```xml
<dependency>
<groupId>com.squaremobile.shoutout.sdk</groupId>
<groupId>com.squarelabs.shoutout.sdk</groupId>
<artifactId>shoutout-java-sdk</artifactId>
<version>7.0.0</version>
<scope>compile</scope>
Expand All @@ -38,7 +38,7 @@ Add this dependency to your project's POM:
Add this dependency to your project's build file:

```groovy
compile "com.squaremobile.shoutout.sdk:shoutout-java-sdk:7.0.0"
compile "com.squarelabs.shoutout.sdk:shoutout-java-sdk:7.0.0"
```

### Others
Expand All @@ -57,10 +57,10 @@ Please follow the [installation](#installation) instruction and execute the foll

```java

import com.squaremobile.shoutout.sdk.*;
import com.squaremobile.shoutout.sdk.auth.*;
import com.squaremobile.shoutout.sdk.model.*;
import com.squaremobile.shoutout.sdk.api.ActivitiesApi;
import com.squarelabs.shoutout.sdk.*;
import com.squarelabs.shoutout.sdk.auth.*;
import com.squarelabs.shoutout.sdk.model.*;
import com.squarelabs.shoutout.sdk.api.ActivitiesApi;

import java.io.File;
import java.util.*;
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.squaremobile.shoutout.sdk</groupId>
<groupId>com.squarelabs.shoutout.sdk</groupId>
<artifactId>shoutout-java-sdk</artifactId>
<packaging>jar</packaging>
<name>ShoutOUT-java-sdk</name>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.squaremobile.shoutout.sdk;
package com.squarelabs.shoutout.sdk;

import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.datatype.joda.*;
import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;

import com.squaremobile.shoutout.sdk.auth.ApiKeyAuth;
import com.squaremobile.shoutout.sdk.auth.Authentication;
import com.squaremobile.shoutout.sdk.auth.HttpBasicAuth;
import com.squaremobile.shoutout.sdk.auth.OAuth;
import com.squarelabs.shoutout.sdk.auth.ApiKeyAuth;
import com.squarelabs.shoutout.sdk.auth.Authentication;
import com.squarelabs.shoutout.sdk.auth.HttpBasicAuth;
import com.squarelabs.shoutout.sdk.auth.OAuth;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.GenericType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.squaremobile.shoutout.sdk;
package com.squarelabs.shoutout.sdk;

import java.util.Map;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.squaremobile.shoutout.sdk;
package com.squarelabs.shoutout.sdk;

@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-07-13T10:36:50.130Z")
public class Configuration {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.squaremobile.shoutout.sdk;
package com.squarelabs.shoutout.sdk;

@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-07-13T10:36:50.130Z")
public class Pair {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.squaremobile.shoutout.sdk;
package com.squarelabs.shoutout.sdk;

@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-07-13T10:36:50.130Z")
public class StringUtil {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.squaremobile.shoutout.sdk.api;
package com.squarelabs.shoutout.sdk.api;

import com.squarelabs.shoutout.sdk.ApiClient;
import com.squarelabs.shoutout.sdk.Configuration;
import com.squarelabs.shoutout.sdk.Pair;
import com.squarelabs.shoutout.sdk.model.Response;
import com.sun.jersey.api.client.GenericType;

import com.squaremobile.shoutout.sdk.ApiException;
import com.squaremobile.shoutout.sdk.ApiClient;
import com.squaremobile.shoutout.sdk.Configuration;
import com.squaremobile.shoutout.sdk.Pair;
import com.squarelabs.shoutout.sdk.ApiException;

import com.squaremobile.shoutout.sdk.model.Response;
import com.squaremobile.shoutout.sdk.model.ActivityRecord;
import com.squarelabs.shoutout.sdk.model.ActivityRecord;


import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.squaremobile.shoutout.sdk.api;
package com.squarelabs.shoutout.sdk.api;

import com.squaremobile.shoutout.sdk.ApiException;
import com.squaremobile.shoutout.sdk.Configuration;
import com.squaremobile.shoutout.sdk.model.Contact;
import com.squaremobile.shoutout.sdk.model.ContactList;
import com.squarelabs.shoutout.sdk.ApiException;
import com.squarelabs.shoutout.sdk.Configuration;
import com.squarelabs.shoutout.sdk.model.Contact;
import com.squarelabs.shoutout.sdk.model.ContactList;
import com.sun.jersey.api.client.GenericType;

import com.squaremobile.shoutout.sdk.ApiClient;
import com.squaremobile.shoutout.sdk.Pair;
import com.squarelabs.shoutout.sdk.ApiClient;
import com.squarelabs.shoutout.sdk.Pair;


import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package com.squaremobile.shoutout.sdk.api;

import com.squaremobile.shoutout.sdk.ApiException;
import com.squaremobile.shoutout.sdk.Configuration;
import com.squaremobile.shoutout.sdk.model.Message;
import com.squaremobile.shoutout.sdk.model.MessageResponse;
package com.squarelabs.shoutout.sdk.api;

import com.squarelabs.shoutout.sdk.ApiClient;
import com.squarelabs.shoutout.sdk.Configuration;
import com.squarelabs.shoutout.sdk.Pair;
import com.squarelabs.shoutout.sdk.model.Message;
import com.squarelabs.shoutout.sdk.ApiException;
import com.squarelabs.shoutout.sdk.model.MessageResponse;
import com.sun.jersey.api.client.GenericType;

import com.squaremobile.shoutout.sdk.ApiClient;
import com.squaremobile.shoutout.sdk.Pair;


import java.util.ArrayList;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.squaremobile.shoutout.sdk.auth;
package com.squarelabs.shoutout.sdk.auth;

import com.squaremobile.shoutout.sdk.Pair;
import com.squarelabs.shoutout.sdk.Pair;

import java.util.Map;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.squaremobile.shoutout.sdk.auth;
package com.squarelabs.shoutout.sdk.auth;

import com.squaremobile.shoutout.sdk.Pair;
import com.squarelabs.shoutout.sdk.Pair;

import java.util.Map;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.squaremobile.shoutout.sdk.auth;
package com.squarelabs.shoutout.sdk.auth;

import com.squaremobile.shoutout.sdk.Pair;
import com.squarelabs.shoutout.sdk.Pair;

import com.migcomponents.migbase64.Base64;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.squaremobile.shoutout.sdk.auth;
package com.squarelabs.shoutout.sdk.auth;

import com.squaremobile.shoutout.sdk.Pair;
import com.squarelabs.shoutout.sdk.Pair;

import java.util.Map;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.squaremobile.shoutout.sdk.auth;
package com.squarelabs.shoutout.sdk.auth;

public enum OAuthFlow {
accessCode, implicit, password, application
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.squaremobile.shoutout.sdk.model;
package com.squarelabs.shoutout.sdk.model;

import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.squaremobile.shoutout.sdk.model;
package com.squarelabs.shoutout.sdk.model;

import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.squaremobile.shoutout.sdk.model;
package com.squarelabs.shoutout.sdk.model;

import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.squaremobile.shoutout.sdk.model;
package com.squarelabs.shoutout.sdk.model;

import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.squaremobile.shoutout.sdk.model;
package com.squarelabs.shoutout.sdk.model;

import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.squaremobile.shoutout.sdk.model;
package com.squarelabs.shoutout.sdk.model;

import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.squaremobile.shoutout.sdk.model;
package com.squarelabs.shoutout.sdk.model;

import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package com.squarelabs.shoutout.sdk.sample;

import com.squarelabs.shoutout.sdk.ApiClient;
import com.squarelabs.shoutout.sdk.Configuration;
import com.squarelabs.shoutout.sdk.api.ActivitiesApi;
import com.squarelabs.shoutout.sdk.auth.ApiKeyAuth;
import com.squarelabs.shoutout.sdk.model.ActivityRecord;
import com.squarelabs.shoutout.sdk.model.Response;

/**
* Created by Madura on 14/07/2016.
*/
public class ActivityRecordPost {

public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: ShoutOUTCustomAuthorizer
ApiKeyAuth ShoutOUTCustomAuthorizer = (ApiKeyAuth) defaultClient.getAuthentication("ShoutOUTCustomAuthorizer");
ShoutOUTCustomAuthorizer.setApiKeyPrefix("Apikey");
ShoutOUTCustomAuthorizer.setApiKey("YOUR API KEY");//Set Api Token

try {
ActivitiesApi api = new ActivitiesApi();
ActivityRecord activityRecord = new ActivityRecord();
activityRecord.setActivityId("ACTIVITY_ID");
activityRecord.setActivityName("ACTIVITY_NAME");
activityRecord.setUserId("USER_ID");//your userId
activityRecord.setActivityData(new ActivityData("signup","John"));
Response response = api.createActivity(activityRecord,ShoutOUTCustomAuthorizer.getApiKey());
//Do your stuff with the response
System.out.println("Message:"+response.getMessage());
} catch (Exception e) {
e.printStackTrace();
}
}

//Arbitrary object based on the attributes in the event you created
public static class ActivityData {
private String status,name;//arbitrary properties

public ActivityData(String status, String name) {
this.status = status;
this.name = name;
}

public String getStatus() {
return status;
}

public void setStatus(String status) {
this.status = status;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}
}
}
44 changes: 44 additions & 0 deletions src/main/java/com/squarelabs/shoutout/sdk/sample/MessagePost.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.squarelabs.shoutout.sdk.sample;


import com.squarelabs.shoutout.sdk.ApiClient;
import com.squarelabs.shoutout.sdk.Configuration;
import com.squarelabs.shoutout.sdk.api.MessagesApi;
import com.squarelabs.shoutout.sdk.auth.ApiKeyAuth;
import com.squarelabs.shoutout.sdk.model.Message;
import com.squarelabs.shoutout.sdk.model.MessageContent;
import com.squarelabs.shoutout.sdk.model.MessageResponse;

import java.util.Arrays;

/**
* Created by Madura on 14/07/2016.
*/
public class MessagePost {


public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: ShoutOUTCustomAuthorizer
ApiKeyAuth ShoutOUTCustomAuthorizer = (ApiKeyAuth) defaultClient.getAuthentication("ShoutOUTCustomAuthorizer");
ShoutOUTCustomAuthorizer.setApiKeyPrefix("Apikey");
ShoutOUTCustomAuthorizer.setApiKey("YOUR API KEY");//Set Api Token

try {
MessagesApi api = new MessagesApi();
Message message = new Message();
MessageContent messageContent = new MessageContent();
messageContent.setSms("Hello, This is a test message"); //sms content
message.setContent(messageContent);
message.setDestinations(Arrays.asList("94778845713"));//mobile numbers to send the message
message.setSource("ShoutDEMO");//Sender Id
message.setTransports(Arrays.asList(Message.TransportsEnum.SMS));//Type of transport (SMS). More transports will come soon

MessageResponse response = api.sendMessage(ShoutOUTCustomAuthorizer.getApiKey(), message);
//Do your stuff with the response
System.out.println("Status:" + response.getStatus());
} catch (Exception e) {
e.printStackTrace();
}
}
}
17 changes: 17 additions & 0 deletions src/main/java/com/squarelabs/shoutout/sdk/sample/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.squarelabs.shoutout.sdk.sample</groupId>
<artifactId>sdk-sample</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>com.squarelabs.shoutout.sdk</groupId>
<artifactId>shoutout-java-sdk</artifactId>
<version>7.0.0</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.squaremobile.shoutout.sdk.api;
package com.squarelabs.shoutout.sdk.api;

import com.squaremobile.shoutout.sdk.ApiException;
import com.squaremobile.shoutout.sdk.model.ActivityRecord;
import com.squarelabs.shoutout.sdk.ApiException;
import com.squarelabs.shoutout.sdk.model.ActivityRecord;
import org.junit.Test;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.squaremobile.shoutout.sdk.api;
package com.squarelabs.shoutout.sdk.api;

import com.squaremobile.shoutout.sdk.ApiException;
import com.squaremobile.shoutout.sdk.model.Contact;
import com.squaremobile.shoutout.sdk.model.ContactList;
import com.squarelabs.shoutout.sdk.model.ContactList;
import com.squarelabs.shoutout.sdk.ApiException;
import com.squarelabs.shoutout.sdk.model.Contact;
import org.junit.Test;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.squaremobile.shoutout.sdk.api;
package com.squarelabs.shoutout.sdk.api;

import com.squaremobile.shoutout.sdk.model.Message;
import com.squaremobile.shoutout.sdk.ApiException;
import com.squarelabs.shoutout.sdk.model.Message;
import com.squarelabs.shoutout.sdk.ApiException;
import org.junit.Test;

/**
Expand Down

0 comments on commit 880b72b

Please sign in to comment.