text: #!/usr/bin/python
  # -*- coding: utf-8 -*-
  
  # Copyright 2016 Eric Jacob <erjac77@gmail.com>
  #
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  #
  #     http://www.apache.org/licenses/LICENSE-2.0
  #
  # 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.
  
  ANSIBLE_METADATA = {
      "metadata_version": "1.1",
      "status": ["preview"],
      "supported_by": "community",
  }
  
  DOCUMENTATION = """
  ---
  module: f5bigip_ltm_data_group_internal
  short_description: BIG-IP ltm internal data-group module
  description:
      - Configures an internal class.
  version_added: "1.0.0" # of erjac77.f5 role
  author:
      - "Eric Jacob (@erjac77)"
  options:
      records:
          description:
              - Configures the data in the group.
      type:
          description:
              - Specifies the kind of data in the group.
          default: string
          choices: ['integer', 'ip', 'string']
  extends_documentation_fragment:
      - f5_common
      - f5_app_service
      - f5_description
      - f5_name
      - f5_partition
      - f5_state
  """
  
  EXAMPLES = """
  - name: Create LTM Internal Data-Group
    f5bigip_ltm_data_group_internal:
      provider:
        server: "{{ ansible_host }}"
        server_port: "{{ http_port | default(443) }}"
        user: "{{ http_user }}"
        password: "{{ http_pass }}"
        validate_certs: false
      name: my_int_dg
      partition: Common
      description: My internal data-group
      records: [{'name': 'n1', 'data': 'd1'}, {'name': 'n2', 'data': 'd2'}]
      type: string
      state: present
    delegate_to: localhost
  """
  
  RETURN = """ # """
  
  from ansible.module_utils.basic import AnsibleModule
  from ansible.module_utils.erjac77.network.f5.common import F5_NAMED_OBJ_ARGS
  from ansible.module_utils.erjac77.network.f5.common import F5_PROVIDER_ARGS
  from ansible.module_utils.erjac77.network.f5.bigip import F5BigIpNamedObject
  
  
  class ModuleParams(object):
      @property
      def argument_spec(self):
          argument_spec = dict(
              app_service=dict(type="str"),
              description=dict(type="str"),
              records=dict(type="list"),
              type=dict(type="str", choices=["integer", "ip", "string"]),
          )
          argument_spec.update(F5_PROVIDER_ARGS)
          argument_spec.update(F5_NAMED_OBJ_ARGS)
          return argument_spec
  
      @property
      def supports_check_mode(self):
          return True
  
  
  class F5BigIpLtmDataGroupInternal(F5BigIpNamedObject):
      def _set_crud_methods(self):
          self._methods = {
              "create": self._api.tm.ltm.data_group.internals.internal.create,
              "read": self._api.tm.ltm.data_group.internals.internal.load,
              "update": self._api.tm.ltm.data_group.internals.internal.update,
              "delete": self._api.tm.ltm.data_group.internals.internal.delete,
              "exists": self._api.tm.ltm.data_group.internals.internal.exists,
          }
  
  
  def main():
      params = ModuleParams()
      module = AnsibleModule(
          argument_spec=params.argument_spec,
          supports_check_mode=params.supports_check_mode,
      )
  
      try:
          obj = F5BigIpLtmDataGroupInternal(check_mode=module.check_mode, **module.params)
          result = obj.flush()
          module.exit_json(**result)
      except Exception as exc:
          module.fail_json(msg=str(exc))
  
  
  if __name__ == "__main__":
      main()
  