code: def to_billing_group(billing_group):
          
          from sevenbridges.models.billing_group import BillingGroup
          if not billing_group:
              raise SbgError('Billing group is required!')
          elif isinstance(billing_group, BillingGroup):
              return billing_group.id
          elif isinstance(billing_group, six.string_types):
              return billing_group
          else:
              raise SbgError('Invalid billing group parameter!')
docs: Serializes billing_group to id string
          :param billing_group: object to serialize
          :return: string id