class_docstr: Represents the constraints JSON file used in Amazon SageMaker Model Monitoring.
class_docstr_tok: ["Represents","the","constraints","JSON","file","used","in","Amazon","SageMaker","Model","Monitoring","."]
docstr: Initializes a Constraints object from a file path.
  
  Args:
      constraints_file_path (str): The path to the constraints file.
      kms_key (str): The kms_key to use when encrypting the file in S3.
      sagemaker_session (sagemaker.session.Session): A SageMaker Session
          object, used for SageMaker interactions (default: None). If not
          specified, one is created using the default AWS configuration
          chain.
  
  Returns:
      sagemaker.model_monitor.Constraints: The instance of Constraints generated from
          the local file path.
docstr_tok: ["Initializes","a","Constraints","object","from","a","file","path",".","Args",":","constraints_file_path","(","str",")",":","The","path","to","the","constraints","file",".","kms_key","(","str",")",":","The","kms_key","to","use","when","encrypting","the","file","in","S3",".","sagemaker_session","(","sagemaker.session.Session",")",":","A","SageMaker","Session","object",",","used","for","SageMaker","interactions","(","default",":","None",")",".","If","not","specified",",","one","is","created","using","the","default","AWS","configuration","chain",".","Returns",":","sagemaker.model_monitor.Constraints",":","The","instance","of","Constraints","generated","from","the","local","file","path","."]
code: def from_file_path(
      cls, constraints_file_path, kms_key=None, sagemaker_session=None
  ):
      """Initializes a Constraints object from a file path.
  
      Args:
          constraints_file_path (str): The path to the constraints file.
          kms_key (str): The kms_key to use when encrypting the file in S3.
          sagemaker_session (sagemaker.session.Session): A SageMaker Session
              object, used for SageMaker interactions (default: None). If not
              specified, one is created using the default AWS configuration
              chain.
  
      Returns:
          sagemaker.model_monitor.Constraints: The instance of Constraints generated from
              the local file path.
  
      """
      file_name = os.path.basename(constraints_file_path)
  
      with open(constraints_file_path, "r") as f:
          file_body = f.read()
  
      return Constraints.from_string(
          constraints_file_string=file_body,
          file_name=file_name,
          kms_key=kms_key,
          sagemaker_session=sagemaker_session,
      )
  
imports: from __future__ import print_function, absolute_import
  import json
  import logging
  import os
  import uuid
  from botocore.exceptions import ClientError
  from sagemaker import s3
  from sagemaker.session import Session
label_desc: Use image node_id 4 for calling the Constraints obj's underlying member method code with example usage: obj.from_file_path(cls, constraints_file_path, kms_key, sagemaker_session) and returns: Constraints