All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.twilio.sdk.resource.list.MemberList Maven / Gradle / Ivy

There is a newer version: 7.0.0-rc-10
Show newest version
package com.twilio.sdk.resource.list;

import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.resource.ListResource;
import com.twilio.sdk.resource.instance.Member;

import java.util.Map;

/**
 * The {@link MemberList} represents the list resource for {@link Member}s.
 *
 * For more information see https://www.twilio.com/docs/api/rest/member
 */
public class MemberList extends ListResource {

    /**
     * The queue sid.
     */
    private String queueSid;

    /**
     * Instantiates a new participant list.
     *
     * @param client
     *            the client to use
     */
    public MemberList(final TwilioRestClient client) {
        super(client);
    }

    /**
     * Instantiates a new {@link MemberList}.
     *
     * @param client
     *            the client
     * @param filters
     *            the filters if any
     */
    public MemberList(final TwilioRestClient client, final Map filters) {
        super(client, filters);
    }

    /**
     *Instantiates a new {@link MemberList}.
     *
     * @param client
     *            the {@link TwilioRestClient} to use
     * @param queueSid
     *            the queue sid for which this {@link MemberList} exists
     */
    public MemberList(final TwilioRestClient client, final String queueSid) {
        super(client);
        this.queueSid = queueSid;
    }

    /*
     * (non-Javadoc)
     *
     * @see com.twilio.sdk.resource.Resource#getResourceLocation()
     */
    @Override
    protected String getResourceLocation() {
        return "/" + TwilioRestClient.DEFAULT_VERSION + "/Accounts/"
                + this.getRequestAccountSid() + "/Queues/"
                + this.queueSid + "/Members.json";
    }

    /*
     * (non-Javadoc)
     *
     * @see com.twilio.sdk.resource.ListResource#makeNew(com.twilio.sdk.TwilioRestClient, java.util.Map)
     */
    @Override
    protected Member makeNew(final TwilioRestClient client,
            final Map params) {
        return new Member(client, params, queueSid);
    }

    /*
     * (non-Javadoc)
     *
     * @see com.twilio.sdk.resource.ListResource#getListKey()
     */
    @Override
    protected String getListKey() {
        return "queue_members";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy