# -*- coding: utf-8 -*-

###############################################################################
#
# ShowServer
# Display a comrephensive set of information about the querried server such as: state information, server templates used, SSH key href, etc.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# 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.
#
#
###############################################################################

from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution

import json

class ShowServer(Choreography):

    def __init__(self, temboo_session):
        """
        Create a new instance of the ShowServer Choreo. A TembooSession object, containing a valid
        set of Temboo credentials, must be supplied.
        """
        super(ShowServer, self).__init__(temboo_session, '/Library/RightScale/ShowServer')


    def new_input_set(self):
        return ShowServerInputSet()

    def _make_result_set(self, result, path):
        return ShowServerResultSet(result, path)

    def 
(self, session, exec_id, path):
        return ShowServerChoreographyExecution(session, exec_id, path)

class ShowServerInputSet(InputSet):
    """
    An InputSet with methods appropriate for specifying the inputs to the ShowServer
    Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
    """
    def set_AccountID(self, value):
        """
        Set the value of the AccountID input for this Choreo. ((required, string) The RightScale Account ID.)
        """
        super(ShowServerInputSet, self)._set_input('AccountID', value)
    def set_Password(self, value):
        """
        Set the value of the Password input for this Choreo. ((required, password) The RightScale account password.)
        """
        super(ShowServerInputSet, self)._set_input('Password', value)
    def set_ServerID(self, value):
        """
        Set the value of the ServerID input for this Choreo. ((required, integer) The RightScale Server ID that is to be stopped.)
        """
        super(ShowServerInputSet, self)._set_input('ServerID', value)
    def set_SubDomain(self, value):
        """
        Set the value of the SubDomain input for this Choreo. ((conditional, string) The Rightscale sub-domain appropriate for your Rightscale account. Defaults to "my" for legacy accounts. Other sub-domains include: jp-8 (Legacy Cloud Platform), us-3, us-4 (Unified Cloud Platform).)
        """
        super(ShowServerInputSet, self)._set_input('SubDomain', value)
    def set_Username(self, value):
        """
        Set the value of the Username input for this Choreo. ((required, string) The RightScale username.)
        """
        super(ShowServerInputSet, self)._set_input('Username', value)

class ShowServerResultSet(ResultSet):
    """
    A ResultSet with methods tailored to the values returned by the ShowServer Choreo.
    The ResultSet object is used to retrieve the results of a Choreo execution.
    """

    def getJSONFromString(self, str):
        return json.loads(str)

    def get_Response(self):
        """
        Retrieve the value for the "Response" output from this Choreo execution. ((xml) The response from Rightscale in XML format.)
        """
        return self._output.get('Response', None)

class ShowServerChoreographyExecution(ChoreographyExecution):

    def _make_result_set(self, response, path):
        return ShowServerResultSet(response, path)

_make_execution