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

Implement create group #38

Merged
merged 5 commits into from
Mar 18, 2019
Merged

Implement create group #38

merged 5 commits into from
Mar 18, 2019

Conversation

mitruly
Copy link
Contributor

@mitruly mitruly commented Feb 21, 2019

Implement create group method. Resolves #14.

Changes include:

  • Fix Group response
  • Add create group endpoint

Note for reviewers:
Tested the client against an instance of VinylDNS running on localhost using the following:

VinylDNSClient localClient =
    new VinylDNSClientImpl(
        new VinylDNSClientConfig(
            "http://localhost:9000",
            new BasicAWSCredentials("okAccessKey", "okSecretKey")));

VinylDNSResponse<Group> vinylDNSResponse = localClient.createGroup(new CreateGroupRequest("some-group", "some@email",
    Collections.singleton(new MemberId("ok")), Collections.singleton(new MemberId("ok"))));

System.out.println("response: " + vinylDNSResponse);

This produced the following response:

response: VinylDNSSuccessResponse{value=Group{name='some-group', email='some@email', description='null', id='708c813f-e84d-463a-a2b4-8b18cd8bb1d4', created='2019-02-20T22:42:24.000-05:00', status=Active, members=[UserInfo{id='ok', userName='null', firstName='null', lastName='null', email='null', created=null, lockStatus=Unlocked}], admins=[UserInfo{id='ok', userName='null', firstName='null', lastName='null', email='null', created=null, lockStatus=Unlocked}]}, statusCode=200}

@mitruly mitruly self-assigned this Feb 21, 2019
@@ -0,0 +1,33 @@
package io.vinyldns.java.model.membership;

public class MemberId {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

MemberId is required because the create group endpoint expects a collection of {'id': <id>} values, not simply a collection of ids.

import io.vinyldns.java.model.zone.Zone;
import org.joda.time.DateTime;

public class UserInfo {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mitruly mitruly merged commit 7aff97e into vinyldns:master Mar 18, 2019
@mitruly mitruly deleted the create-group branch March 18, 2019 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant