code: def create_gre_tunnel_endpoint(cls, endpoint=None, tunnel_interface=None,
                                     remote_address=None):
          
          tunnel_interface = tunnel_interface.href if tunnel_interface else None
          endpoint = endpoint.href if endpoint else None
          return TunnelEndpoint(
              tunnel_interface_ref=tunnel_interface,
              endpoint_ref=endpoint,
              ip_address=remote_address)
docs: Create the GRE tunnel mode or no encryption mode endpoint.
          If the GRE tunnel mode endpoint is an SMC managed device,
          both an endpoint and a tunnel interface is required. If the
          endpoint is externally managed, only an IP address is required.
          
          :param InternalEndpoint,ExternalEndpoint endpoint: the endpoint
              element for this tunnel endpoint.
          :param TunnelInterface tunnel_interface: the tunnel interface for
              this tunnel endpoint. Required for SMC managed devices.
          :param str remote_address: IP address, only required if the tunnel
              endpoint is a remote gateway.
          :rtype: TunnelEndpoint