diff --git a/management/azure_mgmt_graph/lib/1.6/build.json b/management/azure_mgmt_graph/lib/1.6/build.json new file mode 100644 index 0000000000..3c6d7fd8cc --- /dev/null +++ b/management/azure_mgmt_graph/lib/1.6/build.json @@ -0,0 +1,225 @@ +{ + "autorest": [ + { + "resolvedInfo": null, + "packageMetadata": { + "name": "@microsoft.azure/autorest-core", + "version": "2.0.4168", + "engines": { + "node": ">=7.10.0" + }, + "dependencies": {}, + "optionalDependencies": {}, + "devDependencies": { + "@microsoft.azure/async-io": "~1.0.22", + "@microsoft.azure/extension": "~1.2.12", + "@types/commonmark": "^0.27.0", + "@types/jsonpath": "^0.1.29", + "@types/node": "^8.0.28", + "@types/pify": "0.0.28", + "@types/source-map": "^0.5.0", + "@types/yargs": "^8.0.2", + "commonmark": "^0.27.0", + "file-url": "^2.0.2", + "get-uri": "^2.0.0", + "jsonpath": "^0.2.11", + "linq-es2015": "^2.4.25", + "mocha": "3.4.2", + "mocha-typescript": "1.1.5", + "pify": "^3.0.0", + "safe-eval": "^0.3.0", + "shx": "^0.2.2", + "source-map": "^0.5.6", + "source-map-support": "^0.4.15", + "strip-bom": "^3.0.0", + "typescript": "2.5.3", + "untildify": "^3.0.2", + "urijs": "^1.18.10", + "vscode-jsonrpc": "^3.3.1", + "yaml-ast-parser": "https://github.com/olydis/yaml-ast-parser/releases/download/0.0.34/yaml-ast-parser-0.0.34.tgz", + "yargs": "^8.0.2" + }, + "bundleDependencies": false, + "peerDependencies": {}, + "deprecated": false, + "_resolved": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", + "_shasum": "33813111fc9bfa488bd600fbba48bc53cc9182c7", + "_shrinkwrap": null, + "bin": null, + "_id": "@microsoft.azure/autorest-core@2.0.4168", + "_from": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", + "_requested": { + "type": "directory", + "where": "/git-restapi", + "raw": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", + "rawSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", + "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", + "fetchSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core" + }, + "_spec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", + "_where": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core" + }, + "extensionManager": { + "installationPath": "/root/.autorest", + "dotnetPath": "/root/.dotnet" + }, + "installationPath": "/root/.autorest" + }, + { + "resolvedInfo": null, + "packageMetadata": { + "name": "@microsoft.azure/autorest.modeler", + "version": "2.0.21", + "dependencies": { + "dotnet-2.0.0": "^1.3.2" + }, + "optionalDependencies": {}, + "devDependencies": { + "coffee-script": "^1.11.1", + "dotnet-sdk-2.0.0": "^1.1.1", + "gulp": "^3.9.1", + "gulp-filter": "^5.0.0", + "gulp-line-ending-corrector": "^1.0.1", + "iced-coffee-script": "^108.0.11", + "marked": "^0.3.6", + "marked-terminal": "^2.0.0", + "moment": "^2.17.1", + "run-sequence": "*", + "shx": "^0.2.2", + "through2-parallel": "^0.1.3", + "yargs": "^8.0.2", + "yarn": "^1.0.2" + }, + "bundleDependencies": false, + "peerDependencies": {}, + "deprecated": false, + "_resolved": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", + "_shasum": "3ce7d3939124b31830be15e5de99b9b7768afb90", + "_shrinkwrap": null, + "bin": null, + "_id": "@microsoft.azure/autorest.modeler@2.0.21", + "_from": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", + "_requested": { + "type": "directory", + "where": "/git-restapi", + "raw": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", + "rawSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", + "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", + "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler" + }, + "_spec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", + "_where": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler" + }, + "extensionManager": { + "installationPath": "/root/.autorest", + "dotnetPath": "/root/.dotnet" + }, + "installationPath": "/root/.autorest" + }, + { + "resolvedInfo": null, + "packageMetadata": { + "name": "@microsoft.azure/autorest.modeler", + "version": "2.1.22", + "dependencies": { + "dotnet-2.0.0": "^1.4.4" + }, + "optionalDependencies": {}, + "devDependencies": { + "coffee-script": "^1.11.1", + "dotnet-sdk-2.0.0": "^1.4.4", + "gulp": "^3.9.1", + "gulp-filter": "^5.0.0", + "gulp-line-ending-corrector": "^1.0.1", + "iced-coffee-script": "^108.0.11", + "marked": "^0.3.6", + "marked-terminal": "^2.0.0", + "moment": "^2.17.1", + "run-sequence": "*", + "shx": "^0.2.2", + "through2-parallel": "^0.1.3", + "yargs": "^8.0.2", + "yarn": "^1.0.2" + }, + "bundleDependencies": false, + "peerDependencies": {}, + "deprecated": false, + "_resolved": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", + "_shasum": "ca425289fa38a210d279729048a4a91673f09c67", + "_shrinkwrap": null, + "bin": null, + "_id": "@microsoft.azure/autorest.modeler@2.1.22", + "_from": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", + "_requested": { + "type": "directory", + "where": "/git-restapi", + "raw": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", + "rawSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", + "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", + "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler" + }, + "_spec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", + "_where": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler" + }, + "extensionManager": { + "installationPath": "/root/.autorest", + "dotnetPath": "/root/.dotnet" + }, + "installationPath": "/root/.autorest" + }, + { + "resolvedInfo": null, + "packageMetadata": { + "name": "@microsoft.azure/autorest.ruby", + "version": "3.0.20", + "dependencies": { + "dotnet-2.0.0": "^1.4.4" + }, + "optionalDependencies": {}, + "devDependencies": { + "@microsoft.azure/autorest.testserver": "^1.9.2", + "autorest": "^2.0.0", + "coffee-script": "^1.11.1", + "dotnet-sdk-2.0.0": "^1.4.4", + "gulp": "^3.9.1", + "gulp-filter": "^5.0.0", + "gulp-line-ending-corrector": "^1.0.1", + "iced-coffee-script": "^108.0.11", + "marked": "^0.3.6", + "marked-terminal": "^2.0.0", + "moment": "^2.17.1", + "run-sequence": "*", + "shx": "^0.2.2", + "through2-parallel": "^0.1.3", + "yargs": "^8.0.2", + "yarn": "^1.0.2" + }, + "bundleDependencies": false, + "peerDependencies": {}, + "deprecated": false, + "_resolved": "/root/.autorest/@microsoft.azure_autorest.ruby@3.0.20/node_modules/@microsoft.azure/autorest.ruby", + "_shasum": "f5b24eb17914aad0e8d2da581642044a6088d905", + "_shrinkwrap": null, + "bin": null, + "_id": "@microsoft.azure/autorest.ruby@3.0.20", + "_from": "file:/root/.autorest/@microsoft.azure_autorest.ruby@3.0.20/node_modules/@microsoft.azure/autorest.ruby", + "_requested": { + "type": "directory", + "where": "/git-restapi", + "raw": "/root/.autorest/@microsoft.azure_autorest.ruby@3.0.20/node_modules/@microsoft.azure/autorest.ruby", + "rawSpec": "/root/.autorest/@microsoft.azure_autorest.ruby@3.0.20/node_modules/@microsoft.azure/autorest.ruby", + "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.ruby@3.0.20/node_modules/@microsoft.azure/autorest.ruby", + "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.ruby@3.0.20/node_modules/@microsoft.azure/autorest.ruby" + }, + "_spec": "/root/.autorest/@microsoft.azure_autorest.ruby@3.0.20/node_modules/@microsoft.azure/autorest.ruby", + "_where": "/root/.autorest/@microsoft.azure_autorest.ruby@3.0.20/node_modules/@microsoft.azure/autorest.ruby" + }, + "extensionManager": { + "installationPath": "/root/.autorest", + "dotnetPath": "/root/.dotnet" + }, + "installationPath": "/root/.autorest" + } + ], + "autorest_bootstrap": {} +} \ No newline at end of file diff --git a/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph.rb b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph.rb index 1507b7f7f9..a9c98c4f09 100644 --- a/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph.rb +++ b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph.rb @@ -29,41 +29,44 @@ module Azure::Graph::Mgmt::V1_6 autoload :GraphRbacManagementClient, '1.6/generated/azure_mgmt_graph/graph_rbac_management_client.rb' module Models - autoload :GroupGetMemberGroupsParameters, '1.6/generated/azure_mgmt_graph/models/group_get_member_groups_parameters.rb' + autoload :GroupAddMemberParameters, '1.6/generated/azure_mgmt_graph/models/group_add_member_parameters.rb' autoload :GraphError, '1.6/generated/azure_mgmt_graph/models/graph_error.rb' + autoload :GroupCreateParameters, '1.6/generated/azure_mgmt_graph/models/group_create_parameters.rb' + autoload :KeyCredential, '1.6/generated/azure_mgmt_graph/models/key_credential.rb' + autoload :ResourceAccess, '1.6/generated/azure_mgmt_graph/models/resource_access.rb' + autoload :GroupListResult, '1.6/generated/azure_mgmt_graph/models/group_list_result.rb' + autoload :ApplicationCreateParameters, '1.6/generated/azure_mgmt_graph/models/application_create_parameters.rb' + autoload :GroupGetMemberGroupsParameters, '1.6/generated/azure_mgmt_graph/models/group_get_member_groups_parameters.rb' + autoload :UserGetMemberGroupsResult, '1.6/generated/azure_mgmt_graph/models/user_get_member_groups_result.rb' + autoload :ApplicationListResult, '1.6/generated/azure_mgmt_graph/models/application_list_result.rb' autoload :GroupGetMemberGroupsResult, '1.6/generated/azure_mgmt_graph/models/group_get_member_groups_result.rb' - autoload :PasswordCredential, '1.6/generated/azure_mgmt_graph/models/password_credential.rb' + autoload :KeyCredentialListResult, '1.6/generated/azure_mgmt_graph/models/key_credential_list_result.rb' autoload :CheckGroupMembershipParameters, '1.6/generated/azure_mgmt_graph/models/check_group_membership_parameters.rb' - autoload :RequiredResourceAccess, '1.6/generated/azure_mgmt_graph/models/required_resource_access.rb' + autoload :KeyCredentialsUpdateParameters, '1.6/generated/azure_mgmt_graph/models/key_credentials_update_parameters.rb' autoload :CheckGroupMembershipResult, '1.6/generated/azure_mgmt_graph/models/check_group_membership_result.rb' - autoload :ApplicationUpdateParameters, '1.6/generated/azure_mgmt_graph/models/application_update_parameters.rb' + autoload :PasswordCredentialsUpdateParameters, '1.6/generated/azure_mgmt_graph/models/password_credentials_update_parameters.rb' autoload :ServicePrincipalCreateParameters, '1.6/generated/azure_mgmt_graph/models/service_principal_create_parameters.rb' - autoload :ApplicationListResult, '1.6/generated/azure_mgmt_graph/models/application_list_result.rb' - autoload :ServicePrincipal, '1.6/generated/azure_mgmt_graph/models/service_principal.rb' - autoload :KeyCredentialsUpdateParameters, '1.6/generated/azure_mgmt_graph/models/key_credentials_update_parameters.rb' + autoload :GetObjectsResult, '1.6/generated/azure_mgmt_graph/models/get_objects_result.rb' + autoload :DomainListResult, '1.6/generated/azure_mgmt_graph/models/domain_list_result.rb' + autoload :PasswordCredential, '1.6/generated/azure_mgmt_graph/models/password_credential.rb' autoload :ServicePrincipalListResult, '1.6/generated/azure_mgmt_graph/models/service_principal_list_result.rb' - autoload :PasswordCredentialsUpdateParameters, '1.6/generated/azure_mgmt_graph/models/password_credentials_update_parameters.rb' + autoload :ApplicationUpdateParameters, '1.6/generated/azure_mgmt_graph/models/application_update_parameters.rb' autoload :PasswordProfile, '1.6/generated/azure_mgmt_graph/models/password_profile.rb' - autoload :GetObjectsResult, '1.6/generated/azure_mgmt_graph/models/get_objects_result.rb' + autoload :DirectoryObjectListResult, '1.6/generated/azure_mgmt_graph/models/directory_object_list_result.rb' autoload :UserBase, '1.6/generated/azure_mgmt_graph/models/user_base.rb' - autoload :GroupCreateParameters, '1.6/generated/azure_mgmt_graph/models/group_create_parameters.rb' - autoload :GroupAddMemberParameters, '1.6/generated/azure_mgmt_graph/models/group_add_member_parameters.rb' - autoload :ADGroup, '1.6/generated/azure_mgmt_graph/models/adgroup.rb' - autoload :KeyCredential, '1.6/generated/azure_mgmt_graph/models/key_credential.rb' - autoload :ApplicationCreateParameters, '1.6/generated/azure_mgmt_graph/models/application_create_parameters.rb' - autoload :DomainListResult, '1.6/generated/azure_mgmt_graph/models/domain_list_result.rb' - autoload :KeyCredentialListResult, '1.6/generated/azure_mgmt_graph/models/key_credential_list_result.rb' - autoload :SignInName, '1.6/generated/azure_mgmt_graph/models/sign_in_name.rb' autoload :AADObject, '1.6/generated/azure_mgmt_graph/models/aadobject.rb' autoload :Domain, '1.6/generated/azure_mgmt_graph/models/domain.rb' - autoload :ResourceAccess, '1.6/generated/azure_mgmt_graph/models/resource_access.rb' - autoload :UserGetMemberGroupsParameters, '1.6/generated/azure_mgmt_graph/models/user_get_member_groups_parameters.rb' + autoload :RequiredResourceAccess, '1.6/generated/azure_mgmt_graph/models/required_resource_access.rb' + autoload :GetObjectsParameters, '1.6/generated/azure_mgmt_graph/models/get_objects_parameters.rb' autoload :PasswordCredentialListResult, '1.6/generated/azure_mgmt_graph/models/password_credential_list_result.rb' - autoload :UserGetMemberGroupsResult, '1.6/generated/azure_mgmt_graph/models/user_get_member_groups_result.rb' - autoload :Application, '1.6/generated/azure_mgmt_graph/models/application.rb' + autoload :SignInName, '1.6/generated/azure_mgmt_graph/models/sign_in_name.rb' + autoload :ApplicationAddOwnerParameters, '1.6/generated/azure_mgmt_graph/models/application_add_owner_parameters.rb' autoload :UserListResult, '1.6/generated/azure_mgmt_graph/models/user_list_result.rb' - autoload :GroupListResult, '1.6/generated/azure_mgmt_graph/models/group_list_result.rb' - autoload :GetObjectsParameters, '1.6/generated/azure_mgmt_graph/models/get_objects_parameters.rb' + autoload :DirectoryObject, '1.6/generated/azure_mgmt_graph/models/directory_object.rb' + autoload :UserGetMemberGroupsParameters, '1.6/generated/azure_mgmt_graph/models/user_get_member_groups_parameters.rb' + autoload :Application, '1.6/generated/azure_mgmt_graph/models/application.rb' + autoload :ADGroup, '1.6/generated/azure_mgmt_graph/models/adgroup.rb' + autoload :ServicePrincipal, '1.6/generated/azure_mgmt_graph/models/service_principal.rb' autoload :UserCreateParameters, '1.6/generated/azure_mgmt_graph/models/user_create_parameters.rb' autoload :UserUpdateParameters, '1.6/generated/azure_mgmt_graph/models/user_update_parameters.rb' autoload :User, '1.6/generated/azure_mgmt_graph/models/user.rb' diff --git a/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/applications.rb b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/applications.rb index a9990daacc..42264a8025 100644 --- a/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/applications.rb +++ b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/applications.rb @@ -258,8 +258,7 @@ def delete_async(application_object_id, custom_headers = nil) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'applicationObjectId' => application_object_id}, + path_params: {'applicationObjectId' => application_object_id,'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -336,8 +335,7 @@ def get_async(application_object_id, custom_headers = nil) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'applicationObjectId' => application_object_id}, + path_params: {'applicationObjectId' => application_object_id,'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -438,8 +436,7 @@ def patch_async(application_object_id, parameters, custom_headers = nil) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'applicationObjectId' => application_object_id}, + path_params: {'applicationObjectId' => application_object_id,'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), @@ -464,6 +461,203 @@ def patch_async(application_object_id, parameters, custom_headers = nil) promise.execute end + # + # Directory objects that are owners of the application. + # + # The owners are a set of non-admin users who are allowed to modify this + # object. + # + # @param application_object_id [String] The object ID of the application for + # which to get owners. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DirectoryObjectListResult] operation results. + # + def list_owners(application_object_id, custom_headers = nil) + response = list_owners_async(application_object_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Directory objects that are owners of the application. + # + # The owners are a set of non-admin users who are allowed to modify this + # object. + # + # @param application_object_id [String] The object ID of the application for + # which to get owners. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_owners_with_http_info(application_object_id, custom_headers = nil) + list_owners_async(application_object_id, custom_headers).value! + end + + # + # Directory objects that are owners of the application. + # + # The owners are a set of non-admin users who are allowed to modify this + # object. + # + # @param application_object_id [String] The object ID of the application for + # which to get owners. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_owners_async(application_object_id, custom_headers = nil) + fail ArgumentError, 'application_object_id is nil' if application_object_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{tenantID}/applications/{applicationObjectId}/owners' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'applicationObjectId' => application_object_id,'tenantID' => @client.tenant_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Graph::Mgmt::V1_6::Models::DirectoryObjectListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Add an owner to an application. + # + # @param application_object_id [String] The object ID of the application to + # which to add the owner. + # @param parameters [ApplicationAddOwnerParameters] The URL of the owner + # object, such as + # https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def add_owner(application_object_id, parameters, custom_headers = nil) + response = add_owner_async(application_object_id, parameters, custom_headers).value! + nil + end + + # + # Add an owner to an application. + # + # @param application_object_id [String] The object ID of the application to + # which to add the owner. + # @param parameters [ApplicationAddOwnerParameters] The URL of the owner + # object, such as + # https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def add_owner_with_http_info(application_object_id, parameters, custom_headers = nil) + add_owner_async(application_object_id, parameters, custom_headers).value! + end + + # + # Add an owner to an application. + # + # @param application_object_id [String] The object ID of the application to + # which to add the owner. + # @param parameters [ApplicationAddOwnerParameters] The URL of the owner + # object, such as + # https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def add_owner_async(application_object_id, parameters, custom_headers = nil) + fail ArgumentError, 'application_object_id is nil' if application_object_id.nil? + fail ArgumentError, 'parameters is nil' if parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::Graph::Mgmt::V1_6::Models::ApplicationAddOwnerParameters.mapper() + request_content = @client.serialize(request_mapper, parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = '{tenantID}/applications/{applicationObjectId}/$links/owners' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'applicationObjectId' => application_object_id,'tenantID' => @client.tenant_id}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 204 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + + result + end + + promise.execute + end + # # Get the keyCredentials associated with an application. # @@ -517,8 +711,7 @@ def list_key_credentials_async(application_object_id, custom_headers = nil) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'applicationObjectId' => application_object_id}, + path_params: {'applicationObjectId' => application_object_id,'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -619,8 +812,7 @@ def update_key_credentials_async(application_object_id, parameters, custom_heade options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'applicationObjectId' => application_object_id}, + path_params: {'applicationObjectId' => application_object_id,'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), @@ -698,8 +890,7 @@ def list_password_credentials_async(application_object_id, custom_headers = nil) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'applicationObjectId' => application_object_id}, + path_params: {'applicationObjectId' => application_object_id,'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -800,8 +991,7 @@ def update_password_credentials_async(application_object_id, parameters, custom_ options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'applicationObjectId' => application_object_id}, + path_params: {'applicationObjectId' => application_object_id,'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), diff --git a/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/groups.rb b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/groups.rb index c0e486a147..497ddc9476 100644 --- a/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/groups.rb +++ b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/groups.rb @@ -182,8 +182,7 @@ def remove_member_async(group_object_id, member_object_id, custom_headers = nil) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'groupObjectId' => group_object_id,'memberObjectId' => member_object_id}, + path_params: {'groupObjectId' => group_object_id,'memberObjectId' => member_object_id,'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -280,8 +279,7 @@ def add_member_async(group_object_id, parameters, custom_headers = nil) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'groupObjectId' => group_object_id}, + path_params: {'groupObjectId' => group_object_id,'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), @@ -306,83 +304,6 @@ def add_member_async(group_object_id, parameters, custom_headers = nil) promise.execute end - # - # Delete a group from the directory. - # - # @param group_object_id [String] The object ID of the group to delete. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # - def delete(group_object_id, custom_headers = nil) - response = delete_async(group_object_id, custom_headers).value! - nil - end - - # - # Delete a group from the directory. - # - # @param group_object_id [String] The object ID of the group to delete. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [MsRestAzure::AzureOperationResponse] HTTP response information. - # - def delete_with_http_info(group_object_id, custom_headers = nil) - delete_async(group_object_id, custom_headers).value! - end - - # - # Delete a group from the directory. - # - # @param group_object_id [String] The object ID of the group to delete. - # @param [Hash{String => String}] A hash of custom headers that will be added - # to the HTTP request. - # - # @return [Concurrent::Promise] Promise object which holds the HTTP response. - # - def delete_async(group_object_id, custom_headers = nil) - fail ArgumentError, 'group_object_id is nil' if group_object_id.nil? - fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? - fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil? - - - request_headers = {} - - # Set Headers - request_headers['x-ms-client-request-id'] = SecureRandom.uuid - request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? - path_template = '{tenantID}/groups/{groupObjectId}' - - request_url = @base_url || @client.base_url - - options = { - middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'groupObjectId' => group_object_id}, - query_params: {'api-version' => @client.api_version}, - headers: request_headers.merge(custom_headers || {}), - base_url: request_url - } - promise = @client.make_request_async(:delete, path_template, options) - - promise = promise.then do |result| - http_response = result.response - status_code = http_response.status - response_content = http_response.body - unless status_code == 204 - error_model = JSON.load(response_content) - fail MsRest::HttpOperationError.new(result.request, http_response, error_model) - end - - result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? - - result - end - - promise.execute - end - # # Create a group in the directory. # @@ -624,8 +545,7 @@ def get_group_members_async(object_id, custom_headers = nil) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'objectId' => object_id}, + path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -715,8 +635,7 @@ def get_async(object_id, custom_headers = nil) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'objectId' => object_id}, + path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -750,6 +669,82 @@ def get_async(object_id, custom_headers = nil) promise.execute end + # + # Delete a group from the directory. + # + # @param object_id [String] The object ID of the group to delete. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(object_id, custom_headers = nil) + response = delete_async(object_id, custom_headers).value! + nil + end + + # + # Delete a group from the directory. + # + # @param object_id [String] The object ID of the group to delete. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def delete_with_http_info(object_id, custom_headers = nil) + delete_async(object_id, custom_headers).value! + end + + # + # Delete a group from the directory. + # + # @param object_id [String] The object ID of the group to delete. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def delete_async(object_id, custom_headers = nil) + fail ArgumentError, 'object_id is nil' if object_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{tenantID}/groups/{objectId}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 204 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + + result + end + + promise.execute + end + # # Gets a collection of object IDs of groups of which the specified group is a # member. @@ -824,8 +819,7 @@ def get_member_groups_async(object_id, parameters, custom_headers = nil) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'objectId' => object_id}, + path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), diff --git a/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/adgroup.rb b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/adgroup.rb index f750a22e6d..aa660c54d2 100644 --- a/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/adgroup.rb +++ b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/adgroup.rb @@ -8,15 +8,16 @@ module Models # # Active Directory group information. # - class ADGroup + class ADGroup < DirectoryObject include MsRestAzure - # @return [String] The object ID. - attr_accessor :object_id - # @return [String] The object type. - attr_accessor :object_type + def initialize + @objectType = "Group" + end + + attr_accessor :objectType # @return [String] The display name of the group. attr_accessor :display_name @@ -35,20 +36,29 @@ class ADGroup def self.mapper() { required: false, - serialized_name: 'ADGroup', + serialized_name: 'Group', type: { name: 'Composite', class_name: 'ADGroup', model_properties: { object_id: { required: false, + read_only: true, serialized_name: 'objectId', type: { name: 'String' } }, - object_type: { + deletion_timestamp: { required: false, + read_only: true, + serialized_name: 'deletionTimestamp', + type: { + name: 'DateTime' + } + }, + objectType: { + required: true, serialized_name: 'objectType', type: { name: 'String' diff --git a/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/application.rb b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/application.rb index 2cef0c3c2c..8f2f8423f4 100644 --- a/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/application.rb +++ b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/application.rb @@ -8,15 +8,16 @@ module Models # # Active Directory application information. # - class Application + class Application < DirectoryObject include MsRestAzure - # @return [String] The object ID. - attr_accessor :object_id - # @return [String] The object type. - attr_accessor :object_type + def initialize + @objectType = "Application" + end + + attr_accessor :objectType # @return [String] The application ID. attr_accessor :app_id @@ -58,13 +59,22 @@ def self.mapper() model_properties: { object_id: { required: false, + read_only: true, serialized_name: 'objectId', type: { name: 'String' } }, - object_type: { + deletion_timestamp: { required: false, + read_only: true, + serialized_name: 'deletionTimestamp', + type: { + name: 'DateTime' + } + }, + objectType: { + required: true, serialized_name: 'objectType', type: { name: 'String' diff --git a/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/application_add_owner_parameters.rb b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/application_add_owner_parameters.rb new file mode 100644 index 0000000000..9d4cf1659f --- /dev/null +++ b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/application_add_owner_parameters.rb @@ -0,0 +1,48 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Graph::Mgmt::V1_6 + module Models + # + # Request parameters for adding a owner to an application. + # + class ApplicationAddOwnerParameters + + include MsRestAzure + + # @return [String] A owner object URL, such as + # "https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd", + # where "0b1f9851-1bf0-433f-aec3-cb9272f093dc" is the tenantId and + # "f260bbc4-c254-447b-94cf-293b5ec434dd" is the objectId of the owner + # (user, application, servicePrincipal, group) to be added. + attr_accessor :url + + + # + # Mapper for ApplicationAddOwnerParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ApplicationAddOwnerParameters', + type: { + name: 'Composite', + class_name: 'ApplicationAddOwnerParameters', + model_properties: { + url: { + required: true, + serialized_name: 'url', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/directory_object.rb b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/directory_object.rb new file mode 100644 index 0000000000..f7d7cf25a3 --- /dev/null +++ b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/directory_object.rb @@ -0,0 +1,70 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Graph::Mgmt::V1_6 + module Models + # + # Represents an Azure Active Directory object. + # + class DirectoryObject + + include MsRestAzure + + @@discriminatorMap = Hash.new + @@discriminatorMap["Application"] = "Application" + @@discriminatorMap["Group"] = "ADGroup" + @@discriminatorMap["ServicePrincipal"] = "ServicePrincipal" + @@discriminatorMap["User"] = "User" + + def initialize + @objectType = "DirectoryObject" + end + + attr_accessor :objectType + + # @return [String] The object ID. + attr_accessor :object_id + + # @return [DateTime] The time at which the directory object was deleted. + attr_accessor :deletion_timestamp + + + # + # Mapper for DirectoryObject class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'DirectoryObject', + type: { + name: 'Composite', + polymorphic_discriminator: 'objectType', + uber_parent: 'DirectoryObject', + class_name: 'DirectoryObject', + model_properties: { + object_id: { + required: false, + read_only: true, + serialized_name: 'objectId', + type: { + name: 'String' + } + }, + deletion_timestamp: { + required: false, + read_only: true, + serialized_name: 'deletionTimestamp', + type: { + name: 'DateTime' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/directory_object_list_result.rb b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/directory_object_list_result.rb new file mode 100644 index 0000000000..668b8eed06 --- /dev/null +++ b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/directory_object_list_result.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::Graph::Mgmt::V1_6 + module Models + # + # DirectoryObject list operation result. + # + class DirectoryObjectListResult + + include MsRestAzure + + # @return [Array] A collection of DirectoryObject. + attr_accessor :value + + + # + # Mapper for DirectoryObjectListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'DirectoryObjectListResult', + type: { + name: 'Composite', + class_name: 'DirectoryObjectListResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'DirectoryObjectElementType', + type: { + name: 'Composite', + polymorphic_discriminator: 'objectType', + uber_parent: 'DirectoryObject', + class_name: 'DirectoryObject' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/service_principal.rb b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/service_principal.rb index 09ab4270f9..00931d4632 100644 --- a/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/service_principal.rb +++ b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/service_principal.rb @@ -8,15 +8,16 @@ module Models # # Active Directory service principal information. # - class ServicePrincipal + class ServicePrincipal < DirectoryObject include MsRestAzure - # @return [String] The object ID. - attr_accessor :object_id - # @return [String] The object type. - attr_accessor :object_type + def initialize + @objectType = "ServicePrincipal" + end + + attr_accessor :objectType # @return [String] The display name of the service principal. attr_accessor :display_name @@ -42,13 +43,22 @@ def self.mapper() model_properties: { object_id: { required: false, + read_only: true, serialized_name: 'objectId', type: { name: 'String' } }, - object_type: { + deletion_timestamp: { required: false, + read_only: true, + serialized_name: 'deletionTimestamp', + type: { + name: 'DateTime' + } + }, + objectType: { + required: true, serialized_name: 'objectType', type: { name: 'String' diff --git a/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/user.rb b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/user.rb index 6d86b2ff73..888872c898 100644 --- a/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/user.rb +++ b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/models/user.rb @@ -8,10 +8,40 @@ module Models # # Active Directory user information. # - class User < UserBase + class User < DirectoryObject include MsRestAzure + + def initialize + @objectType = "User" + end + + attr_accessor :objectType + + # @return [String] This must be specified if you are using a federated + # domain for the user's userPrincipalName (UPN) property when creating a + # new user account. It is used to associate an on-premises Active + # Directory user account with their Azure AD user object. + attr_accessor :immutable_id + + # @return [String] A two letter country code (ISO standard 3166). + # Required for users that will be assigned licenses due to legal + # requirement to check for availability of services in countries. + # Examples include: "US", "JP", and "GB". + attr_accessor :usage_location + + # @return [String] The given name for the user. + attr_accessor :given_name + + # @return [String] The user's surname (family name or last name). + attr_accessor :surname + + # @return [UserType] A string value that can be used to classify user + # types in your directory, such as 'Member' and 'Guest'. Possible values + # include: 'Member', 'Guest' + attr_accessor :user_type + # @return [Boolean] Whether the account is enabled. attr_accessor :account_enabled @@ -27,12 +57,6 @@ class User < UserBase # @return [String] The primary email address of the user. attr_accessor :mail - # @return [String] The object ID. - attr_accessor :object_id - - # @return [String] The object type. - attr_accessor :object_type - # @return [Array] The sign-in names of the user. attr_accessor :sign_in_names @@ -49,6 +73,29 @@ def self.mapper() name: 'Composite', class_name: 'User', model_properties: { + object_id: { + required: false, + read_only: true, + serialized_name: 'objectId', + type: { + name: 'String' + } + }, + deletion_timestamp: { + required: false, + read_only: true, + serialized_name: 'deletionTimestamp', + type: { + name: 'DateTime' + } + }, + objectType: { + required: true, + serialized_name: 'objectType', + type: { + name: 'String' + } + }, immutable_id: { required: false, serialized_name: 'immutableId', @@ -119,20 +166,6 @@ def self.mapper() name: 'String' } }, - object_id: { - required: false, - serialized_name: 'objectId', - type: { - name: 'String' - } - }, - object_type: { - required: false, - serialized_name: 'objectType', - type: { - name: 'String' - } - }, sign_in_names: { required: false, serialized_name: 'signInNames', diff --git a/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/service_principals.rb b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/service_principals.rb index 075b279a96..68c4873bee 100644 --- a/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/service_principals.rb +++ b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/service_principals.rb @@ -258,8 +258,7 @@ def delete_async(object_id, custom_headers = nil) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'objectId' => object_id}, + path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -336,8 +335,7 @@ def get_async(object_id, custom_headers = nil) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'objectId' => object_id}, + path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -371,6 +369,105 @@ def get_async(object_id, custom_headers = nil) promise.execute end + # + # Directory objects that are owners of this service principal. + # + # The owners are a set of non-admin users who are allowed to modify this + # object. + # + # @param object_id [String] The object ID of the service principal for which to + # get owners. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DirectoryObjectListResult] operation results. + # + def list_owners(object_id, custom_headers = nil) + response = list_owners_async(object_id, custom_headers).value! + response.body unless response.nil? + end + + # + # Directory objects that are owners of this service principal. + # + # The owners are a set of non-admin users who are allowed to modify this + # object. + # + # @param object_id [String] The object ID of the service principal for which to + # get owners. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_owners_with_http_info(object_id, custom_headers = nil) + list_owners_async(object_id, custom_headers).value! + end + + # + # Directory objects that are owners of this service principal. + # + # The owners are a set of non-admin users who are allowed to modify this + # object. + # + # @param object_id [String] The object ID of the service principal for which to + # get owners. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_owners_async(object_id, custom_headers = nil) + fail ArgumentError, 'object_id is nil' if object_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{tenantID}/servicePrincipals/{objectId}/owners' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::Graph::Mgmt::V1_6::Models::DirectoryObjectListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + # # Get the keyCredentials associated with the specified service principal. # @@ -427,8 +524,7 @@ def list_key_credentials_async(object_id, custom_headers = nil) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'objectId' => object_id}, + path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -532,8 +628,7 @@ def update_key_credentials_async(object_id, parameters, custom_headers = nil) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'objectId' => object_id}, + path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), @@ -611,8 +706,7 @@ def list_password_credentials_async(object_id, custom_headers = nil) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'objectId' => object_id}, + path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -713,8 +807,7 @@ def update_password_credentials_async(object_id, parameters, custom_headers = ni options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'objectId' => object_id}, + path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), diff --git a/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/users.rb b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/users.rb index 541967ff8d..14977ca79a 100644 --- a/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/users.rb +++ b/management/azure_mgmt_graph/lib/1.6/generated/azure_mgmt_graph/users.rb @@ -259,8 +259,7 @@ def get_async(upn_or_object_id, custom_headers = nil) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'upnOrObjectId' => upn_or_object_id}, + path_params: {'upnOrObjectId' => upn_or_object_id,'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -364,8 +363,7 @@ def update_async(upn_or_object_id, parameters, custom_headers = nil) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'upnOrObjectId' => upn_or_object_id}, + path_params: {'upnOrObjectId' => upn_or_object_id,'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), @@ -445,8 +443,7 @@ def delete_async(upn_or_object_id, custom_headers = nil) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'upnOrObjectId' => upn_or_object_id}, + path_params: {'upnOrObjectId' => upn_or_object_id,'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -541,8 +538,7 @@ def get_member_groups_async(object_id, parameters, custom_headers = nil) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'tenantID' => @client.tenant_id}, - skip_encoding_path_params: {'objectId' => object_id}, + path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}),