Class: MicrosoftGraph::Policies::PoliciesRequestBuilder

Inherits:
MicrosoftKiotaAbstractions::BaseRequestBuilder
  • Object
show all
Defined in:
lib/policies/policies_request_builder.rb

Overview

Provides operations to manage the policyRoot singleton.

Defined Under Namespace

Classes: PoliciesRequestBuilderGetQueryParameters

Instance Method Summary collapse

Constructor Details

#initialize(path_parameters, request_adapter) ⇒ Object

Instantiates a new PoliciesRequestBuilder and sets the default values.

Parameters:

  • path_parameters —

    Path parameters for the request

  • request_adapter —

    The request adapter to use to execute the requests.



133
134
135
# File 'lib/policies/policies_request_builder.rb', line 133

def initialize(path_parameters, request_adapter)
    super(path_parameters, request_adapter, "{+baseurl}/policies{?%24select,%24expand}")
end

Instance Method Details

#activity_based_timeout_policies ⇒ Object

Provides operations to manage the activityBasedTimeoutPolicies property of the microsoft.graph.policyRoot entity.



34
35
36
# File 'lib/policies/policies_request_builder.rb', line 34

def activity_based_timeout_policies()
    return MicrosoftGraph::Policies::ActivityBasedTimeoutPolicies::ActivityBasedTimeoutPoliciesRequestBuilder.new(@path_parameters, @request_adapter)
end

Provides operations to manage the adminConsentRequestPolicy property of the microsoft.graph.policyRoot entity.



39
40
41
# File 'lib/policies/policies_request_builder.rb', line 39

def admin_consent_request_policy()
    return MicrosoftGraph::Policies::AdminConsentRequestPolicy::AdminConsentRequestPolicyRequestBuilder.new(@path_parameters, @request_adapter)
end

#app_management_policies ⇒ Object

Provides operations to manage the appManagementPolicies property of the microsoft.graph.policyRoot entity.



44
45
46
# File 'lib/policies/policies_request_builder.rb', line 44

def app_management_policies()
    return MicrosoftGraph::Policies::AppManagementPolicies::AppManagementPoliciesRequestBuilder.new(@path_parameters, @request_adapter)
end

#authentication_flows_policy ⇒ Object

Provides operations to manage the authenticationFlowsPolicy property of the microsoft.graph.policyRoot entity.



49
50
51
# File 'lib/policies/policies_request_builder.rb', line 49

def authentication_flows_policy()
    return MicrosoftGraph::Policies::AuthenticationFlowsPolicy::AuthenticationFlowsPolicyRequestBuilder.new(@path_parameters, @request_adapter)
end

#authentication_methods_policy ⇒ Object

Provides operations to manage the authenticationMethodsPolicy property of the microsoft.graph.policyRoot entity.



54
55
56
# File 'lib/policies/policies_request_builder.rb', line 54

def authentication_methods_policy()
    return MicrosoftGraph::Policies::AuthenticationMethodsPolicy::AuthenticationMethodsPolicyRequestBuilder.new(@path_parameters, @request_adapter)
end

#authentication_strength_policies ⇒ Object

Provides operations to manage the authenticationStrengthPolicies property of the microsoft.graph.policyRoot entity.



59
60
61
# File 'lib/policies/policies_request_builder.rb', line 59

def authentication_strength_policies()
    return MicrosoftGraph::Policies::AuthenticationStrengthPolicies::AuthenticationStrengthPoliciesRequestBuilder.new(@path_parameters, @request_adapter)
end

#authorization_policy ⇒ Object

Provides operations to manage the authorizationPolicy property of the microsoft.graph.policyRoot entity.



64
65
66
# File 'lib/policies/policies_request_builder.rb', line 64

def authorization_policy()
    return MicrosoftGraph::Policies::AuthorizationPolicy::AuthorizationPolicyRequestBuilder.new(@path_parameters, @request_adapter)
end

#claims_mapping_policies ⇒ Object

Provides operations to manage the claimsMappingPolicies property of the microsoft.graph.policyRoot entity.



69
70
71
# File 'lib/policies/policies_request_builder.rb', line 69

def claims_mapping_policies()
    return MicrosoftGraph::Policies::ClaimsMappingPolicies::ClaimsMappingPoliciesRequestBuilder.new(@path_parameters, @request_adapter)
end

#conditional_access_policies ⇒ Object

Provides operations to manage the conditionalAccessPolicies property of the microsoft.graph.policyRoot entity.



74
75
76
# File 'lib/policies/policies_request_builder.rb', line 74

def conditional_access_policies()
    return MicrosoftGraph::Policies::ConditionalAccessPolicies::ConditionalAccessPoliciesRequestBuilder.new(@path_parameters, @request_adapter)
end

#cross_tenant_access_policy ⇒ Object

Provides operations to manage the crossTenantAccessPolicy property of the microsoft.graph.policyRoot entity.



79
80
81
# File 'lib/policies/policies_request_builder.rb', line 79

def cross_tenant_access_policy()
    return MicrosoftGraph::Policies::CrossTenantAccessPolicy::CrossTenantAccessPolicyRequestBuilder.new(@path_parameters, @request_adapter)
end

#default_app_management_policy ⇒ Object

Provides operations to manage the defaultAppManagementPolicy property of the microsoft.graph.policyRoot entity.



84
85
86
# File 'lib/policies/policies_request_builder.rb', line 84

def default_app_management_policy()
    return MicrosoftGraph::Policies::DefaultAppManagementPolicy::DefaultAppManagementPolicyRequestBuilder.new(@path_parameters, @request_adapter)
end

#feature_rollout_policies ⇒ Object

Provides operations to manage the featureRolloutPolicies property of the microsoft.graph.policyRoot entity.



89
90
91
# File 'lib/policies/policies_request_builder.rb', line 89

def feature_rollout_policies()
    return MicrosoftGraph::Policies::FeatureRolloutPolicies::FeatureRolloutPoliciesRequestBuilder.new(@path_parameters, @request_adapter)
end

#get(request_configuration = nil) ⇒ Object

Get policies

Parameters:

  • request_configuration (defaults to: nil) —

    Configuration for the request such as headers, query parameters, and middleware options.

Returns:

  • a Fiber of policy_root



141
142
143
144
145
146
147
148
149
# File 'lib/policies/policies_request_builder.rb', line 141

def get(request_configuration=nil)
    request_info = self.to_get_request_information(
        request_configuration
    )
    error_mapping = Hash.new
    error_mapping["4XX"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }
    error_mapping["5XX"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }
    return @request_adapter.send_async(request_info, lambda {|pn| MicrosoftGraph::Models::PolicyRoot.create_from_discriminator_value(pn) }, error_mapping)
end

#home_realm_discovery_policies ⇒ Object

Provides operations to manage the homeRealmDiscoveryPolicies property of the microsoft.graph.policyRoot entity.



94
95
96
# File 'lib/policies/policies_request_builder.rb', line 94

def home_realm_discovery_policies()
    return MicrosoftGraph::Policies::HomeRealmDiscoveryPolicies::HomeRealmDiscoveryPoliciesRequestBuilder.new(@path_parameters, @request_adapter)
end

#identity_security_defaults_enforcement_policy ⇒ Object

Provides operations to manage the identitySecurityDefaultsEnforcementPolicy property of the microsoft.graph.policyRoot entity.



99
100
101
# File 'lib/policies/policies_request_builder.rb', line 99

def identity_security_defaults_enforcement_policy()
    return MicrosoftGraph::Policies::IdentitySecurityDefaultsEnforcementPolicy::IdentitySecurityDefaultsEnforcementPolicyRequestBuilder.new(@path_parameters, @request_adapter)
end

#patch(body, request_configuration = nil) ⇒ Object

Update policies

Parameters:

  • body —

    The request body

  • request_configuration (defaults to: nil) —

    Configuration for the request such as headers, query parameters, and middleware options.

Returns:

  • a Fiber of policy_root

Raises:

  • (StandardError)


156
157
158
159
160
161
162
163
164
165
# File 'lib/policies/policies_request_builder.rb', line 156

def patch(body, request_configuration=nil)
    raise StandardError, 'body cannot be null' if body.nil?
    request_info = self.to_patch_request_information(
        body, request_configuration
    )
    error_mapping = Hash.new
    error_mapping["4XX"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }
    error_mapping["5XX"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }
    return @request_adapter.send_async(request_info, lambda {|pn| MicrosoftGraph::Models::PolicyRoot.create_from_discriminator_value(pn) }, error_mapping)
