Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
request, error = await self._request_executor.create_request(
http_method, api_url, body, headers
)
if error:
return (None, None, error)
response, error = await self._request_executor\
.execute(request, Policy)
if error:
return (None, response, error)
try:
result = Policy(
response.get_body()
)
except Exception as error:
return (None, response, error)
return (result, response, None)
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY
# SEE CONTRIBUTOR DOCUMENTATION
from okta.models.policy\
import Policy
class OAuthAuthorizationPolicy(
Policy
):
"""
A class for OAuthAuthorizationPolicy objects.
"""
def __init__(self, config=None):
super().__init__(config)
pass
def request_format(self):
parent_req_format = super().request_format()
current_obj_format = {
}
parent_req_format.update(current_obj_format)
return parent_req_format
http_method, api_url, body, headers
)
if error:
return (None, None, error)
response, error = await self._request_executor\
.execute(request, Policy)
if error:
return (None, response, error)
try:
result = []
for item in response.get_body():
result.append(Policy(item))
except Exception as error:
return (None, response, error)
return (result, response, None)
request, error = await self._request_executor.create_request(
http_method, api_url, body, headers
)
if error:
return (None, None, error)
response, error = await self._request_executor\
.execute(request, Policy)
if error:
return (None, response, error)
try:
result = Policy(
response.get_body()
)
except Exception as error:
return (None, response, error)
return (result, response, None)
limitations under the License.
"""
# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY
# SEE CONTRIBUTOR DOCUMENTATION
from okta.models.policy\
import Policy
from okta.models.password_policy_conditions\
import PasswordPolicyConditions
from okta.models.password_policy_settings\
import PasswordPolicySettings
class PasswordPolicy(
Policy
):
"""
A class for PasswordPolicy objects.
"""
def __init__(self, config=None):
super().__init__(config)
if config:
if "conditions" in config:
if isinstance(config["conditions"],
PasswordPolicyConditions):
self.conditions = config["conditions"]
else:
self.conditions = PasswordPolicyConditions(
config["conditions"]
)
http_method, api_url, body, headers
)
if error:
return (None, None, error)
response, error = await self._request_executor\
.execute(request, Policy)
if error:
return (None, response, error)
try:
result = []
for item in response.get_body():
result.append(Policy(item))
except Exception as error:
return (None, response, error)
return (result, response, None)
/api/v1/authorizationServers/{authServerId}
/policies
""")
body = {}
headers = {}
request, error = await self._request_executor.create_request(
http_method, api_url, body, headers
)
if error:
return (None, None, error)
response, error = await self._request_executor\
.execute(request, Policy)
if error:
return (None, response, error)
try:
result = []
for item in response.get_body():
result.append(Policy(item))
except Exception as error:
return (None, response, error)
return (result, response, None)
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY
# SEE CONTRIBUTOR DOCUMENTATION
from okta.models.policy\
import Policy
from okta.models.okta_sign_on_policy_conditions\
import OktaSignOnPolicyConditions
class OktaSignOnPolicy(
Policy
):
"""
A class for OktaSignOnPolicy objects.
"""
def __init__(self, config=None):
super().__init__(config)
if config:
if "conditions" in config:
if isinstance(config["conditions"],
OktaSignOnPolicyConditions):
self.conditions = config["conditions"]
else:
self.conditions = OktaSignOnPolicyConditions(
config["conditions"]
)
# AUTO-GENERATED! DO NOT EDIT FILE DIRECTLY
# SEE CONTRIBUTOR DOCUMENTATION
from okta.models.policy\
import Policy
from okta.models.policy_account_link\
import PolicyAccountLink
from okta.models.provisioning\
import Provisioning
from okta.models.policy_subject\
import PolicySubject
class IdentityProviderPolicy(
Policy
):
"""
A class for IdentityProviderPolicy objects.
"""
def __init__(self, config=None):
super().__init__(config)
if config:
if "accountLink" in config:
if isinstance(config["accountLink"],
PolicyAccountLink):
self.account_link = config["accountLink"]
else:
self.account_link = PolicyAccountLink(
config["accountLink"]
)
body = policy.as_dict()
headers = {
"Accept": "application/json",
"Content-Type": "application/json"
}
request, error = await self._request_executor.create_request(
http_method, api_url, body, headers
)
if error:
return (None, None, error)
response, error = await self._request_executor\
.execute(request, Policy)
if error:
return (None, response, error)
try:
result = Policy(
response.get_body()
)
except Exception as error:
return (None, response, error)
return (result, response, None)