Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating generic pass with template info using google client library #78

Open
miguelRedit opened this issue Jun 29, 2023 · 1 comment
Open

Comments

@miguelRedit
Copy link

Hello

Could you please let us know how to create programmatically a generic card pass in .net using google client library?
Would like to know to to define the filed path for my texmodules.

Something like this:

GenericObject newObject = new GenericObject
{
      TextModulesData = new List<TextModuleData>
                    {
                        new TextModuleData
                        {
                        Header = eventTicketDTO.NameLabel,
                        Body = eventTicketDTO.Name,
                        Id = "nome"


                        },
                        new TextModuleData
                        {
                        Header = eventTicketDTO.AssociatedLabel,
                        Body = eventTicketDTO.Associated,
                        Id = "socio"
                        },

                        new TextModuleData
                        {
                        Header = eventTicketDTO.BenchLabel,
                        Body = eventTicketDTO.Bench,
                        Id = "bancada",

                        }
            }
}

and class like

GenericClass newClass = new GenericClass
                {
                    Id = $"{issuerId}.{classSuffix}",
                    ClassTemplateInfo = new ClassTemplateInfo
                    {
                        CardTemplateOverride = new CardTemplateOverride
                        {
                            CardRowTemplateInfos = new List<CardRowTemplateInfo>
                            {
                                new CardRowTemplateInfo()
                                {
                                    OneItem = new CardRowOneItem
                                    {
                                       Item = new TemplateItem
                                       {
                                            FirstValue= new FieldSelector
                                            {
                                                Fields = new List<FieldReference>
                                                {
                                                    new FieldReference
                                                    {
                                                        FieldPath = "object.payload.genericObjects[0].textModulesData[0].id"

                                                    }
                                                }
                                            },
                                            SecondValue= new FieldSelector
                                            {
                                                Fields = new List<FieldReference>
                                                {
                                                    new FieldReference
                                                    {
                                                        FieldPath = "object.payload.genericObjects[0].textModulesData[0].id"
                                                    }
                                                }
                                            }


                                       }
                                    }
                                },
                    }
         }
    }

For some reason all of my attemps its not working, its not defining a template and referencing the values

Thanks a lot!

@singhdilip1007
Copy link

@miguelRedit I'm also looking for a way to create a google generic pass using C#, but no results have been found. Have to got anything? Please let me know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants