Skip to content

Identify SDK - #17

Closed
HJewkes wants to merge 4 commits into
developmentfrom
identify
Closed

HJewkes wants to merge 4 commits into
developmentfrom
identify

Conversation

@HJewkes

@HJewkes HJewkes commented Mar 1, 2017 •

Copy link
Copy Markdown
Contributor
SplitAPIClientConfig config = SplitAPIClientConfig.builder()
  .publicApiUrl()
  .build();

SplitAPIClient apiClient = SplitApiClientBuilder.client("YOUR_ADMIN_API_KEY", config);

TrafficType type = apiClient.trafficTypes().get("User");
List<Attribute> attributes = apiClient.attributes().list(type);
Environment env = apiClient.environments().get("Production");
apiClient.identities().create(Identity.builder()
  .trafficType(type)
  .environment(env)
  .key("email@address.com")
  .addValue("attribute", "value")
  .addValue("number", 1000)
  .addValue("boolean", true)
  .build()
);

Open questions:

  • Do we include this back in the Split Module?
  • Do we use a Factory pattern?
  • Do we use a different configuration object?
  • Do we use the segmented client format (ie apiClient.trafficTypes().list()) or a flat client (ie apiClient.listTrafficTypes())
@HJewkes HJewkes changed the title Prototype Identify SDK Mar 10, 2017
return new ApiClient();
}

public static SplitApiClient local() throws IOException {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove Local client (unneeded)

@HJewkes HJewkes left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase in latest Java

return list(trafficType.id());
}

public ApiAttributeClient create(Attribute attribute) throws IllegalArgumentException {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HJewkes Question here. Why does it return a result of the same type as the service? Shouldn't it be a Boolean, to know if the action was successful or not, or at least the type of the object being created (I mean: Attribute)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@patricioe requested creating a fluent api, so this is designed to allow for fluent execution of calls. He may have only been referring to the builder pattern for objects tho - so I'll let him clarify

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we decided to return a result after each execution method.

@HJewkes HJewkes closed this May 17, 2017
@HJewkes
HJewkes deleted the identify branch May 17, 2017 22:59
@sonarqube-pull-requests

Copy link
Copy Markdown

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

bot2-harness pushed a commit that referenced this pull request Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants