Skip to content

Latest commit

 

History

History
executable file
·
361 lines (245 loc) · 10.9 KB

UserAttributeApi.md

File metadata and controls

executable file
·
361 lines (245 loc) · 10.9 KB

LookerApi31Reference.UserAttributeApi

All URIs are relative to /api/3.1

Method HTTP request Description
allUserAttributeGroupValues GET /user_attributes/{user_attribute_id}/group_values Get User Attribute Group Values
allUserAttributes GET /user_attributes Get All User Attributes
createUserAttribute POST /user_attributes Create User Attribute
deleteUserAttribute DELETE /user_attributes/{user_attribute_id} Delete User Attribute
setUserAttributeGroupValues POST /user_attributes/{user_attribute_id}/group_values Set User Attribute Group Values
updateUserAttribute PATCH /user_attributes/{user_attribute_id} Update User Attribute
userAttribute GET /user_attributes/{user_attribute_id} Get User Attribute

allUserAttributeGroupValues

[UserAttributeGroupValue] allUserAttributeGroupValues(userAttributeId, opts)

Get User Attribute Group Values

Returns all values of a user attribute defined by user groups, in precedence order. A user may be a member of multiple groups which define different values for a given user attribute. The order of group-values in the response determines precedence for selecting which group-value applies to a given user. For more information, see Set User Attribute Group Values. Results will only include groups that the caller's user account has permission to see.

Example

var LookerApi31Reference = require('looker-node-api');

var apiInstance = new LookerApi31Reference.UserAttributeApi();

var userAttributeId = 789; // Number | Id of user attribute

var opts = {
  'fields': "fields_example" // String | Requested fields.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.allUserAttributeGroupValues(userAttributeId, opts, callback);

Parameters

Name Type Description Notes
userAttributeId Number Id of user attribute
fields String Requested fields. [optional]

Return type

[UserAttributeGroupValue]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

allUserAttributes

[UserAttribute] allUserAttributes(opts)

Get All User Attributes

Get information about all user attributes.

Example

var LookerApi31Reference = require('looker-node-api');

var apiInstance = new LookerApi31Reference.UserAttributeApi();

var opts = {
  'fields': "fields_example", // String | Requested fields.
  'sorts': "sorts_example" // String | Fields to sort by.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.allUserAttributes(opts, callback);

Parameters

Name Type Description Notes
fields String Requested fields. [optional]
sorts String Fields to sort by. [optional]

Return type

[UserAttribute]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

createUserAttribute

UserAttribute createUserAttribute(opts)

Create User Attribute

Create a new user attribute.

Example

var LookerApi31Reference = require('looker-node-api');

var apiInstance = new LookerApi31Reference.UserAttributeApi();

var opts = {
  'body': new LookerApi31Reference.UserAttribute(), // UserAttribute | User Attribute
  'fields': "fields_example" // String | Requested fields.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createUserAttribute(opts, callback);

Parameters

Name Type Description Notes
body UserAttribute User Attribute [optional]
fields String Requested fields. [optional]

Return type

UserAttribute

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

deleteUserAttribute

'String' deleteUserAttribute(userAttributeId)

Delete User Attribute

Delete a user attribute (admin only).

Example

var LookerApi31Reference = require('looker-node-api');

var apiInstance = new LookerApi31Reference.UserAttributeApi();

var userAttributeId = 789; // Number | Id of user_attribute


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.deleteUserAttribute(userAttributeId, callback);

Parameters

Name Type Description Notes
userAttributeId Number Id of user_attribute

Return type

'String'

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

setUserAttributeGroupValues

[UserAttributeGroupValue] setUserAttributeGroupValues(userAttributeId, body)

Set User Attribute Group Values

Define values for a user attribute across a set of groups, in priority order. This function defines all values for a user attribute defined by user groups. This is a global setting, potentially affecting all users in the system. This function replaces any existing group value definitions for the indicated user attribute. The value of a user attribute for a given user is determined by searching the following locations, in this order: 1. the user's account settings 2. the groups that the user is a member of 3. the default value of the user attribute, if any The user may be a member of multiple groups which define different values for that user attribute. The order of items in the group_values parameter determines which group takes priority for that user. Lowest array index wins. An alternate method to indicate the selection precedence of group-values is to assign numbers to the 'rank' property of each group-value object in the array. Lowest 'rank' value wins. If you use this technique, you must assign a rank value to every group-value object in the array. To set a user attribute value for a single user, see Set User Attribute User Value. To set a user attribute value for all members of a group, see Set User Attribute Group Value.

Example

var LookerApi31Reference = require('looker-node-api');

var apiInstance = new LookerApi31Reference.UserAttributeApi();

var userAttributeId = 789; // Number | Id of user attribute

var body = [new LookerApi31Reference.UserAttributeGroupValue()]; // [UserAttributeGroupValue] | Array of group values.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.setUserAttributeGroupValues(userAttributeId, body, callback);

Parameters

Name Type Description Notes
userAttributeId Number Id of user attribute
body [UserAttributeGroupValue] Array of group values.

Return type

[UserAttributeGroupValue]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

updateUserAttribute

UserAttribute updateUserAttribute(userAttributeId, body, opts)

Update User Attribute

Update a user attribute definition.

Example

var LookerApi31Reference = require('looker-node-api');

var apiInstance = new LookerApi31Reference.UserAttributeApi();

var userAttributeId = 789; // Number | Id of user attribute

var body = new LookerApi31Reference.UserAttribute(); // UserAttribute | User Attribute

var opts = {
  'fields': "fields_example" // String | Requested fields.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.updateUserAttribute(userAttributeId, body, opts, callback);

Parameters

Name Type Description Notes
userAttributeId Number Id of user attribute
body UserAttribute User Attribute
fields String Requested fields. [optional]

Return type

UserAttribute

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

userAttribute

UserAttribute userAttribute(userAttributeId, opts)

Get User Attribute

Get information about a user attribute.

Example

var LookerApi31Reference = require('looker-node-api');

var apiInstance = new LookerApi31Reference.UserAttributeApi();

var userAttributeId = 789; // Number | Id of user attribute

var opts = {
  'fields': "fields_example" // String | Requested fields.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.userAttribute(userAttributeId, opts, callback);

Parameters

Name Type Description Notes
userAttributeId Number Id of user attribute
fields String Requested fields. [optional]

Return type

UserAttribute

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json