text: # Copyright 2014 Facebook, Inc.
  
  # You are hereby granted a non-exclusive, worldwide, royalty-free license to
  # use, copy, modify, and distribute this software in source code or binary
  # form for use in connection with the web services and APIs provided by
  # Facebook.
  
  # As with any software that integrates with the Facebook platform, your use
  # of this software is subject to the Facebook Developer Principles and
  # Policies [http://developers.facebook.com/policy/]. This copyright notice
  # shall be included in all copies or substantial portions of the software.
  
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  # DEALINGS IN THE SOFTWARE.
  
  from facebook_business.adobjects.abstractobject import AbstractObject
  from facebook_business.adobjects.abstractcrudobject import AbstractCrudObject
  from facebook_business.adobjects.objectparser import ObjectParser
  from facebook_business.api import FacebookRequest
  from facebook_business.typechecker import TypeChecker
  
  """
  This class is auto-generated.
  
  For any issues or feature requests related to this class, please let us know on
  github and we'll fix in our codegen framework. We'll not be able to accept
  pull request for this class.
  """
  
  class Referral(
      AbstractCrudObject,
  ):
  
      def __init__(self, fbid=None, parent_id=None, api=None):
          self._isReferral = True
          super(Referral, self).__init__(fbid, parent_id, api)
  
      class Field(AbstractObject.Field):
          id = 'id'
          invite_limit = 'invite_limit'
          messenger_cta = 'messenger_cta'
          messenger_promotion_text = 'messenger_promotion_text'
          namespace = 'namespace'
          need_promo_code = 'need_promo_code'
          offer_origin = 'offer_origin'
          promotion_text = 'promotion_text'
          receiver_benefits_text = 'receiver_benefits_text'
          referral_link_uri = 'referral_link_uri'
          sender_benefits_text = 'sender_benefits_text'
  
      # @deprecated get_endpoint function is deprecated
      @classmethod
      def get_endpoint(cls):
          return 'referral'
  
      def api_create(self, parent_id, fields=None, params=None, batch=None, success=None, failure=None, pending=False):
          from facebook_business.adobjects.adaccount import AdAccount
          return AdAccount(api=self._api, fbid=parent_id).create_referral(fields, params, batch, success, failure, pending)
  
      def api_delete(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False):
          from facebook_business.utils import api_utils
          if batch is None and (success is not None or failure is not None):
            api_utils.warning('`success` and `failure` callback only work for batch call.')
          param_types = {
          }
          enums = {
          }
          request = FacebookRequest(
              node_id=self['id'],
              method='DELETE',
              endpoint='/',
              api=self._api,
              param_checker=TypeChecker(param_types, enums),
              target_class=AbstractCrudObject,
              api_type='NODE',
              response_parser=ObjectParser(reuse_object=self),
          )
          request.add_params(params)
          request.add_fields(fields)
  
          if batch is not None:
              request.add_to_batch(batch, success=success, failure=failure)
              return request
          elif pending:
              return request
          else:
              self.assure_call()
              return request.execute()
  
      def api_get(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False):
          from facebook_business.utils import api_utils
          if batch is None and (success is not None or failure is not None):
            api_utils.warning('`success` and `failure` callback only work for batch call.')
          param_types = {
          }
          enums = {
          }
          request = FacebookRequest(
              node_id=self['id'],
              method='GET',
              endpoint='/',
              api=self._api,
              param_checker=TypeChecker(param_types, enums),
              target_class=Referral,
              api_type='NODE',
              response_parser=ObjectParser(reuse_object=self),
          )
          request.add_params(params)
          request.add_fields(fields)
  
          if batch is not None:
              request.add_to_batch(batch, success=success, failure=failure)
              return request
          elif pending:
              return request
          else:
              self.assure_call()
              return request.execute()
  
      def api_update(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False):
          from facebook_business.utils import api_utils
          if batch is None and (success is not None or failure is not None):
            api_utils.warning('`success` and `failure` callback only work for batch call.')
          param_types = {
              'invite_limit': 'unsigned int',
              'messenger_cta': 'string',
              'messenger_promotion_text': 'string',
              'namespace': 'unsigned int',
              'need_promo_code': 'bool',
              'offer_origin': 'string',
              'promotion_text': 'string',
              'receiver_benefits_text': 'string',
              'referral_link_uri': 'string',
              'sender_benefits_text': 'string',
          }
          enums = {
          }
          request = FacebookRequest(
              node_id=self['id'],
              method='POST',
              endpoint='/',
              api=self._api,
              param_checker=TypeChecker(param_types, enums),
              target_class=Referral,
              api_type='NODE',
              response_parser=ObjectParser(reuse_object=self),
          )
          request.add_params(params)
          request.add_fields(fields)
  
          if batch is not None:
              request.add_to_batch(batch, success=success, failure=failure)
              return request
          elif pending:
              return request
          else:
              self.assure_call()
              return request.execute()
  
      _field_types = {
          'id': 'string',
          'invite_limit': 'int',
          'messenger_cta': 'string',
          'messenger_promotion_text': 'string',
          'namespace': 'string',
          'need_promo_code': 'bool',
          'offer_origin': 'string',
          'promotion_text': 'string',
          'receiver_benefits_text': 'string',
          'referral_link_uri': 'string',
          'sender_benefits_text': 'string',
      }
      @classmethod
      def _get_field_enum_info(cls):
          field_enum_info = {}
          return field_enum_info
  
  
  