Class: AlfrescoAPI::GroupsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/alfresco_api/api/groups_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ GroupsApi

Returns a new instance of GroupsApi.



19
20
21
# File 'lib/alfresco_api/api/groups_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/alfresco_api/api/groups_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_group(group_body_create, opts = {}) ⇒ GroupEntry

Create a group Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Create a group. The group id must start with "GROUP_". If this is omitted it will be added automatically. This format is also returned when listing groups or group memberships. It should be noted that the other group-related operations also expect the id to start with "GROUP_". If one or more parentIds are specified then the group will be created and become a member of each of the specified parent groups. If no parentIds are specified then the group will be created as a root group. The group will be created in the APP.DEFAULT and AUTH.ALF zones. You must have admin rights to create a group.

Parameters:

  • group_body_create

    The group to create.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include (Array<String>)

    Returns additional information about the group. The following optional fields can be requested: * parentIds * zones

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:



30
31
32
33
# File 'lib/alfresco_api/api/groups_api.rb', line 30

def create_group(group_body_create, opts = {})
  data, _status_code, _headers = create_group_with_http_info(group_body_create, opts)
  return data
end

#create_group_membership(group_id, group_membership_body_create, opts = {}) ⇒ GroupMemberEntry

Create a group membership Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Create a group membership (for an existing person or group) within a group groupId. If the added group was previously a root group then it becomes a non-root group since it now has a parent. It is an error to specify an id that does not exist. You must have admin rights to create a group membership.

Parameters:

  • group_id

    The identifier of a group.

  • group_membership_body_create

    The group membership to add (person or sub-group).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:



91
92
93
94
# File 'lib/alfresco_api/api/groups_api.rb', line 91

def create_group_membership(group_id, group_membership_body_create, opts = {})
  data, _status_code, _headers = create_group_membership_with_http_info(group_id, group_membership_body_create, opts)
  return data
end

#create_group_membership_with_http_info(group_id, group_membership_body_create, opts = {}) ⇒ Array<(GroupMemberEntry, Fixnum, Hash)>

Create a group membership Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Create a group membership (for an existing person or group) within a group groupId. If the added group was previously a root group then it becomes a non-root group since it now has a parent. It is an error to specify an id that does not exist. You must have admin rights to create a group membership.

Parameters:

  • group_id

    The identifier of a group.

  • group_membership_body_create

    The group membership to add (person or sub-group).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:

  • (Array<(GroupMemberEntry, Fixnum, Hash)>)

    GroupMemberEntry data, response status code and response headers



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/alfresco_api/api/groups_api.rb', line 103

def create_group_membership_with_http_info(group_id, group_membership_body_create, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi.create_group_membership ..."
  end
  # verify the required parameter 'group_id' is set
  if @api_client.config.client_side_validation && group_id.nil?
    fail ArgumentError, "Missing the required parameter 'group_id' when calling GroupsApi.create_group_membership"
  end
  # verify the required parameter 'group_membership_body_create' is set
  if @api_client.config.client_side_validation && group_membership_body_create.nil?
    fail ArgumentError, "Missing the required parameter 'group_membership_body_create' when calling GroupsApi.create_group_membership"
  end
  # resource path
  local_var_path = "/groups/{groupId}/members".sub('{' + 'groupId' + '}', group_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(group_membership_body_create)
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GroupMemberEntry')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupsApi#create_group_membership\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_group_with_http_info(group_body_create, opts = {}) ⇒ Array<(GroupEntry, Fixnum, Hash)>

Create a group Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Create a group. The group id must start with &quot;GROUP_&quot;. If this is omitted it will be added automatically. This format is also returned when listing groups or group memberships. It should be noted that the other group-related operations also expect the id to start with &quot;GROUP_&quot;. If one or more parentIds are specified then the group will be created and become a member of each of the specified parent groups. If no parentIds are specified then the group will be created as a root group. The group will be created in the APP.DEFAULT and AUTH.ALF zones. You must have admin rights to create a group.

Parameters:

  • group_body_create

    The group to create.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include (Array<String>)

    Returns additional information about the group. The following optional fields can be requested: * parentIds * zones

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:

  • (Array<(GroupEntry, Fixnum, Hash)>)

    GroupEntry data, response status code and response headers



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/alfresco_api/api/groups_api.rb', line 42

def create_group_with_http_info(group_body_create, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi.create_group ..."
  end
  # verify the required parameter 'group_body_create' is set
  if @api_client.config.client_side_validation && group_body_create.nil?
    fail ArgumentError, "Missing the required parameter 'group_body_create' when calling GroupsApi.create_group"
  end
  # resource path
  local_var_path = "/groups"

  # query parameters
  query_params = {}
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(group_body_create)
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GroupEntry')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupsApi#create_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_group(group_id, opts = {}) ⇒ nil

Delete a group Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Delete group groupId. The option to cascade delete applies this recursively to any hierarchy of group members. In this case, removing a group member does not delete the person or sub-group itself. If a removed sub-group no longer has any parent groups then it becomes a root group. You must have admin rights to delete a group.

Parameters:

  • group_id

    The identifier of a group.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :cascade (BOOLEAN)

    If true then the delete will be applied in cascade to sub-groups. (default to false)

Returns:

  • (nil)


154
155
156
157
# File 'lib/alfresco_api/api/groups_api.rb', line 154

def delete_group(group_id, opts = {})
  delete_group_with_http_info(group_id, opts)
  return nil
end

#delete_group_membership(group_id, group_member_id, opts = {}) ⇒ nil

Delete a group membership Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Delete group member groupMemberId (person or sub-group) from group groupId. Removing a group member does not delete the person or sub-group itself. If a removed sub-group no longer has any parent groups then it becomes a root group. You must have admin rights to delete a group membership.

Parameters:

  • group_id

    The identifier of a group.

  • group_member_id

    The identifier of a person or group.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


211
212
213
214
# File 'lib/alfresco_api/api/groups_api.rb', line 211

def delete_group_membership(group_id, group_member_id, opts = {})
  delete_group_membership_with_http_info(group_id, group_member_id, opts)
  return nil
end

#delete_group_membership_with_http_info(group_id, group_member_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a group membership Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Delete group member groupMemberId (person or sub-group) from group groupId. Removing a group member does not delete the person or sub-group itself. If a removed sub-group no longer has any parent groups then it becomes a root group. You must have admin rights to delete a group membership.

Parameters:

  • group_id

    The identifier of a group.

  • group_member_id

    The identifier of a person or group.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
# File 'lib/alfresco_api/api/groups_api.rb', line 222

def delete_group_membership_with_http_info(group_id, group_member_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi.delete_group_membership ..."
  end
  # verify the required parameter 'group_id' is set
  if @api_client.config.client_side_validation && group_id.nil?
    fail ArgumentError, "Missing the required parameter 'group_id' when calling GroupsApi.delete_group_membership"
  end
  # verify the required parameter 'group_member_id' is set
  if @api_client.config.client_side_validation && group_member_id.nil?
    fail ArgumentError, "Missing the required parameter 'group_member_id' when calling GroupsApi.delete_group_membership"
  end
  # resource path
  local_var_path = "/groups/{groupId}/members/{groupMemberId}".sub('{' + 'groupId' + '}', group_id.to_s).sub('{' + 'groupMemberId' + '}', group_member_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupsApi#delete_group_membership\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_group_with_http_info(group_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a group Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Delete group groupId. The option to cascade delete applies this recursively to any hierarchy of group members. In this case, removing a group member does not delete the person or sub-group itself. If a removed sub-group no longer has any parent groups then it becomes a root group. You must have admin rights to delete a group.

Parameters:

  • group_id

    The identifier of a group.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :cascade (BOOLEAN)

    If true then the delete will be applied in cascade to sub-groups.

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/alfresco_api/api/groups_api.rb', line 165

def delete_group_with_http_info(group_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi.delete_group ..."
  end
  # verify the required parameter 'group_id' is set
  if @api_client.config.client_side_validation && group_id.nil?
    fail ArgumentError, "Missing the required parameter 'group_id' when calling GroupsApi.delete_group"
  end
  # resource path
  local_var_path = "/groups/{groupId}".sub('{' + 'groupId' + '}', group_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'cascade'] = opts[:'cascade'] if !opts[:'cascade'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupsApi#delete_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_group(group_id, opts = {}) ⇒ GroupEntry

Get group details Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Get details for group groupId. You can use the include parameter to return additional information.

Parameters:

  • group_id

    The identifier of a group.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include (Array<String>)

    Returns additional information about the group. The following optional fields can be requested: * parentIds * zones

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:



272
273
274
275
# File 'lib/alfresco_api/api/groups_api.rb', line 272

def get_group(group_id, opts = {})
  data, _status_code, _headers = get_group_with_http_info(group_id, opts)
  return data
end

#get_group_with_http_info(group_id, opts = {}) ⇒ Array<(GroupEntry, Fixnum, Hash)>

Get group details Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Get details for group groupId. You can use the include parameter to return additional information.

Parameters:

  • group_id

    The identifier of a group.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include (Array<String>)

    Returns additional information about the group. The following optional fields can be requested: * parentIds * zones

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:

  • (Array<(GroupEntry, Fixnum, Hash)>)

    GroupEntry data, response status code and response headers



284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# File 'lib/alfresco_api/api/groups_api.rb', line 284

def get_group_with_http_info(group_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi.get_group ..."
  end
  # verify the required parameter 'group_id' is set
  if @api_client.config.client_side_validation && group_id.nil?
    fail ArgumentError, "Missing the required parameter 'group_id' when calling GroupsApi.get_group"
  end
  # resource path
  local_var_path = "/groups/{groupId}".sub('{' + 'groupId' + '}', group_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GroupEntry')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupsApi#get_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_group_memberships(group_id, opts = {}) ⇒ GroupMemberPaging

List memberships of a group Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Gets a list of the group memberships for the group groupId. You can use the where parameter to filter the returned groups by memberType. Example to filter by memberType, use any one of: “‘ (memberType=’GROUP’) (memberType=‘PERSON’) “‘ The default sort order for the returned list is for group members to be sorted by ascending displayName. You can override the default by using the orderBy parameter. You can specify one of the following fields in the orderBy parameter: * id * displayName

Parameters:

  • group_id

    The identifier of a group.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :skip_count (Integer)

    The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. (default to 0)

  • :max_items (Integer)

    The maximum number of items to return in the list. If not supplied then the default value is 100. (default to 100)

  • :order_by (Array<String>)

    A string to control the order of the entities returned in a list. You can use the orderBy parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the ASC and DESC keywords for any field.

  • :where (String)

    A string to restrict the returned objects by using a predicate.

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:



336
337
338
339
# File 'lib/alfresco_api/api/groups_api.rb', line 336

def list_group_memberships(group_id, opts = {})
  data, _status_code, _headers = list_group_memberships_with_http_info(group_id, opts)
  return data
end

#list_group_memberships_for_person(person_id, opts = {}) ⇒ GroupPaging

List group memberships Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Gets a list of group membership information for person personId. You can use the ‘-me-` string in place of `<personId>` to specify the currently authenticated user. You can use the include parameter to return additional information. You can use the where parameter to filter the returned groups by isRoot. For example, the following where clause will return just the root groups: “` (isRoot=true) “` The where parameter can also be used to filter by ***zone***. This may be combined with isRoot to narrow a result set even further. For example, the following where clause will only return groups belonging to the `MY.ZONE` zone. “` where=(zones in (’MY.ZONE’)) “‘ This may be combined with the isRoot filter, as shown below: “` where=(isRoot=false AND zones in (’MY.ZONE’)) “‘ ***Note:*** restrictions include * `AND` is the only supported operator when combining `isRoot` and `zones` filters * Only one zone is supported by the filter * The quoted zone name must be placed in parenthesis — a 400 error will result if these are omitted. The default sort order for the returned list is for groups to be sorted by ascending displayName. You can override the default by using the orderBy parameter. You can specify one or more of the following fields in the orderBy parameter: * id * displayName

Parameters:

  • person_id

    The identifier of a person.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :skip_count (Integer)

    The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. (default to 0)

  • :max_items (Integer)

    The maximum number of items to return in the list. If not supplied then the default value is 100. (default to 100)

  • :order_by (Array<String>)

    A string to control the order of the entities returned in a list. You can use the orderBy parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the ASC and DESC keywords for any field.

  • :include (Array<String>)

    Returns additional information about the group. The following optional fields can be requested: * parentIds * zones

  • :where (String)

    A string to restrict the returned objects by using a predicate.

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:



415
416
417
418
# File 'lib/alfresco_api/api/groups_api.rb', line 415

def list_group_memberships_for_person(person_id, opts = {})
  data, _status_code, _headers = list_group_memberships_for_person_with_http_info(person_id, opts)
  return data
end

#list_group_memberships_for_person_with_http_info(person_id, opts = {}) ⇒ Array<(GroupPaging, Fixnum, Hash)>

List group memberships Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Gets a list of group membership information for person personId. You can use the &#x60;-me-&#x60; string in place of &#x60;&lt;personId&gt;&#x60; to specify the currently authenticated user. You can use the include parameter to return additional information. You can use the where parameter to filter the returned groups by isRoot. For example, the following where clause will return just the root groups: &#x60;&#x60;&#x60; (isRoot&#x3D;true) &#x60;&#x60;&#x60; The where parameter can also be used to filter by ***zone***. This may be combined with isRoot to narrow a result set even further. For example, the following where clause will only return groups belonging to the &#x60;MY.ZONE&#x60; zone. &#x60;&#x60;&#x60; where&#x3D;(zones in (&#39;MY.ZONE&#39;)) &#x60;&#x60;&#x60; This may be combined with the isRoot filter, as shown below: &#x60;&#x60;&#x60; where&#x3D;(isRoot&#x3D;false AND zones in (&#39;MY.ZONE&#39;)) &#x60;&#x60;&#x60; ***Note:*** restrictions include * &#x60;AND&#x60; is the only supported operator when combining &#x60;isRoot&#x60; and &#x60;zones&#x60; filters * Only one zone is supported by the filter * The quoted zone name must be placed in parenthesis — a 400 error will result if these are omitted. The default sort order for the returned list is for groups to be sorted by ascending displayName. You can override the default by using the orderBy parameter. You can specify one or more of the following fields in the orderBy parameter: * id * displayName

Parameters:

  • person_id

    The identifier of a person.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :skip_count (Integer)

    The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0.

  • :max_items (Integer)

    The maximum number of items to return in the list. If not supplied then the default value is 100.

  • :order_by (Array<String>)

    A string to control the order of the entities returned in a list. You can use the orderBy parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the ASC and DESC keywords for any field.

  • :include (Array<String>)

    Returns additional information about the group. The following optional fields can be requested: * parentIds * zones

  • :where (String)

    A string to restrict the returned objects by using a predicate.

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:

  • (Array<(GroupPaging, Fixnum, Hash)>)

    GroupPaging data, response status code and response headers



431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
# File 'lib/alfresco_api/api/groups_api.rb', line 431

def list_group_memberships_for_person_with_http_info(person_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi.list_group_memberships_for_person ..."
  end
  # verify the required parameter 'person_id' is set
  if @api_client.config.client_side_validation && person_id.nil?
    fail ArgumentError, "Missing the required parameter 'person_id' when calling GroupsApi.list_group_memberships_for_person"
  end
  if @api_client.config.client_side_validation && !opts[:'skip_count'].nil? && opts[:'skip_count'] < 0
    fail ArgumentError, 'invalid value for "opts[:"skip_count"]" when calling GroupsApi.list_group_memberships_for_person, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'max_items'].nil? && opts[:'max_items'] < 1
    fail ArgumentError, 'invalid value for "opts[:"max_items"]" when calling GroupsApi.list_group_memberships_for_person, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/people/{personId}/groups".sub('{' + 'personId' + '}', person_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'skipCount'] = opts[:'skip_count'] if !opts[:'skip_count'].nil?
  query_params[:'maxItems'] = opts[:'max_items'] if !opts[:'max_items'].nil?
  query_params[:'orderBy'] = @api_client.build_collection_param(opts[:'order_by'], :csv) if !opts[:'order_by'].nil?
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
  query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GroupPaging')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupsApi#list_group_memberships_for_person\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_group_memberships_with_http_info(group_id, opts = {}) ⇒ Array<(GroupMemberPaging, Fixnum, Hash)>

List memberships of a group Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Gets a list of the group memberships for the group groupId. You can use the where parameter to filter the returned groups by memberType. Example to filter by memberType, use any one of: &#x60;&#x60;&#x60; (memberType&#x3D;&#39;GROUP&#39;) (memberType&#x3D;&#39;PERSON&#39;) &#x60;&#x60;&#x60; The default sort order for the returned list is for group members to be sorted by ascending displayName. You can override the default by using the orderBy parameter. You can specify one of the following fields in the orderBy parameter: * id * displayName

Parameters:

  • group_id

    The identifier of a group.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :skip_count (Integer)

    The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0.

  • :max_items (Integer)

    The maximum number of items to return in the list. If not supplied then the default value is 100.

  • :order_by (Array<String>)

    A string to control the order of the entities returned in a list. You can use the orderBy parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the ASC and DESC keywords for any field.

  • :where (String)

    A string to restrict the returned objects by using a predicate.

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:

  • (Array<(GroupMemberPaging, Fixnum, Hash)>)

    GroupMemberPaging data, response status code and response headers



351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
# File 'lib/alfresco_api/api/groups_api.rb', line 351

def list_group_memberships_with_http_info(group_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi.list_group_memberships ..."
  end
  # verify the required parameter 'group_id' is set
  if @api_client.config.client_side_validation && group_id.nil?
    fail ArgumentError, "Missing the required parameter 'group_id' when calling GroupsApi.list_group_memberships"
  end
  if @api_client.config.client_side_validation && !opts[:'skip_count'].nil? && opts[:'skip_count'] < 0
    fail ArgumentError, 'invalid value for "opts[:"skip_count"]" when calling GroupsApi.list_group_memberships, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'max_items'].nil? && opts[:'max_items'] < 1
    fail ArgumentError, 'invalid value for "opts[:"max_items"]" when calling GroupsApi.list_group_memberships, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/groups/{groupId}/members".sub('{' + 'groupId' + '}', group_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'skipCount'] = opts[:'skip_count'] if !opts[:'skip_count'].nil?
  query_params[:'maxItems'] = opts[:'max_items'] if !opts[:'max_items'].nil?
  query_params[:'orderBy'] = @api_client.build_collection_param(opts[:'order_by'], :csv) if !opts[:'order_by'].nil?
  query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GroupMemberPaging')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupsApi#list_group_memberships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_groups(opts = {}) ⇒ GroupPaging

List groups Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Gets a list of groups. You can use the include parameter to return additional information. You can use the where parameter to filter the returned groups by isRoot. For example, the following where clause will return just the root groups: “‘ (isRoot=true) “` The where parameter can also be used to filter by ***zone***. This may be combined with isRoot to narrow a result set even further. For example, the following where clause will only return groups belonging to the `MY.ZONE` zone. “` where=(zones in (’MY.ZONE’)) “‘ This may be combined with the isRoot filter, as shown below: “` where=(isRoot=false AND zones in (’MY.ZONE’)) “‘ ***Note:*** restrictions include * `AND` is the only supported operator when combining `isRoot` and `zones` filters * Only one zone is supported by the filter * The quoted zone name must be placed in parenthesis — a 400 error will result if these are omitted. The default sort order for the returned list is for groups to be sorted by ascending displayName. You can override the default by using the orderBy parameter. You can specify one of the following fields in the orderBy parameter: * id * displayName

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :skip_count (Integer)

    The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. (default to 0)

  • :max_items (Integer)

    The maximum number of items to return in the list. If not supplied then the default value is 100. (default to 100)

  • :order_by (Array<String>)

    A string to control the order of the entities returned in a list. You can use the orderBy parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the ASC and DESC keywords for any field.

  • :include (Array<String>)

    Returns additional information about the group. The following optional fields can be requested: * parentIds * zones

  • :where (String)

    A string to restrict the returned objects by using a predicate.

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:



495
496
497
498
# File 'lib/alfresco_api/api/groups_api.rb', line 495

def list_groups(opts = {})
  data, _status_code, _headers = list_groups_with_http_info(opts)
  return data
end

#list_groups_with_http_info(opts = {}) ⇒ Array<(GroupPaging, Fixnum, Hash)>

List groups Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Gets a list of groups. You can use the include parameter to return additional information. You can use the where parameter to filter the returned groups by isRoot. For example, the following where clause will return just the root groups: &#x60;&#x60;&#x60; (isRoot&#x3D;true) &#x60;&#x60;&#x60; The where parameter can also be used to filter by ***zone***. This may be combined with isRoot to narrow a result set even further. For example, the following where clause will only return groups belonging to the &#x60;MY.ZONE&#x60; zone. &#x60;&#x60;&#x60; where&#x3D;(zones in (&#39;MY.ZONE&#39;)) &#x60;&#x60;&#x60; This may be combined with the isRoot filter, as shown below: &#x60;&#x60;&#x60; where&#x3D;(isRoot&#x3D;false AND zones in (&#39;MY.ZONE&#39;)) &#x60;&#x60;&#x60; ***Note:*** restrictions include * &#x60;AND&#x60; is the only supported operator when combining &#x60;isRoot&#x60; and &#x60;zones&#x60; filters * Only one zone is supported by the filter * The quoted zone name must be placed in parenthesis — a 400 error will result if these are omitted. The default sort order for the returned list is for groups to be sorted by ascending displayName. You can override the default by using the orderBy parameter. You can specify one of the following fields in the orderBy parameter: * id * displayName

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :skip_count (Integer)

    The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0.

  • :max_items (Integer)

    The maximum number of items to return in the list. If not supplied then the default value is 100.

  • :order_by (Array<String>)

    A string to control the order of the entities returned in a list. You can use the orderBy parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the ASC and DESC keywords for any field.

  • :include (Array<String>)

    Returns additional information about the group. The following optional fields can be requested: * parentIds * zones

  • :where (String)

    A string to restrict the returned objects by using a predicate.

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:

  • (Array<(GroupPaging, Fixnum, Hash)>)

    GroupPaging data, response status code and response headers



510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
# File 'lib/alfresco_api/api/groups_api.rb', line 510

def list_groups_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi.list_groups ..."
  end
  if @api_client.config.client_side_validation && !opts[:'skip_count'].nil? && opts[:'skip_count'] < 0
    fail ArgumentError, 'invalid value for "opts[:"skip_count"]" when calling GroupsApi.list_groups, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'max_items'].nil? && opts[:'max_items'] < 1
    fail ArgumentError, 'invalid value for "opts[:"max_items"]" when calling GroupsApi.list_groups, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/groups"

  # query parameters
  query_params = {}
  query_params[:'skipCount'] = opts[:'skip_count'] if !opts[:'skip_count'].nil?
  query_params[:'maxItems'] = opts[:'max_items'] if !opts[:'max_items'].nil?
  query_params[:'orderBy'] = @api_client.build_collection_param(opts[:'order_by'], :csv) if !opts[:'order_by'].nil?
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
  query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GroupPaging')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupsApi#list_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_group(group_id, group_body_update, opts = {}) ⇒ GroupEntry

Update group details Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Update details (displayName) for group groupId. You must have admin rights to update a group.

Parameters:

  • group_id

    The identifier of a group.

  • group_body_update

    The group information to update.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include (Array<String>)

    Returns additional information about the group. The following optional fields can be requested: * parentIds * zones

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:



568
569
570
571
# File 'lib/alfresco_api/api/groups_api.rb', line 568

def update_group(group_id, group_body_update, opts = {})
  data, _status_code, _headers = update_group_with_http_info(group_id, group_body_update, opts)
  return data
end

#update_group_with_http_info(group_id, group_body_update, opts = {}) ⇒ Array<(GroupEntry, Fixnum, Hash)>

Update group details Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Update details (displayName) for group groupId. You must have admin rights to update a group.

Parameters:

  • group_id

    The identifier of a group.

  • group_body_update

    The group information to update.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include (Array<String>)

    Returns additional information about the group. The following optional fields can be requested: * parentIds * zones

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:

  • (Array<(GroupEntry, Fixnum, Hash)>)

    GroupEntry data, response status code and response headers



581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
# File 'lib/alfresco_api/api/groups_api.rb', line 581

def update_group_with_http_info(group_id, group_body_update, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: GroupsApi.update_group ..."
  end
  # verify the required parameter 'group_id' is set
  if @api_client.config.client_side_validation && group_id.nil?
    fail ArgumentError, "Missing the required parameter 'group_id' when calling GroupsApi.update_group"
  end
  # verify the required parameter 'group_body_update' is set
  if @api_client.config.client_side_validation && group_body_update.nil?
    fail ArgumentError, "Missing the required parameter 'group_body_update' when calling GroupsApi.update_group"
  end
  # resource path
  local_var_path = "/groups/{groupId}".sub('{' + 'groupId' + '}', group_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(group_body_update)
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GroupEntry')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GroupsApi#update_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end