end

#permission_grant_policies ⇒ Object

Provides operations to manage the permissionGrantPolicies property of the microsoft.graph.policyRoot entity.



104
105
106
# File 'lib/policies/policies_request_builder.rb', line 104

def permission_grant_policies()
    return MicrosoftGraph::Policies::PermissionGrantPolicies::PermissionGrantPoliciesRequestBuilder.new(@path_parameters, @request_adapter)
end

#role_management_policies ⇒ Object

Provides operations to manage the roleManagementPolicies property of the microsoft.graph.policyRoot entity.



109
110
111
# File 'lib/policies/policies_request_builder.rb', line 109

def role_management_policies()
    return MicrosoftGraph::Policies::RoleManagementPolicies::RoleManagementPoliciesRequestBuilder.new(@path_parameters, @request_adapter)
end

#role_management_policy_assignments ⇒ Object

Provides operations to manage the roleManagementPolicyAssignments property of the microsoft.graph.policyRoot entity.



114
115
116
# File 'lib/policies/policies_request_builder.rb', line 114

def role_management_policy_assignments()
    return MicrosoftGraph::Policies::RoleManagementPolicyAssignments::RoleManagementPolicyAssignmentsRequestBuilder.new(@path_parameters, @request_adapter)
end

#to_get_request_information(request_configuration = nil) ⇒ Object

Get policies

Parameters:

  • request_configuration (defaults to: nil) —

    Configuration for the request such as headers, query parameters, and middleware options.

Returns:

  • a request_information



171
172
173
174
175
176
177
178
179
180
181
182
183
# File 'lib/policies/policies_request_builder.rb', line 171

def to_get_request_information(request_configuration=nil)
    request_info = MicrosoftKiotaAbstractions::RequestInformation.new()
    request_info.url_template = @url_template
    request_info.path_parameters = @path_parameters
    request_info.http_method = :GET
    request_info.headers.add('Accept', 'application/json')
    unless request_configuration.nil?
        request_info.add_headers_from_raw_object(request_configuration.headers)
        request_info.set_query_string_parameters_from_raw_object(request_configuration.query_parameters)
        request_info.add_request_options(request_configuration.options)
    end
    return request_info
end

#to_patch_request_information(body, request_configuration = nil) ⇒ Object

Update policies

Parameters:

  • body —

    The request body

  • request_configuration (defaults to: nil) —

    Configuration for the request such as headers, query parameters, and middleware options.

Returns:

  • a request_information

Raises:

  • (StandardError)


190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/policies/policies_request_builder.rb', line 190

def to_patch_request_information(body, request_configuration=nil)
    raise StandardError, 'body cannot be null' if body.nil?
    request_info = MicrosoftKiotaAbstractions::RequestInformation.new()
    request_info.url_template = @url_template
    request_info.path_parameters = @path_parameters
    request_info.http_method = :PATCH
    request_info.headers.add('Accept', 'application/json')
    unless request_configuration.nil?
        request_info.add_headers_from_raw_object(request_configuration.headers)
        request_info.add_request_options(request_configuration.options)
    end
    request_info.set_content_from_parsable(@request_adapter, "application/json", body)
    return request_info
end

#token_issuance_policies ⇒ Object

Provides operations to manage the tokenIssuancePolicies property of the microsoft.graph.policyRoot entity.



119
120
121
# File 'lib/policies/policies_request_builder.rb', line 119

def token_issuance_policies()
    return MicrosoftGraph::Policies::TokenIssuancePolicies::TokenIssuancePoliciesRequestBuilder.new(@path_parameters, @request_adapter)
end

#token_lifetime_policies ⇒ Object

Provides operations to manage the tokenLifetimePolicies property of the microsoft.graph.policyRoot entity.



124
125
126
# File 'lib/policies/policies_request_builder.rb', line 124

def token_lifetime_policies()
    return MicrosoftGraph::Policies::TokenLifetimePolicies::TokenLifetimePoliciesRequestBuilder.new(@path_parameters, @request_adapter)
end