.. default-domain:: http .. highlight:: json Contracts ========= .. _http-SpaceCenter.ContractManager: .. rubric:: ContractManager Contracts manager. Obtained by calling :http:get:`/space-center/contract-manager`. A ``ContractManager`` object is passed and returned as its identifier, a number. A path that acts on an object takes it as ``(id)``. .. http:get:: /space-center/contract-manager/(id)/types A list of all contract types. :param id: The identifier of the :ref:`ContractManager ` object. :resjson set value: .. http:get:: /space-center/contract-manager/(id)/all-contracts A list of all contracts. :param id: The identifier of the :ref:`ContractManager ` object. :resjson list value: .. http:get:: /space-center/contract-manager/(id)/active-contracts A list of all active contracts. :param id: The identifier of the :ref:`ContractManager ` object. :resjson list value: .. http:get:: /space-center/contract-manager/(id)/offered-contracts A list of all offered, but unaccepted, contracts. :param id: The identifier of the :ref:`ContractManager ` object. :resjson list value: .. http:get:: /space-center/contract-manager/(id)/completed-contracts A list of all completed contracts. :param id: The identifier of the :ref:`ContractManager ` object. :resjson list value: .. http:get:: /space-center/contract-manager/(id)/failed-contracts A list of all failed contracts. :param id: The identifier of the :ref:`ContractManager ` object. :resjson list value: .. _http-SpaceCenter.Contract: .. rubric:: Contract A contract. Can be accessed using :http:get:`/space-center/contract-manager`. A ``Contract`` object is passed and returned as its identifier, a number. A path that acts on an object takes it as ``(id)``. .. http:get:: /space-center/contract/(id)/type Type of the contract. :param id: The identifier of the :ref:`Contract ` object. :resjson string value: .. http:get:: /space-center/contract/(id)/title Title of the contract. :param id: The identifier of the :ref:`Contract ` object. :resjson string value: .. http:get:: /space-center/contract/(id)/description Description of the contract. :param id: The identifier of the :ref:`Contract ` object. :resjson string value: .. http:get:: /space-center/contract/(id)/notes Notes for the contract. :param id: The identifier of the :ref:`Contract ` object. :resjson string value: .. http:get:: /space-center/contract/(id)/synopsis Synopsis for the contract. :param id: The identifier of the :ref:`Contract ` object. :resjson string value: .. http:get:: /space-center/contract/(id)/keywords Keywords for the contract. :param id: The identifier of the :ref:`Contract ` object. :resjson list value: .. http:get:: /space-center/contract/(id)/state State of the contract. :param id: The identifier of the :ref:`Contract ` object. :resjson SpaceCenter.ContractState value: .. http:get:: /space-center/contract/(id)/seen Whether the contract has been seen. :param id: The identifier of the :ref:`Contract ` object. :resjson bool value: .. http:get:: /space-center/contract/(id)/read Whether the contract has been read. :param id: The identifier of the :ref:`Contract ` object. :resjson bool value: .. http:get:: /space-center/contract/(id)/active Whether the contract is active. :param id: The identifier of the :ref:`Contract ` object. :resjson bool value: .. http:get:: /space-center/contract/(id)/failed Whether the contract has been failed. :param id: The identifier of the :ref:`Contract ` object. :resjson bool value: .. http:get:: /space-center/contract/(id)/can-be-canceled Whether the contract can be canceled. :param id: The identifier of the :ref:`Contract ` object. :resjson bool value: .. http:get:: /space-center/contract/(id)/can-be-declined Whether the contract can be declined. :param id: The identifier of the :ref:`Contract ` object. :resjson bool value: .. http:get:: /space-center/contract/(id)/can-be-failed Whether the contract can be failed. :param id: The identifier of the :ref:`Contract ` object. :resjson bool value: .. http:post:: /space-center/contract/(id)/accept Accept an offered contract. :param id: The identifier of the :ref:`Contract ` object. .. http:post:: /space-center/contract/(id)/cancel Cancel an active contract. :param id: The identifier of the :ref:`Contract ` object. .. http:post:: /space-center/contract/(id)/decline Decline an offered contract. :param id: The identifier of the :ref:`Contract ` object. .. http:get:: /space-center/contract/(id)/funds-advance Funds received when accepting the contract. :param id: The identifier of the :ref:`Contract ` object. :resjson double value: .. http:get:: /space-center/contract/(id)/funds-completion Funds received on completion of the contract. :param id: The identifier of the :ref:`Contract ` object. :resjson double value: .. http:get:: /space-center/contract/(id)/funds-failure Funds lost if the contract is failed. :param id: The identifier of the :ref:`Contract ` object. :resjson double value: .. http:get:: /space-center/contract/(id)/reputation-completion Reputation gained on completion of the contract. :param id: The identifier of the :ref:`Contract ` object. :resjson double value: .. http:get:: /space-center/contract/(id)/reputation-failure Reputation lost if the contract is failed. :param id: The identifier of the :ref:`Contract ` object. :resjson double value: .. http:get:: /space-center/contract/(id)/science-completion Science gained on completion of the contract. :param id: The identifier of the :ref:`Contract ` object. :resjson double value: .. http:get:: /space-center/contract/(id)/parameters Parameters for the contract. :param id: The identifier of the :ref:`Contract ` object. :resjson list value: .. http:get:: /space-center/contract/(id)/date-accepted Universal time at which the contract was accepted, in seconds. Zero if the contract has not been accepted. :param id: The identifier of the :ref:`Contract ` object. :resjson double value: .. http:get:: /space-center/contract/(id)/date-deadline Universal time by which the contract must be completed, in seconds. Zero if the contract has no deadline. :param id: The identifier of the :ref:`Contract ` object. :resjson double value: .. http:get:: /space-center/contract/(id)/date-expire Universal time at which the contract offer expires, in seconds. Zero if the contract has no expiry date. :param id: The identifier of the :ref:`Contract ` object. :resjson double value: .. http:get:: /space-center/contract/(id)/date-finished Universal time at which the contract was completed or failed, in seconds. Zero if the contract has not finished or KSP did not record a finish time. :param id: The identifier of the :ref:`Contract ` object. :resjson double value: .. _http-SpaceCenter.ContractState: .. rubric:: ContractState The state of a contract. See :http:get:`/space-center/contract/(id)/state`. Passed and returned as the name of one of its values: ``"active"`` The contract is active. ``"canceled"`` The contract has been canceled. ``"completed"`` The contract has been completed. ``"deadline_expired"`` The deadline for the contract has expired. ``"declined"`` The contract has been declined. ``"failed"`` The contract has been failed. ``"generated"`` The contract has been generated. ``"offered"`` The contract has been offered to the player. ``"offer_expired"`` The contract was offered to the player, but the offer expired. ``"withdrawn"`` The contract has been withdrawn. .. _http-SpaceCenter.ContractParameter: .. rubric:: ContractParameter A contract parameter. See :http:get:`/space-center/contract/(id)/parameters`. A ``ContractParameter`` object is passed and returned as its identifier, a number. A path that acts on an object takes it as ``(id)``. .. http:get:: /space-center/contract-parameter/(id)/title Title of the parameter. :param id: The identifier of the :ref:`ContractParameter ` object. :resjson string value: .. http:get:: /space-center/contract-parameter/(id)/notes Notes for the parameter. :param id: The identifier of the :ref:`ContractParameter ` object. :resjson string value: .. http:get:: /space-center/contract-parameter/(id)/children Child contract parameters. :param id: The identifier of the :ref:`ContractParameter ` object. :resjson list value: .. http:get:: /space-center/contract-parameter/(id)/completed Whether the parameter has been completed. :param id: The identifier of the :ref:`ContractParameter ` object. :resjson bool value: .. http:get:: /space-center/contract-parameter/(id)/failed Whether the parameter has been failed. :param id: The identifier of the :ref:`ContractParameter ` object. :resjson bool value: .. http:get:: /space-center/contract-parameter/(id)/optional Whether the contract parameter is optional. :param id: The identifier of the :ref:`ContractParameter ` object. :resjson bool value: .. http:get:: /space-center/contract-parameter/(id)/funds-completion Funds received on completion of the contract parameter. :param id: The identifier of the :ref:`ContractParameter ` object. :resjson double value: .. http:get:: /space-center/contract-parameter/(id)/funds-failure Funds lost if the contract parameter is failed. :param id: The identifier of the :ref:`ContractParameter ` object. :resjson double value: .. http:get:: /space-center/contract-parameter/(id)/reputation-completion Reputation gained on completion of the contract parameter. :param id: The identifier of the :ref:`ContractParameter ` object. :resjson double value: .. http:get:: /space-center/contract-parameter/(id)/reputation-failure Reputation lost if the contract parameter is failed. :param id: The identifier of the :ref:`ContractParameter ` object. :resjson double value: .. http:get:: /space-center/contract-parameter/(id)/science-completion Science gained on completion of the contract parameter. :param id: The identifier of the :ref:`ContractParameter ` object. :resjson double value: