/**
 * This file is auto-generated by our openapi spec.
 * We try to keep the generated code pretty clean but there will be lint
 * errors that are just not worth fixing (like unused requires).
 * TODO: maybe we can just disable those specifically and keep this code
 * pretty lint-free too!
 */
/* jshint ignore:start */
var Resource = require('../resource');
var util = require('util');
var _ = require('lodash');

function WorkspaceMemberships(dispatcher) {
    Resource.call(this, dispatcher);
}
util.inherits(WorkspaceMemberships, Resource);


/**
 * Get a workspace membership
 * @param {String} workspaceMembershipGid: (required)
 * @param {Object} params: Parameters for the request
     - optFields {[String]}:  Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.
     - optPretty {Boolean}:  Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
 * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
 * @return {Promise} The requested resource
 */
WorkspaceMemberships.prototype.getWorkspaceMembership = function(
    workspaceMembershipGid,
    params,
    dispatchOptions
) {
    var path = "/workspace_memberships/{workspace_membership_gid}".replace("{workspace_membership_gid}", workspaceMembershipGid);

    return this.dispatchGet(path, params, dispatchOptions)
};


/**
 * Get workspace memberships for a user
 * @param {String} userGid: (required) A string identifying a user. This can either be the string \"me\", an email, or the gid of a user.
 * @param {Object} params: Parameters for the request
     - offset {String}:  Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.'
     - limit {Number}:  Results per page. The number of objects to return per page. The value must be between 1 and 100.
     - optFields {[String]}:  Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.
     - optPretty {Boolean}:  Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
 * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
 * @return {Promise} The requested resource
 */
WorkspaceMemberships.prototype.getWorkspaceMembershipsForUser = function(
    userGid,
    params,
    dispatchOptions
) {
    var path = "/users/{user_gid}/workspace_memberships".replace("{user_gid}", userGid);

    return this.dispatchGetCollection(path, params, dispatchOptions)
};


/**
 * Get the workspace memberships for a workspace
 * @param {String} workspaceGid: (required) Globally unique identifier for the workspace or organization.
 * @param {Object} params: Parameters for the request
     - user {String}:  A string identifying a user. This can either be the string \"me\", an email, or the gid of a user.
     - offset {String}:  Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.'
     - limit {Number}:  Results per page. The number of objects to return per page. The value must be between 1 and 100.
     - optFields {[String]}:  Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.
     - optPretty {Boolean}:  Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
 * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
 * @return {Promise} The requested resource
 */
WorkspaceMemberships.prototype.getWorkspaceMembershipsForWorkspace = function(
    workspaceGid,
    params,
    dispatchOptions
) {
    var path = "/workspaces/{workspace_gid}/workspace_memberships".replace("{workspace_gid}", workspaceGid);

    return this.dispatchGetCollection(path, params, dispatchOptions)
};

module.exports = WorkspaceMemberships;
/* jshint ignore:end */
