// Code generated by qtc from "portal-api-fragment-template.qtpl". DO NOT EDIT.
// See https://github.com/valyala/quicktemplate for details.

// ----------------------------------------------
//
//
// Variables Used:
// - portalApi.Uuid
// - portalApi.LocationUrl
// - portalApi.SsgUrlBase64
// - portalApi.PolicyTemplates
// -------------------------------------------------
//

//line portal-api-fragment-template.qtpl:11
package templategen

//line portal-api-fragment-template.qtpl:11
import (
	qtio422016 "io"

	qt422016 "github.com/valyala/quicktemplate"
)

//line portal-api-fragment-template.qtpl:11
var (
	_ = qtio422016.Copy
	_ = qt422016.AcquireByteBuffer
)

//line portal-api-fragment-template.qtpl:11
func StreamFromApiFragmentTemplate(qw422016 *qt422016.Writer, portalApi PortalAPI) {
//line portal-api-fragment-template.qtpl:11
	qw422016.N().S(`
    <?xml version="1.0" encoding="UTF-8"?>
    <wsp:Policy xmlns:L7p="http://www.layer7tech.com/ws/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy">
      <wsp:All wsp:Usage="Required">
        <L7p:CommentAssertion>
          <L7p:Comment stringValue="============================="/>
        </L7p:CommentAssertion>
        <L7p:CommentAssertion>
          <L7p:Comment stringValue="======= Published thru API Portal ======="/>
        </L7p:CommentAssertion>
        <L7p:CommentAssertion>
          <L7p:Comment stringValue="======= Don't modify block starts ======="/>
        </L7p:CommentAssertion>
        <L7p:CommentAssertion>
          <L7p:Comment stringValue="============================="/>
        </L7p:CommentAssertion>
        <L7p:ApiPortalIntegration>
          <L7p:ApiGroup stringValue=""/>
          <L7p:ApiId stringValue="`)
//line portal-api-fragment-template.qtpl:29
	qw422016.E().S(portalApi.Uuid)
//line portal-api-fragment-template.qtpl:29
	qw422016.N().S(`"/>
          <L7p:PortalManagedApiFlag stringValue="L7p:ApiPortalManagedServiceAssertion"/>
        </L7p:ApiPortalIntegration>
        <L7p:SetVariable>
          <L7p:Base64Expression stringValue="`)
//line portal-api-fragment-template.qtpl:33
	qw422016.E().S(portalApi.LocationUrl)
//line portal-api-fragment-template.qtpl:33
	qw422016.N().S(`"/>
          <L7p:VariableToSet stringValue="apiLocation"/>
        </L7p:SetVariable>
        <L7p:SetVariable>
          <L7p:Base64Expression stringValue="`)
//line portal-api-fragment-template.qtpl:37
	qw422016.E().S(portalApi.SsgUrlBase64)
//line portal-api-fragment-template.qtpl:37
	qw422016.N().S(`"/>
          <L7p:VariableToSet stringValue="serviceUrl"/>
        </L7p:SetVariable>
        <L7p:SetVariable>
          <L7p:Base64Expression stringValue="JHtwb3J0YWwubWFuYWdlZC5zZXJ2aWNlLmFwaUlkfQ=="/>
          <L7p:VariableToSet stringValue="counterName"/>
        </L7p:SetVariable>
        `)
//line portal-api-fragment-template.qtpl:44
	for _, policyTemplate := range portalApi.PolicyTemplates {
//line portal-api-fragment-template.qtpl:44
		qw422016.N().S(`
        <L7p:Encapsulated>
          <L7p:EncapsulatedAssertionConfigGuid stringValue="`)
//line portal-api-fragment-template.qtpl:46
		qw422016.E().S(policyTemplate.Uuid)
//line portal-api-fragment-template.qtpl:46
		qw422016.N().S(`"/>
          <L7p:Parameters mapValue="included">
              `)
//line portal-api-fragment-template.qtpl:48
		for _, policyTemplateArg := range policyTemplate.ApiPolicyTemplateArguments {
//line portal-api-fragment-template.qtpl:48
			qw422016.N().S(`
              <L7p:entry xmlns:L7p="http://www.layer7tech.com/ws/policy" >
                <L7p:key stringValue="`)
//line portal-api-fragment-template.qtpl:50
			qw422016.E().S(policyTemplateArg.Name)
//line portal-api-fragment-template.qtpl:50
			qw422016.N().S(`"/>
                <L7p:value stringValue="`)
//line portal-api-fragment-template.qtpl:51
			qw422016.E().S(policyTemplateArg.Value)
//line portal-api-fragment-template.qtpl:51
			qw422016.N().S(`"/>
              </L7p:entry>
              `)
//line portal-api-fragment-template.qtpl:53
		}
//line portal-api-fragment-template.qtpl:53
		qw422016.N().S(`
          </L7p:Parameters>
        </L7p:Encapsulated>
        `)
//line portal-api-fragment-template.qtpl:56
	}
//line portal-api-fragment-template.qtpl:56
	qw422016.N().S(`
        <L7p:CommentAssertion>
          <L7p:Comment stringValue="============================="/>
        </L7p:CommentAssertion>
        <L7p:CommentAssertion>
          <L7p:Comment stringValue="======= Don't modify block ends ======="/>
        </L7p:CommentAssertion>
        <L7p:CommentAssertion>
          <L7p:Comment stringValue="============================="/>
        </L7p:CommentAssertion>
      </wsp:All>
    </wsp:Policy>
`)
//line portal-api-fragment-template.qtpl:68
}

//line portal-api-fragment-template.qtpl:68
func WriteFromApiFragmentTemplate(qq422016 qtio422016.Writer, portalApi PortalAPI) {
//line portal-api-fragment-template.qtpl:68
	qw422016 := qt422016.AcquireWriter(qq422016)
//line portal-api-fragment-template.qtpl:68
	StreamFromApiFragmentTemplate(qw422016, portalApi)
//line portal-api-fragment-template.qtpl:68
	qt422016.ReleaseWriter(qw422016)
//line portal-api-fragment-template.qtpl:68
}

//line portal-api-fragment-template.qtpl:68
func FromApiFragmentTemplate(portalApi PortalAPI) string {
//line portal-api-fragment-template.qtpl:68
	qb422016 := qt422016.AcquireByteBuffer()
//line portal-api-fragment-template.qtpl:68
	WriteFromApiFragmentTemplate(qb422016, portalApi)
//line portal-api-fragment-template.qtpl:68
	qs422016 := string(qb422016.B)
//line portal-api-fragment-template.qtpl:68
	qt422016.ReleaseByteBuffer(qb422016)
//line portal-api-fragment-template.qtpl:68
	return qs422016
//line portal-api-fragment-template.qtpl:68
}
