def enable_service(service_id, sso_account_id)
      url_gen = EyServicesFake::URL_GEN
      service_account = ServiceAccount.create(:sso_account_id => sso_account_id, :active => false, :service_id => service_id, :dashboard_notifications_url => "#{base_url}/dashboard_notifications_url")
      service = Service.get(service_id)
      creation_attributes = {
        :id             => service_account.id,
        :name           => Account.get(sso_account_id).name,
        :url            => url_gen.partner_service_account(service, service_account),
        :messages_url   => url_gen.messages(service, service_account),
        :invoices_url   => url_gen.invoices(service, service_account),
      }
      @connection.post(service.service_accounts_url, creation_attributes) do |result, location|
        service_account.active = true
        if result["service_account"]
          service_account.provisioned_services_url = result["service_account"]['provisioned_services_url']
          service_account.configuration_url = result["service_account"]['configuration_url']
          service_account.url = result["service_account"]['url']
          service_account.configuration_required = result["service_account"]['configuration_required']
          service_account.users_url = result["service_account"]['users_url']
        end
        if result["message"] && result["message"]["message_type"]
          Message.create(
            :service_account_id => service_account.id,
            :message_type => result["message"]["message_type"],
            :subject => result["message"]["subject"],
            :body => result["message"]["body"])
        end
        service_account.save
      end
    end
def enable_service(service_id, sso_account_id)
      url_gen = EyServicesFake::URL_GEN
      service_account = ServiceAccount.create(:sso_account_id => sso_account_id, :active => false, :service_id => service_id, :dashboard_notifications_url => "#{base_url}/dashboard_notifications_url")
      service = Service.get(service_id)
      creation_attributes = {
        :id             => service_account.id,
        :name           => Account.get(sso_account_id).name,
        :url            => url_gen.partner_service_account(service, service_account),
        :messages_url   => url_gen.messages(service, service_account),
        :invoices_url   => url_gen.invoices(service, service_account),
      }
      @connection.post(service.service_accounts_url, creation_attributes) do |result, location|
        service_account.active = true
        if result["service_account"]
          service_account.provisioned_services_url = result["service_account"]['provisioned_services_url']
          service_account.configuration_url = result["service_account"]['configuration_url']
          service_account.url = result["service_account"]['url']
          service_account.configuration_required = result["service_account"]['configuration_required']
          service_account.users_url = result["service_account"]['users_url']
        end
        if result["message"] && result["message"]["message_type"]
          Message.create(
            :service_account_id => service_account.id,
            :message_type => result["message"]["message_type"],
            :subject => result["message"]["subject"],
            :body => result["message"]["body"])
        end
        service_account.save
      end
    end
Normal implmentations of AWSM would not be posting to service_accounts_url;
they would be posting to private API to say that they wish to create a service account
but this is reacharound AWSM, and so it plays the role of tresfiestas internals here
 def enable_service(connection, sso_account, service_hash)